Skip to content

Linux hosts, from the desktop app

Run Claude Code and Codex on a Linux server, from your Mac.

A long agent run and a laptop lid are a bad match. Add a Linux server to lpm by typing user@build-server — it installs and pairs itself over SSH, and that server’s projects, terminals, services, and agents appear in your sidebar next to the local ones. Then close the lid. They keep going.

See exactly what keeps running

One field

Type what you'd type after ssh. lpm installs itself on the server and pairs over that same connection.

Nothing new exposed

The server keeps listening only to itself. lpm reaches it through an SSH tunnel it brings up and keeps alive.

A box you own

A small VPS or the desktop under your desk. It keeps your dependencies, your caches, and your half-finished branch.

Linux hosts you connect to

Add a Linux hostType what you’d type after ssh — lpm installs and pairs itself there.
 Connect

What lpm does with that one line

  • Reached build-server over SSH
  • Installed lpm on the server
  • Paired with a one-time invite
  • Forwarded its port over SSH

In lpm on your Mac, + above your projects → Server. One field, and lpm does the install, the pairing, and the tunnel.

The short answer

How do you keep Claude Code running after you close your laptop?

Move the run off the laptop. Put Claude Code or Codex on a Linux server and drive it from your Mac: in lpm, click + → Server → Install lpm there, type user@host, and the server’s projects join your sidebar while the work stays on the server, lid open or not.

What you getssh + tmuxlpm
Keeps the agent running
Starts the project’s services and shows their ports
Shows the diff the agent just wrote
A badge on your Mac when it needs an answer
The long answer, with the tmux commands

Claude Code and Codex are command-line tools, so they run perfectly well on a Linux box that never sleeps — the hard part has never been starting them there, it’s everything around it.

The way most people do it
ssh user@build-server
tmux new -s agent
claude
# detach, reconnect tomorrow, hope it's all still there

That keeps the process alive and gives you back a shell. It doesn’t give you the project’s services, the ports they came up on, the diff the agent just wrote, or a badge on your Mac the moment it needs an answer.

lpm takes the same idea and manages the plumbing. Click + → Server → Install lpm there and type user@host — lpm installs itself on that server over SSH, pairs the two machines without you copying a secret anywhere, and forwards the connection so nothing new is exposed. From then on the server’s projects sit in your Mac sidebar and open in the same window as the local ones — while the work itself stays on the server, lid open or not.

This is a different thing from reaching a remote box from a Mac terminal: here the whole of lpm is running on the Linux machine, and your Mac is the window onto it. When one folder is all you need, the Server screen’s other choice, Just SSH in, opens it as an SSH project without installing lpm on the server.

No Linux box? Claude Code and Codex can run on a Mac mini you already own, paired with your laptop under + → Another computer instead of over SSH.

Why move it off the Mac

A laptop is the wrong computer for a long agent run

None of these are new problems. They just got sharper once the thing running in the terminal started taking an hour and doing real work.

The lid closes and the run ends

A refactor across forty files takes the better part of an hour. Meetings, commutes, and school runs are shorter than that. The one machine you cannot leave running is the one you carry.

The network changes and the session goes with it

Office Wi-Fi to tethering to home. Every hop drops the connection, and anything attached to it goes down unless you remembered to start a multiplexer first.

Three agents is a lot to ask of a laptop

Three agent sessions, three dev servers, a browser and your editor. The machine grinding through all of it is the same one you are trying to type on.

A shell is not a workspace

SSH in and you have a prompt. Not which services are up, not which port the API landed on, not what changed on disk, not which of the three agents is waiting on an answer.

What happens when you press Connect

One field, five things you would otherwise do by hand

  1. 1

    You type user@build-server

    The same string you would type after ssh, with an optional :port. lpm uses your existing SSH setup: your keys, your ~/.ssh/config. If you can reach the machine with a key as root, or as a user with passwordless sudo, so can lpm.

  2. 2

    lpm installs itself on the server

    Over that SSH connection it fetches the published Linux bundle and runs its installer: the app, the lpm command-line tool, and, where systemd runs, a service that comes back up on boot. On a small server this takes a few minutes, most of it the download and the system packages.

  3. 3

    The two machines pair themselves

    lpm asks the server for a single-use invite and consumes it over its own forward. The secret never leaves the SSH channel, never lands on a clipboard, and the server keeps only a hash of the token it issued.

  4. 4

    The connection comes up, and stays up

    The server’s port stays bound to the server itself. lpm forwards it to your Mac and supervises that forward — if it drops, lpm brings it back within seconds, and it tells you when the tunnel is the thing that’s down rather than blaming the server.

  5. 5

    Its projects show up in your sidebar

    Under the server’s own name, beside your local projects, and one server holds as many as you like: clone a repository onto it or pick a folder that is already there. Open one and it is the same project view: the same terminal tabs, the same service controls, the same review pane. The only things that stay behind are the ones that need an app installed on your Mac.

