claude-code-notifier
how it works guides faq
◐English
English العربية Deutsch Español Français עברית Italiano 日本語 한국어 Nederlands Polski Português (Brasil) Русский Türkçe Tiếng Việt 简体中文 繁體中文
Get started
All guides

Claude Code over SSH: run it on a remote server

Updated 27 November 2026 · 5 min read
on this page 011. Install on the server 022. Log in without a browser on the server 033. Keep it running when SSH disconnects 044. Fix the keyboard 055. Pasting and images 066. Other ways to reach a remote machine 077. Know when it needs you 08FAQ

Claude Code runs fine on a remote machine over SSH. Connect with ssh, install it on the server with curl -fsSL https://claude.ai/install.sh | bash, and run claude. There is no browser on the server, so when it asks you to log in, press c to copy the login URL, open it in a browser on your own computer, and paste the code it gives you back into the terminal. Start Claude Code inside tmux so it keeps running when your SSH connection drops.

011. Install on the server

Connect and install with Anthropic's script:

ssh you@your-server
curl -fsSL https://claude.ai/install.sh | bash
claude --version

You can also install with npm (npm install -g @anthropic-ai/claude-code@latest, Node.js 22 or later, without sudo), or from Anthropic's apt, dnf and apk repositories. Instructions for each are in Anthropic's setup guide.

022. Log in without a browser on the server

Run claude. It tries to open a browser and, on a server, cannot. Then:

  1. Press c to copy the login URL, or select and copy it from the terminal.
  2. Open it in a browser on your laptop and sign in.
  3. If the browser shows a code, paste it at the Paste code here if prompted line.
  4. You see Login successful.

Other options, from Anthropic's authentication documentation:

  • An API key: set ANTHROPIC_API_KEY on the server and Claude Code asks you once to approve it.
  • A long-lived token: run claude setup-token on a machine with a browser, then set CLAUDE_CODE_OAUTH_TOKEN on the server. It needs a Pro, Max, Ultra, Team or Enterprise plan, and the token does not work for Remote Control.

On a Mac reached over SSH, a locked Keychain is common. Claude Code then stores the login in ~/.claude/.credentials.json, readable only by you.

033. Keep it running when SSH disconnects

If the SSH connection drops, everything started in it stops, including Claude Code in the middle of a task. Start a tmux session first:

tmux new -s claude
claude

Detach with Ctrl+B then D, close your laptop, and later reattach with tmux attach -t claude. screen works the same way. Anthropic's Remote Control documentation gives the same advice.

044. Fix the keyboard

  • Shift+Enter for a new line works in Ghostty, Kitty, iTerm2, WezTerm, Warp and recent Windows Terminal. In VS Code, Cursor, Zed and older Alacritty, run /terminal-setup once. Run it on your own computer's terminal, not inside tmux. Ctrl+J, or \ then Enter, always works.
  • Inside tmux, add these to ~/.tmux.conf on the server, then detach and reattach:
set -g allow-passthrough on
set -g focus-events on
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
  • Option shortcuts on a Mac need "Use Option as Meta Key" in Apple Terminal, or Option set to "Esc+" in iTerm2.

055. Pasting and images

Long pastes collapse to a placeholder such as [Pasted text #1 +120 lines]; Claude still gets all of it. For very large input, copy a file to the server with scp and point Claude at it. Pasting an image from your laptop's clipboard into a terminal on a server generally does not work, because the server cannot see your clipboard. Copy the image to the server and give Claude its path.

066. Other ways to reach a remote machine

  • VS Code Remote-SSH: open a window connected to the server and use Claude Code in its terminal or the Claude Code extension there.
  • Remote Control: start claude --remote-control on the server and drive the session from the Claude app on your phone or from claude.ai/code. It needs a claude.ai login. See Claude Code Remote Control.
  • Dev containers: Anthropic publishes a dev container feature for Claude Code; keep ~/.claude on a volume so you stay logged in.

077. Know when it needs you

A notification hook on the server fires on the server, where there is no desktop, so notify-send shows nothing. To hear about it on your laptop, use a terminal that shows notifications sent over SSH, or send a push from the server. Claude Code Notifier does the second: an independent tool (not made by Anthropic) with a free command line tool, ccn, that you install on the server, and apps for iPhone and Android. It only makes outbound connections, so no ports need opening, and it keeps working after your laptop disconnects. See Claude Code notifications over SSH.

08FAQ

Can I use Claude Code over SSH?

Yes. Install it on the remote machine, run claude in your SSH session, and log in by opening the URL it gives you in a browser on your own computer.

How do I log in to Claude Code on a headless server?

Run claude, press c to copy the login URL, open it on another device, sign in, and paste the code back. Or set ANTHROPIC_API_KEY, or a token from claude setup-token as CLAUDE_CODE_OAUTH_TOKEN.

Does Claude Code keep running if SSH disconnects?

Not unless you start it inside tmux or screen. Then it keeps working and you can reattach later.

Why doesn't Shift+Enter work in Claude Code over SSH?

Your terminal or tmux is not passing the key through. Run /terminal-setup on your local terminal, add the tmux settings above, or use Ctrl+J for a new line.

Claude Code Notifier Get a push on your phone when Claude Code finishes or needs you, then approve, deny or answer from there. The ccn command line tool is free on Mac, Windows and Linux.
Download for iOS Download for Android Install ccn

Use OpenAI's Codex CLI? Notifier for Codex does the same for Codex.

Use Antigravity? Try Antigravity Notifier

Related guides

  • Notifications from Claude Code on a remote server over SSHRun Claude Code on a VPS or remote server over SSH and still get notified: terminal escape sequences that travel over SSH, or a phone push with ccn.
  • Claude Code in tmux or screen: getting notified from a detached sessionGet notified when Claude Code in tmux or screen finishes or needs you: allow-passthrough, bell alerts, naming the session, and phone pushes when detached.
  • Claude Code Remote Control: how it works and how to set it upHow to start Claude Code Remote Control, connect from the Claude app or a browser, turn on push notifications, and what happens when your computer sleeps.
  • Leave Claude Code running and walk away: a workflowA practical routine for long Claude Code tasks: keep the computer awake, cut needless prompts, get pinged on your phone and reply from there.
claude-code-notifier

Claude Code Notifier is an independent third-party application. It is not affiliated with, endorsed by, or sponsored by Anthropic, PBC. "Claude" and "Claude Code" are trademarks of Anthropic, PBC.

apps iOS App Android App ccn for macOS, Windows & Linux All guides Use Codex? Try Notifier for Codex Use Antigravity? Try Antigravity Notifier
legal Privacy Policy Terms of Service Other languages © 2026 touchtap. All rights reserved. TouchTap Ltd is registered in England and Wales, company number 13942589.