How to Use Claude Code on a Remote Server From Your Phone
Run Anthropic’s Claude Code AI coding agent directly on your Linux server and drive it from your phone: installing it, signing in with your Claude plan, and working safely.
By the Hectix team · · 4 min read
In short
Install Claude Code on your Linux server with Anthropic’s official installer, sign in with your Claude Pro or Max plan, and run it inside your project folder. From a phone, use an SSH app or Hectix, which runs Claude Code on your server, keeps working if your phone locks, and shows the replies in a chat view.
AI coding agents are most useful where the code actually runs. Running one directly on your server means it can read the real configuration, run the real tests and check the real logs, instead of guessing from a copy on your laptop. Driving it from your phone means you can fix a broken deploy from anywhere.
This guide shows how to set up Claude Code, Anthropic’s AI coding agent, on a Linux server, and how to use it safely from a phone.
What Claude Code does
Claude Code is a command-line agent. You start it inside a project folder and describe what you want in plain language: “find out why the build fails”, “add rate limiting to the login route”, “why is nginx returning 502?”. It reads files, runs commands and proposes or makes changes. A permission mode decides how much it may do without asking.
On a server, that turns into a capable assistant for:
- reading logs and explaining errors,
- fixing failed builds and broken dependencies,
- making small code and configuration changes,
- writing the commands you would otherwise have to type on a phone keyboard.
Step 1: Install Claude Code on the server
Connect to the server over SSH as the user who owns your project (not root), and run Anthropic’s official installer:
curl -fsSL https://claude.ai/install.sh | bashIt installs into your home folder, so it needs no sudo. Check that it worked:
claude --versionIf the shell can’t find claude, open a new SSH session so your updated PATH is loaded.
Step 2: Sign in with your Claude plan
Start Claude Code once and follow the sign-in prompt. On a server with no browser, it shows a link: open it on your phone, approve the sign-in, and paste the code back into the terminal.
You can sign in with a Claude Pro or Max subscription, so usage counts against your plan, or with an Anthropic API key, billed per use. The sign-in is stored for your user on that server, so you only do this once.
Step 3: Run it in your project
Always start Claude Code inside the project folder, so it works on the right code:
cd /opt/myapp
claudeThen describe the task. Good requests are specific and include what you already know:
- “The API returns 502 since this morning’s deploy. Check the PM2 logs and nginx error log and tell me why. Don’t change anything yet.”
- “npm run build fails. Find the cause and fix it.”
- “Add a /health endpoint that checks the database connection.”
Step 4: Work safely
An agent that can run commands on a server deserves the same care as a new colleague with shell access:
- Commit first. Run
git statusand commit or stash your work, so any change can be undone with Git. - Start read-only. Ask it to investigate and explain before it edits anything. Claude Code has a plan mode for exactly this.
- Review the changes. Read the diff (
git diff) before restarting services. - Prefer staging for big changes. Use production for small, urgent fixes; do bigger work on a staging copy.
- Keep secrets out of prompts. Don’t paste passwords or API keys into the chat.
Using it from your phone
Any SSH terminal app can run claude from a phone, but two things get in the way: the interactive terminal is cramped on a small screen, and if your phone locks or the connection drops, the session may end mid-task. Running it inside tmux solves the second problem:
tmux new -s claude # start a session that survives disconnects
claude
# later, after reconnecting:
tmux attach -t claudeHectix is built for this workflow. Its AI tab runs Claude Code on your connected server, signed in with your own Claude plan, and shows the conversation as a chat. Each message runs in the background on the server, so the work continues if your phone locks or the connection drops, and the app picks up the replies when you come back. Nothing goes through Hectix’s servers: the agent runs on your machine, and your code stays there.
When things go wrong
- “command not found: claude”: open a new SSH session, or add
~/.local/binto yourPATH. - Sign-in link expired: start Claude Code again for a fresh link, and paste the code back quickly.
- It is changing the wrong files: make sure you started it in the right folder, and give it the exact path.
Summary
Claude Code on your server gives you an AI teammate with access to the real code and logs. Install it as a normal user with the official installer, sign in with your Claude plan, start it in your project, and keep Git as your safety net. From a phone, use tmux or an app built for it. Before you start, make sure the server itself is healthy with these ten health-check commands.
Questions
What is Claude Code?
Claude Code is Anthropic’s AI coding agent. It runs in a terminal inside your project, reads the code, runs commands and makes changes, asking for your approval according to the permission mode you choose.
Do I need an API key to use Claude Code on a server?
No. You can sign in with a Claude Pro or Max subscription, and usage counts against that plan. You can also use an Anthropic API key, which is billed per use.
Does Claude Code need root access on the server?
No. The official installer puts it in your user’s home folder. Run it as the same user that owns the project, not as root.
Is it safe to let an AI agent change files on a production server?
Treat it like a new team member: commit your work to Git first, start in a read-only planning mode, review its changes before applying them, and prefer a staging copy for large changes.
Your servers, within reach.
Manage Linux servers over SSH from your phone, with AI in your projects.