Already have lpm on the server? lpm sees it and just pairs with it.

Watch it

Two ways to put your projects on a server

A lesson from the lpm series: set up a Linux host that holds many projects and keeps Claude Code and Codex running, or just SSH in to open one folder without installing lpm there.

  1. 1

    Choose how lpm works with the server

    Click + above your projects and choose Server. Install lpm there sets it up as a Linux host for many projects; Just SSH in opens one folder without installing lpm there.

  2. 2

    Set up the Linux host

    Type what you'd type after ssh, like root@your-server, and click Connect. lpm installs itself there if it isn't yet, pairs over SSH, and goes straight on to adding a project.

  3. 3

    Add projects, then start agents

    Clone a repository or pick a folder on the server, as many as you like, and click Claude or Codex in the header. They keep working while your Mac sleeps.

All 30 lpm lessons
Once it is connected

A remote project that behaves like a local one

Everything routes through the same window. The only visible difference is which machine the work is happening on.

Terminals and agents, live

Start Claude Code or Codex in a terminal on the server and watch it stream on your Mac, keystroke for keystroke. When it finishes or stops to ask you something, your Mac chimes and the tab lights up.

Its services, its logs

Start and stop the project’s services on the server from the same buttons you use locally, or restart one with lpm service <name> restart, and read what they printed. Open one’s port and it comes up on your Mac’s localhost, through the connection lpm already has. They run there, so they are still up tomorrow morning.

Review before you believe it

Changed files and full diffs for a server project open in the same review pane as a local one. You read what the agent did without SSHing in to look.

Fan out on the server's cores

Duplicate a server project into copies and queue the same prompt in each. The copying and the running happen on the server — your laptop stays quiet.

Files and new projects

Drag a screenshot or a file onto a server terminal and lpm uploads it there and pastes the path. Right-click the server in the sidebar to add a project on it, from a folder or a Git clone.

Your phone, straight to the server

Pair the lpm iPhone app with the server itself and check on an agent, or answer it, while your Mac is off.

Add as many servers as you like: each gets its own sidebar section, status, and version line, with an Update button when it falls behind your Mac. Config sync keeps lpm settings, and the config of projects that exist on both machines, in step, on demand or automatically.

The honest version

What keeps running, and what doesn't

The whole point of moving work to a server is that it outlives your laptop. That is true — with edges worth knowing before you rely on it.

Survives

  • Closing the lid, quitting lpm, losing Wi-Fi

    Only the connection goes away. The agents and the services on the server carry on exactly as they were.

  • Restarting your Mac

    Reopen lpm and it asks the server which sessions are still alive, then adopts them instead of starting new ones. You get the terminal back with its recent output replayed, still attached to the same running agent.

  • Switching to another project

    Moving around your own sidebar never stops a terminal on the server. You leave, it keeps working.

  • Rebooting the server

    On a systemd server lpm runs as a service, so it comes back with the machine. Your projects are there; the agents that were running stop, and their Claude Code and Codex tabs resume the conversations when you reopen the project. In a container, start it again with lpm-host start.

  • Your Mac being off, for your phone

    Pair the lpm iPhone app with the server itself and it connects straight there, so you can check on an agent or answer it while your Mac is asleep.

Doesn’t

  • Updating lpm on the server

    Update and Reinstall restart lpm there, and that ends every agent running on it. lpm says so in the confirmation before it does it. The project's services are not tied to lpm and keep running, and Claude Code and Codex tabs resume their conversations when you reopen the project.

  • Older scrollback

    When you reattach, the server replays the recent tail of each terminal, not its entire history. What scrolled past long ago is gone.

  • Local-only things, on a server project

    Opening the project in your editor, and anything else that needs an app installed on your Mac, stays Mac-side. Files are the exception: drag one onto a server terminal and lpm uploads it there.

What it opens up

Nothing, is the answer

A server you rent has no business exposing a control port to the world, so adding one opens nothing.

The server doesn't listen to the network

The port lpm listens on there is bound to the machine itself, reachable from nowhere else. lpm gets to it by forwarding that port over SSH, the access you already had, so adding a host opens nothing new to the internet and needs no firewall change.

The pairing secret rides the SSH channel

lpm asks the server for a single-use invite over SSH and consumes it over its own forward. Nothing is emailed, pasted, or left on a clipboard, and the server stores only a hash of the token it issued.

The identity is pinned

Pairing records the server's certificate fingerprint. Every later connection is checked against it: if the identity ever changes, lpm says so and refuses rather than quietly connecting to something else.

Nothing you have to undo

No account, no relay in the middle, no service of ours holding your keys. Disconnect a host and it drops out of your sidebar, and whatever is running on it keeps running. To take lpm off the server entirely, choose Remove lpm from this host in its ⋯ menu, under + above your projects → Server.

