Run Claude Code on an always-on machine
Run Claude Code on a home server, mini PC or VM that never sleeps: install, headless sign-in, tmux, remote access, or add it as a Shuriken server.
Contents
To run Claude Code on a home server that's always on, install it on a machine that never sleeps (a home server, a mini PC, a Mac mini, a cloud VM), start each session inside tmux so it survives disconnects, and reach it over SSH or Anthropic's Remote Control. Or add that machine to a harness as a server, so chats run there and you follow them from any device.
A laptop is a poor server: it sleeps when the lid closes, and it goes wherever you go. Shuriken has had servers from early on for that reason, and since 1.4 its server installer sets up every agent CLI for you. The do-it-yourself route comes first, then how Shuriken does it.
Pick the machine#
Anthropic's system requirements for Claude Code, read on 22 October 2026, are macOS 13+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+, on 4 GB+ RAM with an x64 or ARM64 processor, plus an internet connection.
That's the floor for the CLI. Your agents also install dependencies, run builds and start test suites, so size the machine for your project. A 64-bit Raspberry Pi with 4 GB or more meets the listed hardware. Raspberry Pi OS is Debian-based, though Anthropic lists Debian and Ubuntu by version and doesn't name it; which Pi models clear the bar is in Claude Code on a Raspberry Pi. A mini PC or an old desktop with 16 GB is a more comfortable home for several agents at once. Sizing and hardening a rented one is in Claude Code on a VPS.
Then stop it sleeping:
- Linux: a server install usually doesn't sleep. On a desktop install, turn suspend off in the power settings, or run
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target. - macOS: turn automatic sleep off in System Settings, or keep
caffeinate -srunning. - Windows: set sleep to Never in the power settings.
Install Claude Code#
On Linux, macOS or WSL, the native installer:
curl -fsSL https://claude.ai/install.sh | bash
On Windows, in PowerShell: irm https://claude.ai/install.ps1 | iex.
Native installs update themselves in the background and apply the new version the next time Claude Code starts. Anthropic also publishes signed apt, dnf and Alpine package repositories with two channels: stable, about a week behind and skipping releases with major regressions, and latest. Those don't update on their own; your normal apt upgrade does it.
Run claude doctor afterwards. It checks the install and settings without starting a session.
Sign in without a screen#
The machine has no browser, and Anthropic's docs give two ways around that:
- Run
claude auth loginover SSH. It prints a link; open it on your own computer and approve, and the browser shows a code to paste back into the SSH session. It's the normal subscription login, finished on another device. - Run
claude setup-token. It goes through the same browser approval and prints a one-year token, which you set asCLAUDE_CODE_OAUTH_TOKENin scripts and CI. The catch, in the docs' words: it "can only make model requests, so it can't establish Remote Control sessions or fetch claude.ai connectors."
A proper device-code login for headless machines is what issue #22992 asks for, and it was still open on 22 October 2026.
On a Mac you reach over SSH, the Keychain is usually locked, so Claude Code saves the login to ~/.claude/.credentials.json instead. That works, and claude doctor explains how to move it back into the Keychain later. A box that keeps asking you to log in usually has one of the causes in Claude Code login prompts.
Keep sessions alive with tmux#
A session started in a plain SSH window dies when the window does. Start it inside tmux (or screen):
tmux new -s claude # start a named session, then run `claude` in it
# Ctrl-b d # detach; Claude keeps working
tmux attach -t claude # come back later, from anywhere
Anthropic's Remote Control docs say the same: on a remote machine, "start it inside tmux or screen to keep the session running after you disconnect from SSH."
Reach it from anywhere#
- SSH, from your laptop or a terminal app on your phone. To reach a home server from outside without opening ports, people usually put it on a private network such as Tailscale or WireGuard.
- Remote Control, on a Pro, Max, Team or Enterprise plan.
claude remote-controlon the server makes it reachable from the Claude app and claude.ai/code, and in server mode--spawn worktreegives each session its own git worktree. The docs add two caveats. Theclaudeprocess has to keep running, and in server mode a network outage of roughly 10 minutes makes it exit, so run it insidetmuxor under a service manager that restarts it.
Setting work up to run unattended, without stopping at every permission prompt, is the subject of running Claude Code overnight.
What the DIY route leaves to you#
Plenty of people run it this way and it works. What's still on you:
- updates for every agent CLI you use, not only Claude Code;
- a sign-in per account on the server, and again after each expiry;
- one
tmuxwindow per session, and remembering which is which; - a ping when a chat needs you, and moving on when an account runs out of room.
The Shuriken way: add it as a server#
In Shuriken, an always-on machine is a server: a Linux, macOS or Windows machine with no screen, added from the app. The app's own line for it is "No app: one command sets it up. Runs agents."
Adding one#
- In the app, open Settings › Devices › Add device and choose A server.
- Pick Linux, macOS or Windows. The app shows one command made for your account and valid for an hour:
curl -fsSL "https://shuriken.sh/install.sh?t=…" | sudo shon Linux and macOS, a PowerShell line run as administrator on Windows. - Run it on the machine. It asks for the machine's password once, for the system service. The server signs in on its own, named after the machine, and the app says "The server joined your account".
The installer prints its steps as it goes (Signing in, Creating the shuriken user, Downloading the worker, Installing the service, Setting up the agents and tools, Signing in to GitHub), and the server's card in the app says which step it's on. The tools are Git, the GitHub CLI, ripgrep, Claude Code, Codex and the other agent CLIs for the providers you have sources for, installed as the user the service runs as. The GitHub sign-in can be skipped with Enter. It reports success only when Git, the GitHub CLI, Claude Code and Codex all actually run.
What you don't do#
- Signing in to Claude on the server: your sources (the accounts and keys you add) and your Global MCPs reach it end-to-end encrypted from the app, so source switching works there too.
- Watching the process: it runs as a service that starts with the machine and restarts on its own, as
shuriken-workerunder systemd or OpenRC on Linux,app.shuriken.workerunder launchd on macOS, a Windows service on Windows. Nobody needs to be signed in on it. - Updating it: the worker updates itself when a release is out, only to a release our key signed, and waits until no agent is mid-turn.
Using it#
Pick the server when you start a chat, from your computer, your phone's web app or any browser. A chat that's already running can move too: run it somewhere else and the same chat carries on, now on the server, which gets the repo from its remote if it has no copy yet. When it's done, finish it with your checks and a merge or a pull request.
Good to know#
- Servers run on Linux (x64 and Arm, glibc and Alpine), macOS and Windows.
- On Free, a server is one of your two linked devices. Pro has no device limit.
- Without a server, Shuriken's background service keeps agents running on a desktop or laptop with the window closed, and Cocaine mode (yes, that's its name) keeps a Mac running with the lid closed. Windows and Linux get the same in 5.1, where the hardware allows. A box that never leaves the desk still beats a laptop in a backpack.
The server page has the short version. If there's a machine under your desk doing nothing, download Shuriken and give it a job.
Sources
- Advanced setup: system requirements and installation (Claude Code docs) (accessed 22 October 2026)
- Authentication: long-lived tokens (Claude Code docs) (accessed 22 October 2026)
- Troubleshoot installation and login (Claude Code docs) (accessed 22 October 2026)
- Continue local sessions from any device with Remote Control (Claude Code docs) (accessed 22 October 2026)
- Issue #22992: Support device-code authentication flow for Pro/Max users in headless environments (accessed 22 October 2026)
Frequently asked questions
Can I run Claude Code on a Raspberry Pi or home server?
Anthropic lists 4 GB of RAM or more and an x64 or ARM64 processor, on Ubuntu 20.04+, Debian 10+, Alpine 3.19+, macOS 13+ or Windows 10 1809+. A 64-bit board or mini PC that meets that runs it; your builds and tests decide how much more you need.
How do I sign in to Claude Code on a headless machine?
Run claude auth login over SSH, open the printed link on your own computer, and paste the code it shows back into the terminal. For scripts, claude setup-token makes a one-year token, but it only makes model requests and can't start Remote Control.
How does Claude Code update on a server?
The native installer updates in the background and applies the new version the next time Claude Code starts. Installs from Anthropic's Linux package repositories (apt, dnf, Alpine) update with your normal system upgrades. A Shuriken server updates itself only to signed releases, waiting until no agent is mid-turn.
Does a Shuriken server count as a device on the Free plan?
Yes. Free includes two linked devices and a server is one of them. Browsers don't count, and Pro has no device limit.