59API

← Volver a las guías

Claude Code with tmux on Remote Servers: 2026 Guide

Claude Code · EN · 2026-10-18

Running Claude Code on a remote Linux server is useful for long builds, production-like environments, and projects that should keep working after your laptop disconnects. The most reliable setup in 2026 combines SSH, tmux, a minimal server account, and an API endpoint you can control. This guide shows the practical workflow and includes 59API as a low-cost option for pay-as-you-go Claude access.

Prepare the Remote Server

Use a current Ubuntu or Debian server with Git, Node.js, and tmux installed. Connect with SSH, then install the required packages:

Create a dedicated non-root user for development. Store source code in that user’s home directory, restrict SSH keys with appropriate permissions, and enable key-based login. Avoid running Claude Code as root because an agent may execute shell commands, edit files, or install dependencies.

Start Claude Code Inside tmux

SSH sessions can end because of local sleep, network changes, or terminal timeouts. tmux keeps the shell and Claude Code process running on the server:

Use one tmux session per repository or task. This keeps logs, environment variables, and working directories isolated. List active sessions with tmux ls. If a session is attached elsewhere, use tmux attach -d -t claude-project to take it over.

Configure the API Endpoint

Claude Code must receive an API credential and the endpoint expected by your chosen provider. With 59API, the base URL is https://api.59api.com. Follow the current 59API documentation for the exact Claude Code environment variable names and model identifiers, then export them only inside the tmux session or a protected shell profile.

A typical operational pattern is to create a private environment file, restrict it with chmod 600 ~/.claude.env, and load it before starting Claude Code. Do not commit that file, print its contents in debug logs, or place the key in shell history. If the server is shared, use a secret manager or systemd credentials instead of a plain-text profile.

59API is particularly practical when you need predictable usage costs: it offers pay-as-you-go access to native Claude Opus, Sonnet, Haiku, and Fable models, along with GPT models, without requiring a large committed subscription. Its compatibility with Claude Code, Codex, and OpenAI SDKs also makes it easier to reuse an existing toolchain. Pricing and model availability can change, so confirm the current rates before moving a high-volume workload.

Make Remote Runs Safer

A Repeatable Daily Workflow

Pull the latest branch, enter the existing tmux session, describe one bounded task, and ask Claude Code to inspect relevant files before editing. After each meaningful change, run the project’s tests and review git diff. Commit only verified work, then leave the tmux session running if a long test or build is still active.

For an inexpensive remote Claude Code setup, you can create a 59API account and start with a small pay-as-you-go balance. The combination of tmux persistence, SSH discipline, and model-level cost control provides a durable workflow for unattended development in 2026.

Precios · Docs

¿Listo para empezar?

Conecta Claude y GPT en minutos a los precios más bajos, sin recortes. Regístrate para obtener tu clave API.

Registro gratis