The one port you can choose to open is for your phone. Pairing the lpm iPhone app with the server turns on phone access there, which listens on the server’s network interfaces. The connection is encrypted and only paired devices get in, but on a public server, reach it over a tailnet or limit the port with a firewall.

Before you add one

What the server needs

Short list, and most of it is what any cloud image already gives you.

The server
Ubuntu 22.04 or newer, or a Debian release with the same glibc, on x86_64 (amd64), with curl or wget to download the bundle. The installer uses apt and checks the glibc version before it changes anything. ARM servers are not supported yet.
The login
Key-based SSH as root, or as a user with passwordless sudo, like the default ubuntu@ or debian@ login on most cloud images. lpm itself runs as root on the server. No password prompt can be answered during setup, so your key or ssh-agent has to be enough on its own.
Boot and containers
With systemd, lpm installs as a service that starts at boot. In a container with no service manager, the installer sets up an lpm-host supervisor instead, which you start again after the container restarts.
The size
lpm runs its normal app on the server without a screen, so the installer pulls in a virtual display and the GTK and WebKit runtime behind it, and lpm wants a few hundred megabytes of memory. A 2 GB / 2 vCPU box is a comfortable floor before your own services.
The cost
Whatever a VPS that size costs from your provider; it is usually one of their smaller plans. A spare desktop or an old workstation on your own network does the same job for the price of the electricity.
Still yours to install
Your toolchain — git, Node, the agent CLIs, whatever your project builds with. lpm sets itself up, not your stack, and it does not guess at what you build with.
Signing in there
Open a terminal on the server from lpm and run Claude Code's or Codex's own sign-in there. If a login flow wants a browser on the machine itself, an API key in the server's environment is the simpler route — often the better one for a machine you share.

You never have to run the installer or move a pairing secret by hand — but if you would rather set the server up yourself, the same bundle the Mac installs is published with every release, and it installs the same way:

On the server, by hand
URL=https://github.com/gug007/lpm/releases/latest/download
curl -fsSL $URL/lpm-host-linux-amd64.tar.gz | tar xz
cd lpm-host
sudo ./install.sh
sudo -H lpm pair

That last command prints an invite to paste on your Mac, under + above your projects → Another computer; logged in as root, plain lpm pair does the same. It is the handshake the one-field flow performs for you.

The usual ways

How people do this today, and where each one stops

ssh + tmux

What it gets right
The process alive across a dropped connection — genuinely the core of the problem, and it has been solving it for as long as anyone has run long jobs over SSH.
Where it stops
You are still administering a shell. Nothing tracks which services are up or on which port, nothing shows you the diff, nothing tells you an agent went quiet waiting for an answer, and a second server means a second window and a second set of habits.

A remote editor session

What it gets right
Files and a terminal on the server, inside the editor you already use.
Where it stops
It is built around editing, not around running. Which of the project's services are up, which port each one landed on, and which agent session is waiting on an answer are all still yours to keep track of — and there is no view that puts two servers and your laptop side by side.

A rented agent sandbox

What it gets right
A clean machine on demand, with nothing to install and nothing to maintain.
Where it stops
It is metered, and rebuilt from a spec, so your caches, your dependencies and your half-finished branch are not there next time. Good for a one-shot task; expensive as a place to actually work.

lpm with a Linux host

The same survives-the-disconnect property, on a machine you own, with the room built around it: the project’s services and ports, its diffs, its agent status, and as many servers as you want — all in the window you already have open on your Mac. What lpm is not is a hosting product. It does not rent you a box, and it does not know or care where you got yours.

If the multiplexer comparison is the one you care about, there is a longer one against tmux.

FAQ

