### Manual install steps for ServerMind Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Alternative to the one-line installer: clone the repo, install dependencies, run the guided setup to write .env, and start the service. Use `pm2 start ecosystem.config.cjs` instead of `bun run start` if you prefer PM2. ```bash $ git clone https://github.com/AjjlalAhmed/servermind.git && cd servermind $ bun install $ bun run setup # guided config → writes .env $ bun run start # or: pm2 start ecosystem.config.cjs ``` -------------------------------- ### Manual install and start ServerMind Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Manual installation steps: clone the repo, install dependencies, run the guided setup to write .env, and start the server either directly or via PM2. ```bash git clone https://github.com/AjjlalAhmed/servermind.git && cd servermind bun install bun run setup # guided config → writes .env (auth, AI backend, services) bun run start # or: pm2 start ecosystem.config.cjs ``` -------------------------------- ### Start on boot with pm2 startup Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Run `pm2 startup` and execute the command it prints, then `pm2 save` to enable ServerMind to start on boot. ```bash pm2 startup ``` ```bash pm2 save ``` -------------------------------- ### Enable email reports via setup wizard Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Run `cd ~/servermind && bun run setup` to enable email reports and alerts through the setup wizard's step 9. ```bash $ cd ~/servermind && bun run setup ``` -------------------------------- ### Reconfigure with bun run setup Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Run `cd ~/servermind && bun run setup` to reconfigure ServerMind. Use `bun run setup-auth` for just the password/2FA. ```bash cd ~/servermind && bun run setup ``` ```bash bun run setup-auth ``` -------------------------------- ### Install the ServerMind controller Source: https://github.com/ajjlalahmed/servermind/blob/main/desktop/src/renderer/index.html Run this command on your server to install the ServerMind controller. It is the first step in the setup process. ```bash curl servermind.dev/install.sh | bash ``` -------------------------------- ### Preview locally with Python HTTP server Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/README.md Starts a local static server from the landing directory. Use the alternative bunx serve command if preferred. Open http://localhost:4321 to view the site. ```bash cd landing python3 -m http.server 4321 # or: bunx serve . # open http://localhost:4321 ``` -------------------------------- ### Run setup-auth and reload PM2 Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Run on the server to set the password/2FA when the dashboard shows 'auth not configured'. Then reload the process manager to apply the change. ```bash bun run setup-auth ``` ```bash pm2 reload servermind ``` -------------------------------- ### View logs with pm2 logs Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Use `pm2 logs servermind` to view ServerMind's logs. ```bash pm2 logs servermind ``` -------------------------------- ### Install ServerMind with WireGuard mesh Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/index.html Run this installer command to set up ServerMind with an optional self-hosted WireGuard mesh for fleet communication when the controller has no public IP or domain. ```bash install.sh --mesh ``` -------------------------------- ### Apply changes with pm2 reload Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Use `pm2 reload servermind` to apply configuration changes after reconfiguring. ```bash pm2 reload servermind ``` -------------------------------- ### Install ServerMind with curl Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/compare.html One-line installation command for ServerMind. Run this in your terminal to download and execute the install script from servermind.dev. ```bash $ curl -fsSL https://servermind.dev/install.sh | bash ``` -------------------------------- ### Run the desktop app in development (npm install, npm start) Source: https://github.com/ajjlalahmed/servermind/blob/main/desktop/README.md Requires Node 18+. Installs dependencies and builds/launches Electron. If `electron --version` prints a Node version, clear `ELECTRON_RUN_AS_NODE` with `env -u ELECTRON_RUN_AS_NODE npm start`. ```bash cd desktop npm install npm start # builds (tsc) and launches Electron ``` -------------------------------- ### Install ServerMind with curl Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md One-line installation script for ServerMind. Downloads and runs the installer from servermind.dev. ```bash curl -fsSL https://servermind.dev/install.sh | bash ``` -------------------------------- ### Self-hosted WireGuard mesh for controller and agents Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Add --mesh to both install commands to run the controller↔agent link over your own WireGuard network. The controller installs WireGuard, opens UDP 51820, and writes a tightly-scoped sudoers rule; each agent generates its own keypair locally and enrolls with only its public key. ```bash $ # controller $ curl -fsSL https://servermind.dev/install.sh | bash -s -- --mesh $ # each agent (from Fleet → Add server) $ curl -fsSL https://servermind.dev/install.sh | bash -s -- \ --controller wss:///fleet/agent --token --mesh ``` -------------------------------- ### Pinned command example: redis-cli INFO memory Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Enter the command one argument per line; it runs with no shell, so metacharacters are ignored. Read-only by default; tick 'changes things' to make it a mutation gated by the arm switch. ```plaintext redis-cli INFO memory ``` -------------------------------- ### Install ServerMind Desktop via Homebrew Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/index.html Installs the ServerMind Desktop app on macOS using Homebrew. Add --no-quarantine to skip the unsigned-app prompt on first launch. ```bash $ brew install --cask AjjlalAhmed/homebrew-tap/servermind ``` -------------------------------- ### Read-only DB query example: SELECT COUNT(*) Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Frozen SQL query for a MySQL tool on 127.0.0.1:3306, database appdb, user sm_ro. The query is read-only and runs as configured. ```sql SELECT COUNT(*) AS active_orders FROM orders WHERE status = 'active' ``` -------------------------------- ### Install Controller with Mesh Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Installs the controller on your main box with fleet and WireGuard mesh enabled. Requires a reachable controller address and UDP 51820 open for the mesh. ```bash curl -fsSL https://servermind.dev/install.sh | bash -s -- --mesh ``` -------------------------------- ### Deploy site files to Caddy server Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/README.md Creates the web root, copies landing files and the installer/uninstaller scripts from the repo root, then reloads Caddy. Run after placing the Caddyfile. ```bash mkdir -p /var/www/servermind-site cp -r landing/* /var/www/servermind-site/ cp install.sh uninstall.sh /var/www/servermind-site/ # from the repo root systemctl reload caddy ``` -------------------------------- ### Add agent server with join token Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Run on each new server to connect it to the controller. Use wss:// when the controller is behind HTTPS (recommended); plain ws:// to a remote host is refused by default, add --insecure over a trusted private network. ```bash $ curl -fsSL https://servermind.dev/install.sh | bash -s -- \ --controller wss:///fleet/agent --token ``` -------------------------------- ### Google Gemini free backend configuration Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Configure ServerMind to use Google Gemini's free tier via the OpenAI-compatible endpoint. Requires an API key from aistudio.google.com; provides around 1,500 requests per day without a credit card. ```plaintext AI_BACKEND=openai AI_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai AI_MODEL=gemini-2.0-flash AI_API_KEY= ``` -------------------------------- ### Build installers with electron-builder (npm run dist) Source: https://github.com/ajjlalahmed/servermind/blob/main/desktop/README.md Generates dmg/nsis/AppImage+deb installers. App icons are not included yet; add `build/icon.icns|.ico|.png` before shipping signed builds. ```bash npm run dist # electron-builder → dmg / nsis / AppImage+deb ``` -------------------------------- ### Install agent with join token Source: https://github.com/ajjlalahmed/servermind/blob/main/ARCHITECTURE.md Used during enrollment to install the agent on a server, providing the controller URL and join token. The join token is swapped for a per-agent credential on first connect. ```bash curl -fsSL https://servermind.dev/install.sh | bash -s -- \ --controller wss://controller.example.com/fleet/agent --token "$SM_JOIN_TOKEN" ``` -------------------------------- ### Install Agent with Controller and Mesh Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Installs an agent on each VPS, connecting to the controller via WebSocket and enabling the mesh. The command is generated by the Fleet tab's 'Add server' button. The agent generates its own WireGuard keypair locally and enrolls with the controller. ```bash curl -fsSL https://servermind.dev/install.sh | bash -s -- \ --controller wss:///fleet/agent --token --mesh ``` -------------------------------- ### Re-run ServerMind setup to switch AI backend Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/index.html Use this command to reconfigure ServerMind and switch between AI backends (e.g., Gemini, Claude, Groq, Ollama). ```bash bun run setup ``` -------------------------------- ### SSH tunnel for private access Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Reach ServerMind privately from your laptop without exposing it to the internet. After running this command, open http://localhost:5500 in your browser. ```bash # SSH tunnel — then open http://localhost:5500 $ ssh -L 5500:127.0.0.1:5500 user@your-server ``` -------------------------------- ### Create read-only MySQL user sm_ro Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Creates a dedicated SELECT-only user scoped to the appdb database. Use this instead of an admin login for DB tools; the in-app read-only gate is a second layer. ```sql -- MySQL / MariaDB CREATE USER 'sm_ro'@'%' IDENTIFIED BY 'a-strong-password'; GRANT SELECT ON appdb.* TO 'sm_ro'@'%'; -- only the DB you want exposed FLUSH PRIVILEGES; ``` -------------------------------- ### Check agent logs with pm2 logs Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Check the agent's logs when an agent won't show up in the Fleet. Most often the FLEET_JOIN_TOKEN doesn't match the controller's, or SERVERMIND_CONTROLLER is wrong. ```bash pm2 logs servermind-agent ``` -------------------------------- ### Create read-only PostgreSQL role sm_ro Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Creates a dedicated SELECT-only role scoped to the appdb database. Use this instead of an admin login for DB tools; the in-app read-only gate is a second layer. ```sql -- PostgreSQL CREATE ROLE sm_ro LOGIN PASSWORD 'a-strong-password'; GRANT CONNECT ON DATABASE appdb TO sm_ro; GRANT USAGE ON SCHEMA public TO sm_ro; GRANT SELECT ON ALL TABLES IN SCHEMA public TO sm_ro; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO sm_ro; ``` -------------------------------- ### Disable response buffering for streaming chat Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Disable response buffering in the reverse proxy for streaming chat. Use flush_interval -1 in Caddy or proxy_buffering off in Nginx. ```bash flush_interval -1 ``` ```bash proxy_buffering off ``` -------------------------------- ### Install ServerMind Agent with Controller Connection Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/llms.txt One-line install command for each agent server. Connects to the controller via WebSocket using the provided token. ```bash curl -fsSL https://servermind.dev/install.sh | bash -s -- --controller wss:///fleet/agent --token ``` -------------------------------- ### Set SECURE_COOKIES and TRUST_PROXY Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Set these environment variables when login works locally but not behind Cloudflare/HTTPS. SECURE_COOKIES marks the session cookie Secure; TRUST_PROXY makes rate limiting and lockout read the real visitor IP from the proxy. ```bash SECURE_COOKIES=1 ``` ```bash TRUST_PROXY=1 ``` -------------------------------- ### Install ServerMind Controller with WireGuard Mesh Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/llms.txt Add --mesh to the controller install command to enable the self-hosted WireGuard mesh. The controller installs WireGuard, opens UDP 51820, and writes a scoped sudoers rule. ```bash curl -fsSL https://servermind.dev/install.sh | bash --mesh ``` -------------------------------- ### Caddy reverse proxy configuration for HTTPS Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Front ServerMind with Caddy for automatic HTTPS. The wizard prints this config when it detects Caddy; it also sets SECURE_COOKIES=1 and TRUST_PROXY=1 automatically. The `flush_interval -1` setting streams the chat (SSE) without buffering. ```plaintext # Caddy — automatic HTTPS servermind.example.com { reverse_proxy 127.0.0.1:5500 { flush_interval -1 # stream the chat (SSE) without buffering } } ``` -------------------------------- ### Set PM2_COMMAND for a different user Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/docs.html Set this environment variable when PM2 processes run under a different user (e.g., root) and the dashboard shows no PM2 processes. Requires a passwordless sudo rule; the wizard prints the exact line. ```bash PM2_COMMAND="sudo -n /root/.bun/bin/pm2" ``` -------------------------------- ### GitHub Action deployment with join token Source: https://github.com/ajjlalahmed/servermind/blob/main/ARCHITECTURE.md GitHub Action workflow using two repo secrets to install agents on multiple servers via SSH. The join token is passed to the install script, and the controller URL is provided. ```yaml env: SM_CONTROLLER_URL: ${{ secrets.SM_CONTROLLER_URL }} SM_JOIN_TOKEN: ${{ secrets.SM_JOIN_TOKEN }} steps: - run: | for host in $SERVERS; do ssh "$USER@$host" "curl -fsSL https://servermind.dev/install.sh | bash -s -- \ --controller '$SM_CONTROLLER_URL' --token '$SM_JOIN_TOKEN'" done ``` -------------------------------- ### Caddy configuration for servermind.dev Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/README.md Caddyfile configuration that serves the site root from /var/www/servermind-site with zstd and gzip encoding. Requires DNS pointing servermind.dev at the server. ```caddy servermind.dev { encode zstd gzip root * /var/www/servermind-site file_server } ``` -------------------------------- ### Configure Claude Code as AI backend Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Uses the local `claude` CLI, no API key required. Requires Claude Code installed and logged in on the box. ```ini AI_BACKEND=claude-code ``` -------------------------------- ### Install ServerMind Agent with WireGuard Mesh Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/llms.txt Add --mesh to the agent install command to use the WireGuard mesh. Each agent generates its own keypair locally and enrolls with the controller. ```bash curl -fsSL https://servermind.dev/install.sh | bash -s -- --controller wss:///fleet/agent --token --mesh ``` -------------------------------- ### Manual uninstall commands Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Manual equivalent of the uninstall script: deletes the PM2 process, saves PM2 state, removes the install directory (containing .env and logs), and optionally disables PM2 startup if ServerMind was the boot-start app. ```bash pm2 delete servermind && pm2 save rm -rf ~/servermind # contains .env + logs pm2 unstartup # only if ServerMind was your boot-start app ``` -------------------------------- ### Update ServerMind via curl script Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Run this command to update an existing ServerMind installation. It fetches the latest code, runs bun install, and reloads the process via pm2, auto-detecting whether the box is a controller or agent. Your .env, data/, and logs/ are preserved. ```bash curl -fsSL https://servermind.dev/update.sh | bash ``` -------------------------------- ### Uninstall from cloned repo Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Runs the uninstall command from a cloned repository. Stops and removes the servermind PM2 process, saves PM2 state, and after confirmation deletes the install directory including .env and logs. Bun, PM2, and git are left in place. ```bash bun run uninstall ``` -------------------------------- ### Uninstall via curl script Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Downloads and runs the official uninstall script from servermind.dev. Stops and removes the servermind PM2 process, saves PM2 state, and after confirmation deletes the install directory including .env and logs. Bun, PM2, and git are left in place. ```bash curl -fsSL https://servermind.dev/uninstall.sh | bash ``` -------------------------------- ### Project layout: src/main, src/preload, src/renderer Source: https://github.com/ajjlalahmed/servermind/blob/main/desktop/README.md Shows the directory structure of the desktop app: main process files (index.ts, store.ts, tunnel.ts, ipc.ts), preload contextBridge API, and renderer UI. ```text src/main/ Electron main process index.ts app lifecycle + window store.ts controller list + safeStorage-encrypted secrets tunnel.ts ssh2 SSH connection + local port-forward (the tunnel) ipc.ts IPC handlers + dashboard window src/preload/ contextBridge API (the only renderer surface) src/renderer/ control-panel UI (vanilla TS/HTML/CSS, no framework) ``` -------------------------------- ### Enroll a new client server with curl Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/use-case/agencies-freelancers/index.html Run this one-line command on a new client box to enroll it with the controller. The agent dials out over a WebSocket, so no inbound ports are opened. Replace the controller URL and token with your own. ```bash $ curl -fsSL https://servermind.dev/install.sh | bash -s -- \ --controller wss://your-controller/fleet/agent --token ``` -------------------------------- ### Configure Google Gemini as AI backend Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Free option with ~1,500 requests/day and no card. Set these values in .env to use Gemini via the OpenAI-compatible endpoint. ```ini AI_BACKEND=openai AI_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai AI_MODEL=gemini-2.0-flash AI_API_KEY= ``` -------------------------------- ### Run quick mesh container scenarios Source: https://github.com/ajjlalahmed/servermind/blob/main/test/mesh/README.md Runs only the Ubuntu and Alpine scenarios for faster iteration. Requires Docker and a host kernel with WireGuard support. ```bash test/mesh/run.sh quick # ubuntu + alpine only (fast) ``` -------------------------------- ### Development commands Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Common commands for local development: run the dev server, run type checking, and run tests. The dev server runs at http://127.0.0.1:5500. ```bash bun run dev # local dev (http://127.0.0.1:5500) bun run typecheck bun test ``` -------------------------------- ### Run all mesh container scenarios Source: https://github.com/ajjlalahmed/servermind/blob/main/test/mesh/README.md Runs all integration test scenarios across Ubuntu, Debian, Fedora, and Alpine. Requires Docker and a host kernel with WireGuard support. ```bash test/mesh/run.sh # all scenarios across ubuntu/debian/fedora/alpine ``` -------------------------------- ### Shell allowlist: read-only commands and arm gate Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/index.html Shows the server-enforced shell allowlist: read-only commands like df -h and systemctl status are allowed, while destructive or sensitive commands like rm -rf / and cat /etc/shadow are rejected. Mutations such as pm2 restart api require arming first, otherwise they are disarmed. ```bash # read-only by default — no rm, no writes, no network $ df -h ✓ allowed $ systemctl status ✓ allowed $ rm -rf / ✗ REJECTED $ cat /etc/shadow ✗ REJECTED # mutations need you to arm them first $ pm2 restart api ⚠ DISARMED — flip the switch ``` -------------------------------- ### Preview Mindy with a local HTTP server Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/mascot/README.md Run a local server in the landing/mascot directory to preview the interactive showcase. Serves at http://localhost:4321. ```bash cd landing/mascot python3 -m http.server 4321 # → http://localhost:4321 ``` -------------------------------- ### Architecture diagram: Desktop app SSH tunnel to controller Source: https://github.com/ajjlalahmed/servermind/blob/main/desktop/README.md Shows the desktop app opening one outbound SSH tunnel to the controller's 127.0.0.1:5500, with agents dialing out to the controller. ```text Desktop app ──one SSH tunnel──► controller 127.0.0.1:5500 (the hub) │ ▲ ▲ ▲ └─ forwards to localhost: │ │ │ agents dial OUT agent1 agent2 agent3 ``` -------------------------------- ### Caddy reverse proxy config for public HTTPS Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Ready-to-paste config for a public domain. The wizard prints this and detects which proxy you have. `flush_interval -1` streams the chat (SSE) without buffering. ```caddy servermind.example.com { reverse_proxy 127.0.0.1:5500 { flush_interval -1 # stream the chat (SSE) without buffering } } ``` -------------------------------- ### Embed the Lottie animation with the lottie-player web component Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/mascot/README.md No-JS alternative using the lottie-player web component. Loads the player script and places the animation with autoplay and loop enabled. ```html ``` -------------------------------- ### SSH tunnel command to access ServerMind locally Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/index.html Use this command to securely access the ServerMind UI on your server via an SSH tunnel. It binds to localhost on port 5500 and requires your server's user and address. ```bash ssh -L 5500:127.0.0.1:5500 user@server ``` -------------------------------- ### SSH tunnel to access ServerMind without domain Source: https://github.com/ajjlalahmed/servermind/blob/main/README.md Keeps the server private and reachable from your laptop. Nothing is exposed to the internet; open http://localhost:5500 after running the command. ```bash ssh -L 5500:127.0.0.1:5500 user@your-server # then open http://localhost:5500 ``` -------------------------------- ### Embed the Lottie animation with lottie-web Source: https://github.com/ajjlalahmed/servermind/blob/main/landing/mascot/README.md Loads the Lottie JSON into a div using lottie-web 5.12.2. Set the container size via inline styles and adjust the path to your JSON file. ```html
``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.