Run Your Linux Server or VPS from ChatGPT or Claude
Check logs, restart services, deploy and clean up disk space on your Linux server or VPS by asking ChatGPT or Claude: setup, a safe user, sudo, examples and safety rules.
By Sandeep Kumar Saini, founder of Shellway · Published 28 Oct 2026 · Updated 1 Dec 2026
If you run a VPS, a home server or a Raspberry Pi, most work is the same few jobs: how full is the disk, why did the service stop, what does the log say, deploy the new version. Normally that means an SSH client, the right commands and copying output back and forth. With Shellway you ask ChatGPT or Claude in plain words, from your laptop or your phone, and the AI runs the steps on the server itself and explains the result.
Mostly on your phone? See manage a Linux server from your phone with AI, with the options compared.
This guide covers the full setup on a Linux server, a safe user and sudo, everyday tasks, deploys, several servers and the safety rules. It works with ChatGPT, Claude (claude.ai, the desktop and phone apps), Claude Code, Cursor and Codex.
How it works
A small Shellway agent runs on the server as a normal Linux user. It makes an outgoing, encrypted connection to Shellway's relay, so you open no ports, change no firewall and need no VPN. Your AI app connects to Shellway as a remote MCP server (what is an MCP server?); each request goes to the agent, which runs it and sends the answer back. The relay does not store command output or file contents (security).
What you need
- A Linux server or VPS (for example Ubuntu 22.04+ or Debian 12+; x86-64 or ARM) and a way to open a terminal on it once.
- A free Shellway account at mcp.getshellway.com/dashboard.
- ChatGPT (add Shellway from its plugin directory) or a Claude plan with custom connectors (Pro, Max, Team or Enterprise), or Claude Code.
Step 1: choose the user the AI works as
The agent can do exactly what its Linux user can do, no more. Do not use root. Use your normal account, or a separate user just for the AI:
sudo adduser shellway
sudo -iu shellway
Give that user access only to what the AI should touch (your app folder, its logs). This is the most important safety decision on a server.
Step 2: install and pair the agent
In the dashboard choose Add computer and copy the one-line setup command with your pairing code. Paste it into the server's terminal as the user from step 1. It brings its own Node if the server has none and says "paired" when the server is connected. If pairing fails, see pairing help.
Then make it start by itself after a reboot:
npx -y shellway@latest service install
This creates a systemd user service. To keep it running when that user is not logged in, an admin runs once: sudo loginctl enable-linger shellway (use your user's name). Check it any time with npx shellway service status or npx shellway doctor.
Step 3: add Shellway to your AI app
- ChatGPT: open Shellway in ChatGPT's plugin directory, choose Connect and sign in. Or, with Developer mode: Settings → Apps & Connectors → Advanced settings → create a connector with
https://mcp.getshellway.com/mcpand OAuth (ChatGPT setup). - Claude: Settings → Connectors → Add custom connector →
https://mcp.getshellway.com/mcp, then Connect and sign in (Claude setup). - Claude Code:
claude mcp add --transport http shellway https://mcp.getshellway.com/mcp
Start a new chat, switch Shellway on and ask "Which of my computers are online?". Your server should be listed.
Everyday server tasks to ask for
- Health check: "Is my server healthy? Check disk, memory, load and any failed systemd services."
- Logs: "Show the last 100 lines of the nginx error log, group the errors and tell me the most common cause."
- A spike: "Read the last 200 lines of /var/log/myapp/error.log and tell me what caused the 500 errors around 14:30."
- Services: "Is the myapp service running? If not, show why it stopped."
- Ports and processes: "What is using port 3000, and which process uses the most memory right now?"
- Disk space: "Find log files older than 30 days in /var/log and show how much space they use. Do not delete anything yet."
- Backups: "Copy /srv/myapp/data to /backup with today's date in the folder name and check the copy." (backup prompt)
- Certificates: "When does the TLS certificate for example.com expire?"
More ready prompts: server health check, what is using a port and the prompt library.
Deploy from the chat
You can describe a whole sequence in one message, including what to do when a step fails:
"Go to /srv/myapp. Run git pull. If there are new commits, run npm install, then restart the myapp service. After the restart, call localhost:3000/health and tell me if it says ok. If anything fails, stop and tell me what went wrong."
The AI runs each step, reads the real output and reports what happened. For long jobs (a big build, a backup) it can start the program in the background and follow its output, so a slow step does not cut the chat off.
sudo and permissions
There is no terminal behind the chat, so a command that asks for a password (like plain sudo) will not work. That is a good default: the AI cannot become root. If the AI should restart one service, allow just that command for its user, for example with a sudoers rule that permits only systemctl restart myapp, and nothing else. Keep files the AI must read (app logs) readable by its user instead of giving it broad rights.
Safety rules on the server
Rules are set on the server itself, so the chat cannot change them:
npx shellway start --readonly # read-only: look, never change
npx shellway policy allow ~/projects # only this folder (repeat for more)
npx shellway policy block-deletes # block delete commands
npx shellway policy commands off # file tools only, no commands
npx shellway policy backups on # back up every file before it changes
npx shellway policy show # see the current rules
- Start with read-only for the first days (read-only first week); use
service install --readonlyto keep it that way after reboots. - Every action is logged in your dashboard (time, tool, result); remove the server from the dashboard to cut access at once.
- Keep the AI away from untrusted files and pages while it can run commands (prompt injection). More: safety rules.
Several servers
Pair each server (and your laptop if you like) with the same account and ask across all of them in one chat: "Check disk space on every server and list any above 80%." Name the one you mean when it matters ("on web-2, …"). See one task on all your computers.
For developers
In Claude Code, Cursor or Codex the AI first calls list_devices to see your paired servers, then reads files and runs commands on the one you name, next to your local project. The tools include run_command, start_process and read_process_output for long jobs, read_file, edit_block, search_files and download_file; see the tool reference. For a hand-written connector setup, see ChatGPT MCP server setup. Want the AI to work in cycles without you in the loop? Read how a beta tester runs an engineering loop with scheduled ChatGPT sessions.
Common questions
Do I need to open a port or set up a VPN?
No. The agent connects outward over HTTPS; nothing on the server is reachable from the internet through Shellway.
Can I use it from my phone?
Yes. Ask from the ChatGPT or Claude app on iPhone or Android; the commands run on the server (phone guide).
Should the agent run as root?
No. Run it as a normal user with access only to what the AI needs; see step 1 and the sudo section.
What does it cost?
New accounts get a 7-day Pro trial without a card, then a free plan with 50 actions a day on 1 computer. Starter is $5 a month (₹499 in India) for 1 computer; Pro covers 3 and Pro Max 10. See pricing.
Using Claude Code? See Claude Code on a VPS: install it there or connect remotely.