# 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.

Source: https://shuriken.sh/guides/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.

By Shuriken Updated 27 October 2026 6 min read

**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](https://code.claude.com/docs/en/setup) 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](https://shuriken.sh/guides/claude-code-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](https://shuriken.sh/guides/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 -s running.
- Windows: set sleep to Never in the power settings.

## Install Claude Code #

On Linux, macOS or WSL, the native installer:

bash
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](https://code.claude.com/docs/en/authentication) give two ways around that:

- Run claude auth login over 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 as CLAUDE_CODE_OAUTH_TOKEN in 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](https://github.com/anthropics/claude-code/issues/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](https://shuriken.sh/guides/claude-code-keeps-asking-to-log-in).

## Keep sessions alive with tmux #

A session started in a plain SSH window dies when the window does. Start it inside tmux (or screen):

bash
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."

Shuriken adds a server of yours with one command, and its chats sit beside your computer's.

[Download](https://shuriken.sh/download)

## 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-control on the server makes it reachable from the Claude app and claude.ai/code, and in server mode --spawn worktree gives each session its own git worktree. The docs add two caveats. The claude process has to keep running, and in server mode a network outage of roughly 10 minutes makes it exit, so run it inside tmux or 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](https://shuriken.sh/guides/run-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 tmux window 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 sh on 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](https://shuriken.sh/features/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-worker under systemd or OpenRC on Linux, app.shuriken.worker under 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](https://shuriken.sh/blog/run-chat-on-another-computer) 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](https://shuriken.sh/server) has the short version. If there's a machine under your desk doing nothing, [download Shuriken](https://shuriken.sh/download) and give it a job.

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-on-an-always-on-machine&text=Run%20Claude%20Code%20on%20an%20always-on%20machine)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-on-an-always-on-machine)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-on-an-always-on-machine&t=Run%20Claude%20Code%20on%20an%20always-on%20machine)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-on-an-always-on-machine&title=Run%20Claude%20Code%20on%20an%20always-on%20machine)[E-mail](mailto:?subject=Run%20Claude%20Code%20on%20an%20always-on%20machine&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-on-an-always-on-machine)

## Sources

- [Advanced setup: system requirements and installation (Claude Code docs)](https://code.claude.com/docs/en/setup) (accessed 22 October 2026)
- [Authentication: long-lived tokens (Claude Code docs)](https://code.claude.com/docs/en/authentication) (accessed 22 October 2026)
- [Troubleshoot installation and login (Claude Code docs)](https://code.claude.com/docs/en/troubleshoot-install) (accessed 22 October 2026)
- [Continue local sessions from any device with Remote Control (Claude Code docs)](https://code.claude.com/docs/en/remote-control) (accessed 22 October 2026)
- [Issue #22992: Support device-code authentication flow for Pro/Max users in headless environments](https://github.com/anthropics/claude-code/issues/22992) (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.

Servers

Your agents on your own servers.

Add a Linux, macOS or Windows server from the app with one command. It runs as a service and updates itself.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [How to install Shuriken on Mac, Windows and Linux: Guide 27 Oct 2026 3 min read Install Shuriken from shuriken.sh on Mac, Windows or Linux. The Mac app is notarised by Apple; Windows may warn once, as its installer isn't signed yet.](https://shuriken.sh/guides/install-shuriken)
- [Claude Code in a dev container: setup, firewall and auth: Guide 27 Oct 2026 5 min read Claude Code in a devcontainer is one feature line. A named volume and one env variable keep your sign-in through rebuilds; skipping prompts stays unsafe.](https://shuriken.sh/guides/claude-code-devcontainer)
- [Claude Code in GitHub Codespaces: setup and sign-in: Guide 27 Oct 2026 7 min read Claude Code runs in GitHub Codespaces through Anthropic's dev container feature, and a personal Codespaces secret keeps each new codespace signed in.](https://shuriken.sh/guides/claude-code-github-codespaces)
- [Run Claude Code on a remote server over SSH: Guide 27 Oct 2026 6 min read Run Claude Code over SSH the right way: sign in on a headless box, keep sessions alive with tmux, handle Git keys safely, and see what SSH alone can't do.](https://shuriken.sh/guides/claude-code-over-ssh)
- [Claude Code teleport: pull cloud sessions to your terminal: Guide 27 Oct 2026 6 min read claude --teleport pulls a Claude Code cloud session and its branch into your terminal. It needs a clean tree, the same repo and the same claude.ai account.](https://shuriken.sh/guides/claude-code-teleport-cloud-sessions)
- [Claude Code with VS Code Remote-SSH, WSL and containers: Guide 27 Oct 2026 8 min read In a VS Code Remote-SSH, WSL or dev container window, the Claude Code extension runs remotely: sign-in, ~/.claude, MCP servers and the CLI live there.](https://shuriken.sh/guides/claude-code-vscode-remote-ssh)
- [Install Claude Code on Linux: Ubuntu, Fedora, Alpine: Guide 27 Oct 2026 8 min read To install Claude Code on Linux, run curl -fsSL https://claude.ai/install.sh | bash, or add Anthropic's signed apt, dnf or apk repository.](https://shuriken.sh/guides/install-claude-code-on-linux)
- [Claude Code headless mode (-p): scripts, CI and cost caps: Guide 27 Oct 2026 5 min read Claude Code headless mode is claude -p: one prompt in, one answer out, no terminal UI. The flags that cap spend and tools, output formats, and CI.](https://shuriken.sh/guides/claude-code-headless-mode)
- [Codex remote control: run Codex from your phone: Guide 27 Oct 2026 7 min read Codex remote control runs through the ChatGPT mobile app and a paired Mac or Windows PC. Linux works only as an SSH host; the CLI command is experimental.](https://shuriken.sh/guides/codex-remote-control-from-phone)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
