Contents
Claude Code is Anthropic’s coding agent: you describe a task, and it reads your project, edits files and runs commands such as tests or git diff, asking permission according to your settings. Running it next to the real files on your hosting removes the download, edit and upload cycle. It also means the agent works on a live environment, so the safety checklist below matters as much as the install.
Before you start
- A hosting plan with SSH (on ArabyHost, an AI/Developer plan) and a key that signs in: see Connect to your server over SSH.
- An Anthropic account that includes Claude Code: a paid Claude plan or a Claude Console account.
- Node.js 22 or later on the server for the npm install. Node.js 24 is ideal; on Node.js 20 npm prints an
EBADENGINEwarning. - Your project in a Git repository, so every change can be reviewed and undone.
Way 1: the CLI on the server
1. Connect and check Node.js
ssh myhosting
node -v # v24.x recommended
npm config get prefix # should be inside your home, e.g. /home/myuser/.local
If the prefix points to a system folder, move it into your home and add its bin folder to PATH:
npm config set prefix ~/.local
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
2. Install Claude Code
npm install -g @anthropic-ai/claude-code@latest --prefix ~/.local
claude --version
claude doctor
claude doctor checks the installation and settings without starting a session. Anthropic also offers a native installer that places claude in ~/.local/bin and updates itself in the background:
curl -fsSL https://claude.ai/install.sh | bash
Pick one method, not both, and never install with sudo.
3. Sign in on a server without a browser
cd ~/myapp
claude
Choose your account type. The server has no browser, so Claude Code shows a sign-in link: copy it (pressing c copies it to the clipboard when your terminal allows), open it in your computer’s browser and sign in. If the browser shows a code, paste it into the terminal at Paste code here if prompted. The login is stored in ~/.claude/.credentials.json, readable only by your user.
Using a Console API key instead? Set ANTHROPIC_API_KEY in your shell profile, never in the project’s files.
4. Give it project context
Inside Claude Code, run /init. It writes a CLAUDE.md file describing the project: how to run tests, where the code lives, which rules to follow. Add server facts yourself, for example: “This is the live site. Ask before running migrations. Logs are in storage/logs.”
5. Work in small, reviewable tasks
Good first tasks: “Read storage/logs/laravel.log and explain the latest 500 error”, or “Add validation to the contact form and run the tests”. Claude Code asks before it edits files or runs commands, and /permissions shows and changes what’s allowed. Don’t use options that skip permission prompts on a live site.
Way 2: drive it from your computer
Here you work in an app on your computer while Claude Code runs against the server over SSH. First add the server to ~/.ssh/config (step 4 of the SSH guide) and confirm that ssh myhosting works in a terminal.
- Claude desktop app: create a new environment, choose the SSH tab and select Add SSH connection…. Enter
myhosting(oruser@host), the port and your key, then pick the project folder on the server and click Create environment. The app installs its helper and Claude Code under~/.claude/remote/on the server by itself; Anthropic’s documentation suggests leaving about 1 GB of disk space for it. - VS Code: install the Remote - SSH extension, run Remote-SSH: Connect to Host…, choose
myhostingand open your folder. Then install the Claude Code extension on the remote side (VS Code offers Install in SSH: myhosting), or runclaudein VS Code’s terminal after completing Way 1.
Way 1 is quickest for a fix from any terminal; Way 2 suits daily work with a visual diff and file view.
Safety checklist
- Never paste secrets into prompts. Keep passwords and API keys in
.envor environment variables, and tell Claude where a setting lives, not its value. You can block reads of.envwith a deny rule such as"Read(./.env)"in the project’s.claude/settings.json. - Keep
.envout of Git: check that.gitignorelists it before every commit. - Commit before each task and read
git diffbefore you accept anything. Roll back withgit restoreorgit revert. - Prefer a staging copy: work on a subdomain or a second folder, then deploy to the live site once it passes.
- Back up the database before migrations, with phpMyAdmin’s export or
mysqldump. - Watch for instructions hidden in files or web pages the agent reads (prompt injection).
Troubleshooting
claude: command not found:~/.local/binisn’t onPATH. Add it as in step 1 and open a new connection.EACCESduringnpm install -g: npm is trying to write to a system folder. Use--prefix ~/.local(npm EACCES).EBADENGINEwarning: the npm package expects Node.js 22 or later. Switch to Node.js 24.- The sign-in link opens but the terminal never continues: copy the code the browser shows and paste it at the prompt, and check you copied the whole link.
- The session ended when Wi-Fi dropped: reconnect,
cdto the same folder and runclaude --continue. Resource temporarily unavailableor killed processes: the agent, test runners and builds reached your account’s process or memory limit. Close other sessions and run fewer jobs at once.- The desktop app can’t connect: test
ssh myhostingfirst, then check free space for~/.claude/remote/(disk quota exceeded).
On ArabyHost
Claude Code runs over SSH on the AI/Developer plans, inside CloudLinux CageFS, so the agent reaches only your own account. On these plans Node.js 24 and Python 3.12 are already on your PATH and npm install -g installs inside your account, while the Connect Claude Code page in the Araby Panel shows your host, user and port with SSH settings ready to copy. There’s no root access or Docker, so the agent can’t install system packages. To let Claude manage the hosting itself (databases, deploys, logs), use Araby MCP. Claude Code is an Anthropic product used with your own Anthropic account; ArabyHost has no partnership with Anthropic.
FAQ
Do I need a paid plan to use Claude Code?
According to Anthropic's documentation, Claude Code needs a paid Claude plan that includes it or a Claude Console account billed by API usage; the free claude.ai plan doesn't include it. Check Anthropic's pages for the current plans.
Does my code leave the server when I use Claude Code?
Yes. The files and command output Claude Code reads are sent to Anthropic's models to produce answers. Treat it like any cloud service: keep secrets out of what it reads and follow your company's data rules.
What happens to my session when the SSH connection drops?
A CLI session started over SSH ends when the connection closes, but the conversation is saved. Reconnect, go to the same folder and run `claude --continue` to pick up where you left off.