Running agents on a server, answered

  • Can Claude Code run on a remote server?

    Yes. Claude Code is a command-line tool, so it runs on any Linux box you can get a shell on — you sign in on that machine and start it in a terminal there. What a plain SSH session does not give you is the rest of the environment: the project's services, the ports they came up on, the diff of what changed, or any signal on your laptop that the agent is waiting for you. Adding the server to lpm as a Linux host gives you the agent and that context in one window on your Mac.

  • How do I keep Claude Code running when I close my MacBook?

    Move the run off the MacBook. Anything started on your laptop stops when the laptop sleeps, so the durable answer is to run the agent on a machine that stays awake and treat your Mac as the screen for it. In lpm you add a Linux server under + above your projects → Server, start the agent in a terminal on that server, and close the lid — the connection drops, the agent does not. Reopen lpm and it reattaches to the same running session instead of starting a new one. The machine that stays awake can also be a Mac mini you already own, paired with your MacBook instead of reached over SSH, with Claude Code and Codex running there. Run Claude Code and Codex on a Mac mini

  • Do I need tmux to keep an agent alive over SSH?

    No. A terminal you start on a Linux host is owned by lpm on that server, not by your SSH connection, so it survives your Mac disconnecting, sleeping, or quitting — you do not have to remember a multiplexer before every long run. A project's services work the same way: lpm keeps them in its own persistent sessions on the server, so there is no multiplexer to install and nothing to attach to by hand.

  • What happens to the agent when my Wi-Fi drops or I change networks?

    Nothing happens to the agent. The connection between your Mac and the server drops and lpm reconnects on its own within seconds, bringing its SSH tunnel back up first. When it reconnects it replays the recent output of each terminal, so you see what the agent did while you were away. lpm also distinguishes a dead tunnel from a dead server, so you are not sent to look at the wrong machine.

  • Which Linux servers are supported?

    Ubuntu 22.04 or newer, or a Debian release with the same glibc, on x86_64 (amd64). The installer checks the glibc version before it changes anything and uses apt to pull in what the app needs. The bundle is built for amd64 only, so ARM servers such as Graviton, Ampere, or a Raspberry Pi are not supported yet. On a distribution without apt, install the runtime libraries yourself, run the installer with --no-deps on the server, then add the host from your Mac with the install box unticked. Containers without systemd work too: the installer sets up an lpm-host supervisor instead of a service.

  • Do I have to install anything on the server myself?

    lpm installs itself, including the system packages it needs and, on a systemd server, a service that starts it on boot. Your own toolchain is still yours: git, Node, and the agent CLIs you want to run there are not installed for you, because lpm does not guess at your stack. Install them once on the server and every project on it can use them.

  • How do I sign into Claude Code or Codex on a server with no browser?

    Open a terminal on the server from lpm and run the CLI's own sign-in there, the same way you would on any new machine. If a login flow wants a browser callback on the machine itself, put an API key in the server's environment instead — often the better choice for a box you share, and the one that survives the machine being rebuilt.

  • Does my Mac have to stay online for the server to keep working?

    No. Once a terminal is started on the Linux host, the work belongs to that machine. Your Mac being asleep, offline, or shut down only means nobody is watching. When you come back, lpm reconnects and adopts the sessions that are still alive.

  • Can I connect more than one Linux server?

    Yes. Add as many as you like — each gets its own section in the sidebar with its own projects, its own connection status, and its own version line, and you can switch between them and your local projects in the same window.

  • Does adding a Linux host expose anything to the internet?

    No. The server keeps listening only to itself, and lpm reaches it by forwarding that port over the SSH connection you already had, so no new port is opened and no firewall rule changes. The pairing secret travels over that same SSH channel, and the server's certificate fingerprint is pinned at pairing: if the identity ever changes, lpm refuses to connect rather than falling back. The one exception is a phone: pairing the iPhone app with the server turns on phone access there, which listens on the server's network interfaces, so reach a public server over a tailnet or limit that port with a firewall.

  • Can I run several agents on one server at the same time?

    Yes. Open a terminal per agent, or duplicate the project into copies and queue the same prompt in each. Both the copying and the running happen on the server, so a fan-out that would have pinned your laptop's fans costs you nothing locally — the limit is the server's cores and how many diffs you are willing to read.

  • Can I check on a server agent from my iPhone?

    Yes. Pair the lpm iPhone app with the server itself: right-click the server in your Mac's sidebar and choose Pair a phone, or run lpm mobile pair on the server and scan the QR code it prints. The phone then connects straight to the server, so it works while your Mac is off, and the app switches between your Mac and the server from its title menu. The phone needs a route to the server, such as a Tailscale tailnet.

  • Can I send a screenshot or file to an agent on the server?

    Yes. Drag or paste a file onto a terminal of a server project and lpm uploads it to the server, up to 1 GB per file, and pastes its path on the server so the agent can read it.

  • How much does a VPS for running Claude Code cost?

    It depends on the provider. lpm plus a project's services is comfortable on a 2 GB / 2 vCPU box, which is usually one of a provider's smaller plans. A spare desktop, a home server, or an old workstation on your own network does the same job for the price of the electricity. lpm does not care where the machine came from, only that you can SSH into it as root or as a user with passwordless sudo.

  • Is there a Linux version of the lpm app?

    Yes, in beta: alongside macOS there is a desktop app for Windows 11 (x64) and for 64-bit x86 Linux as new as Ubuntu 22.04, as a .deb, .rpm or AppImage. This page is about the other way lpm runs on Linux, as a host: the same lpm runs on a server without a screen and is driven from the desktop app on your laptop, whether that is a Mac, a Windows PC or a Linux machine.

Your Mac is the cockpit. The server does the hours.

Download lpm, add your server with the user@your-server you would type after ssh, and let Claude Code and Codex work on a machine that never sleeps.