Skip to Content
GuidesAI agentsRun on a server without SSH

Run an AI agent on a server without SSH

You can let a local Claude Code or Codex session work on a server without using SSH as the working surface. Join the server to Cmdop, keep its agent online, and register Cmdop’s fleet MCP server on the machine where the assistant runs. The assistant then reaches the server by name through the relay, with no inbound port required on the server.

Use this guide when the server should be operated by an AI assistant, but you do not want the assistant to depend on an SSH daemon, a forwarded port, or a terminal session you keep open.

What you need

  • A server you can access once to install Cmdop.
  • A laptop or workstation where Claude Code or Codex runs.
  • A fleet join key for the relay both machines will use.
  • Outbound HTTPS from the server to the relay.

The server does not need a public IP address. If your primary problem is NAT or CGNAT reachability, start with Let an AI agent reach a machine behind NAT.

1. Join the server

On the server:

curl -fsSL https://install.cmdop.com | sh cmdop join <join-key> cmdop agent start

cmdop join stores the fleet credential, and cmdop agent start brings the server online. The server agent dials out to the relay; you do not open an SSH port for Cmdop.

For a long-running server, install the agent as a service after the first join:

cmdop service install

2. Confirm the server is online

From the machine where you work, list the fleet:

cmdop connect --list

The server should appear as online. Then ask the server’s own agent for a small, read-only fact:

cmdop fleet <server>

The goal is to prove the server answers through Cmdop before you involve an assistant. If the server is missing, troubleshoot machine presence first: Machines explains why a picker may hide offline machines.

3. Register the assistant

On the machine where Claude Code or Codex runs:

cmdop mcp install --agent claude # or cmdop mcp install --agent codex

Restart the assistant after registration. Then check what Cmdop exposed:

cmdop mcp status cmdop mcp tools

For the full assistant setup, see Give an assistant fleet access.

4. Ask for bounded server work

Inside Claude Code or Codex, start with a read-only task:

List my Cmdop machines, then ask <server> for disk usage and service status. Do not modify files or restart anything.

Then move to a bounded change only after the assistant has named the exact target and the check it will run:

On <server>, inspect the failed systemd unit and propose the smallest fix. Ask before editing files or restarting services.

This keeps the assistant’s local shell separate from the remote server. The assistant uses its own local tools for the machine it runs on, and Cmdop fleet tools for the joined server.

What this changes from SSH

SSH gives you a shell on a reachable host. Cmdop gives the assistant a machine-level tool interface to a joined server. That difference matters:

QuestionSSHCmdop fleet tools
Does the server need an inbound SSH port?Usually yes, unless you add a tunnel, jump host, or VPN.No; the server agent dials out to the relay.
Does work depend on your terminal staying open?Often, unless you use a multiplexer or background job.No; the work is addressed to the joined machine.
Can the assistant list several servers first?Only if you build that inventory separately.Yes; list_machines is the normal first tool.
Is SSH still useful?Yes, especially for direct shell repair.Yes; Cmdop does not replace every terminal workflow.

Use SSH when a direct shell is the shortest safe path. Use Cmdop when the AI assistant should discover, ask, and operate joined machines without turning each server into a network endpoint.

Common questions

Can Claude Code run commands on a server without SSH?

Yes, if the server has joined Cmdop and its agent is online. Claude Code uses Cmdop’s fleet MCP tools to list machines, ask a machine’s own agent to do work, and run bounded commands on a named server.

Does this expose my server to the internet?

No inbound port is required for the Cmdop path. The server agent keeps an outbound connection to the relay, and the assistant reaches the server through that fleet relationship.

Should I remove SSH from the server?

Not because of this guide. SSH remains a useful emergency and administration surface. The point is that the AI workflow does not have to depend on SSH being publicly reachable or on a terminal session staying open.

Last updated on