Run a Rex server on a remote Linux VM
An always-on remote host for Rex, with agents ready and no API keys.
Shelley handles the setup. About 10 minutes.
Prefer a terminal?
curl -fsSL https://exe.dev/deploy/rex/prompt.txt | ssh exe.dev new --prompt=/dev/stdinRex is a terminal and terminal multiplexer from Superlogical, Mitchell Hashimoto's new company. Your sessions live in a Rex server, not in the window: Rex for Mac runs one locally and can attach to others as remote hosts. Put a server on an exe.dev VM and the shells and coding agents in it keep working when your Mac sleeps or travels. The VM is always on, its disk is persistent, and you reattach from Rex for Mac where you left off.
The VM comes with Claude Code and Codex, which use exe.dev's LLM integration: no API keys on the VM, and model usage billed to your exe.dev account.
Warning
Rex is in beta. You need a Rex for Mac tester build (from Superlogical's mailing list) to use this server from a Mac, and the Linux server is labeled alpha. Rex has no logins of its own yet: the server trusts Tailscale to say who is connecting, which is why this guide uses Tailscale and never the HTTPS proxy.
What you get#
- Rex's Linux server from the preview channel, running as
exedevand back after a reboot - The server on your tailnet as
my-rexonce you open its Tailscale sign-in link - Claude Code and Codex using exe.dev's LLM integration, with Rex's agent skill installed
- A Rex session
workin~/projectwhere Claude Code answersOK
What's running, and where
https://my-rex.<your-tailnet>.ts.net
the Rex server, for Rex for Mac; only your Tailscale account gets in
ssh my-rex.exe.xyz
your terminal, and an SSH tunnel to Rex if you don't use Tailscale
Deploy with Shelley#
Click Deploy and Shelley will set up Rex on a new VM, then check that it works. No config-file wrangling required.
Prefer a terminal?
curl -fsSL \
https://exe.dev/deploy/rex/prompt.txt \
| ssh exe.dev new --prompt=/dev/stdinWhat Shelley is told
Set up Rex on this VM by following the exe.dev recipe at https://exe.dev/deploy/rex.md from top to bottom.
The recipe's example VM name is my-rex. This VM's name is the output of `hostname`: use it wherever the recipe writes my-rex. Skip the step that creates the VM; you are on it.
You are done when all of these are true. Check each one yourself:
- Rex's Linux server from the preview channel, running as `exedev` and back after a reboot
- The server on your tailnet as `my-rex` once you open its Tailscale sign-in link
- Claude Code and Codex using exe.dev's LLM integration, with Rex's agent skill installed
- A Rex session `work` in `~/project` where Claude Code answers `OK`
Run the VM-side commands in "Set up the VM" only; skip creating the VM.
If `exeuntu configure` reports an existing user config, leave it alone.
If `~/project` already exists, leave it alone. Don't start interactive
agents. Verify with the checks at the end of that section: the service
is active, `rex version` starts with `rex 0.1.0`, and the `work` session
shows `OK` from Claude Code. Skip the later sections and the FAQ.
Finish by giving the owner the Tailscale sign-in link from
`rex server status` (the `authenticate:` line), and tell them to open it
signed in to the tailnet their Mac is on, check that MagicDNS and HTTPS
certificates are on for that tailnet, then add
`https://<this VM's name>.<tailnet>.ts.net` in Rex for Mac with
**Add Remote Host…** ("Add it to Rex for Mac"). Never put Rex behind
exe.dev's HTTPS proxy or use `--allow-anonymous`.
Finish with the URLs I should open.
Also at /deploy/rex/prompt.txt. The recipe it follows is /deploy/rex.md.
Set up the VM#
On your computer, create a VM and connect to it. Pick any free name; if you've already clicked Deploy or have a VM, skip the first command and use its name:
ssh exe.dev new --name=my-rex
ssh my-rex.exe.xyz
On the VM, connect Claude Code and Codex to the LLM integration, then
install Rex with Superlogical's install script. It adds Rex's apt
repository, so updates come with apt. There's no stable release yet, so
ask for the preview channel, the tagged builds:
exeuntu configure claude
exeuntu configure codex
curl -fsSL https://pkgs.superlogical.com/rex/install.sh | sh -s -- --channel preview
rex version
The package brings services for a shared server and a login server; leave
them off. Instead, run a personal server as exedev, the account with your
files and agents, and let it join your tailnet as my-rex with the
Tailscale built into Rex. The second file stops Ubuntu's needrestart
from restarting it during package upgrades, which would stop every program
running in Rex:
sudo tee /etc/systemd/system/rex-personal.service >/dev/null <<EOF
[Unit]
Description=Rex server for $USER, on the tailnet as $(hostname)
Wants=network-online.target
After=network-online.target user@$(id -u).service
[Service]
Type=notify
NotifyAccess=main
User=$USER
Environment=XDG_RUNTIME_DIR=/run/user/$(id -u)
Environment=GODEBUG=
ExecStart=/usr/bin/rex server run --log-format text --tailscale --tailscale-hostname $(hostname)
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
EOF
echo '$nrconf{override_rc}{qr(^rex-personal\.service$)} = 0;' | sudo tee /etc/needrestart/conf.d/rex-personal.conf
sudo systemctl daemon-reload
sudo systemctl enable --now rex-personal.service
Install Rex's skill and hooks for the agents, so they can open tabs, split panes and read other terminals, and make a project, a Git repository so you can review and undo what the agents change. Then open a session there:
rex skill setup
git init ~/project
rex new work -c ~/project
Check it. The service is active, the server is the preview build, and
Claude Code, typed into the work session, answers OK on its screen:
systemctl is-active rex-personal
rex server status | grep -E '^(version|tailscale)'
rex send -s work 'claude -p --model haiku "Reply with exactly: OK"'
rex send-key -s work Enter
sleep 20; rex capture -s work | tail -3
tailscale: needs login is expected until the next step.
Sign in to Tailscale#
Rex for Mac reaches the server over your tailnet. You need a Tailscale account, with the Tailscale app on your Mac, and two settings on in the admin console: MagicDNS and HTTPS Certificates.
On the VM, print the server's sign-in link:
rex server status
Open the authenticate: link in a browser where you're signed in to
Tailscale, and approve the device. It joins your tailnet as my-rex,
owned by you, and from then on the server signs itself in after restarts.
Run rex server status again: the tailscale: line no longer says
needs login.
Only devices signed in as you get in; the server asks Tailscale who each caller is. To let other people in, see Rex's Who Can Connect. The server's sign-in counts as a device on your tailnet, and Tailscale expires device keys after 180 days unless you turn off key expiry for my-rex.
Add it to Rex for Mac#
In Rex for Mac, choose Add Remote Host… and enter the server's address, with your tailnet's name:
https://my-rex.<your-tailnet>.ts.net
The work session from setup is there. Open it, or start a new one, and
run an agent in ~/project:
cd ~/project && claude
The first run asks for a theme and whether you trust the folder. Then give it a task, such as:
Write index.html: a one-page site for a very opinionated cat. Keep it short.
Close the laptop; the agent carries on, and the session is as you left it
when you reattach. Codex works the same way (codex); the first time,
approve Rex's hook with /hooks so Codex knows it runs in Rex.
The rex command works from a terminal on your Mac too, and inside Rex
terminals there:
rex hosts add my-rex https://my-rex.<your-tailnet>.ts.net
rex -S my-rex ls
Let agents drive Rex#
rex skill setup taught Claude Code and Codex the rex commands. Ask an
agent running in Rex to "start the dev server in another tab and tell me
when it's ready" or "run the tests beside you and fix whatever fails", and
you watch it happen in the window. Rex lists more in its
agent docs.
Run rex skill setup again after installing another agent.
Shelley, exe.dev's own agent at https://my-rex.shelley.exe.xyz/, picks
up the same skill: ask it to open a session in Rex and run something, and
it shows up in Rex for Mac.
To preview what an agent builds, have it serve on 0.0.0.0:8000 and open
https://my-rex.exe.xyz/, private until you share it.
No Tailscale? Use an SSH tunnel#
The server's own socket on the VM is /run/user/1000/rex/server.sock, and
Rex trusts whoever connects there as exedev. SSH can carry that socket to
your computer, protected by your exe.dev SSH key. On your Mac, keep this
running:
ssh -N -L /tmp/rex-my-rex.sock:/run/user/1000/rex/server.sock my-rex.exe.xyz
Then, in another terminal:
rex -S unix:///tmp/rex-my-rex.sock ls
We tested this with the rex command. We couldn't test whether Rex for
Mac's Add Remote Host… takes a socket address; Rex's docs only
describe Tailscale for the app. The tunnel ends when SSH does, and the
socket file stays behind: delete /tmp/rex-my-rex.sock before you open it
again.
What keeps running#
- Mac asleep, Rex closed, Wi-Fi gone: everything on the VM keeps running.
- The VM restarts: the server comes back on its own with the same sessions, tabs and panes, each a fresh shell in the same folder. Programs that were running in them have stopped.
- Rex updates:
aptinstalls the new version but leaves the running server alone. It switches when you restart it (see Update).
Back up and restore#
Commit and push your code; that's the copy that matters most. For a copy of the whole VM, run this on your computer (choose a free backup name):
ssh exe.dev cp my-rex my-rex-backup
The copy has the original's Tailscale identity too, so don't keep both
running. To use the copy beside the original, give it its own on the copy,
then open the new link from rex server status:
sudo systemctl stop rex-personal
rm -rf ~/.local/state/rex/tsnet
sudo sed -i "s/--tailscale-hostname .*/--tailscale-hostname $(hostname)/" /etc/systemd/system/rex-personal.service
sudo systemctl daemon-reload && sudo systemctl start rex-personal
Update#
On the VM:
sudo apt-get update && sudo apt-get install --only-upgrade rex
rex version | head -1
rex server status | grep '^version'
If the two versions differ, the server is still on the old one. When nothing important is running in Rex, restart it; sessions come back as in a reboot:
sudo systemctl restart rex-personal
Rex for Mac and the server don't need the same version; if they drift too
far apart, the connection error says which one to update. Update the agents
with sudo exeuntu update claude and sudo exeuntu update codex.
Troubleshooting#
- Rex for Mac can't reach the server. On the VM,
rex server statusshould show Tailscale signed in. Check that your Mac's Tailscale app is connected to the same tailnet, that MagicDNS and HTTPS certificates are on, and that the device is namedmy-rexin the admin console (Tailscale adds a number if the name was taken). - Rex for Mac is refused. Only Tailscale devices signed in as the
server's owner get in.
rex client lson the VM shows who is connected. rexsays(R)?ex. Ubuntu has an unrelated Perl tool called rex; run the install script again, and seeapt-cache policy rex.- The server won't start.
journalctl -u rex-personal -eshows why.rex server statusprints the path of the server's own log. - An agent doesn't answer. On the VM,
claude -p "Reply with exactly: OK"shows whether Claude Code works on its own; rerunexeuntu configure claudeif not, thenrex skill setup.
For everything else, see Rex's Linux server docs and Remote Access.
Frequently asked questions#
Can I use Rex yet?
Rex is in public testing. Rex for Mac goes to people on Superlogical's mailing list, in waves; the Linux server is labeled alpha, and its packages install without an account. Clients for iOS, Linux and Windows aren't part of testing yet. Expect commands and options to change between builds.
Can I reach Rex through exe.dev's HTTPS proxy instead of Tailscale?
No. Rex has no logins of its own yet, so on a plain HTTP listener it needs --allow-anonymous, and then every connection can run programs as you. Rex for Mac can't sign in to exe.dev's proxy, and a share link or share set-public would hand out a shell. Use Tailscale, or the SSH tunnel, which uses your exe.dev SSH key.
Why a personal server, not the shared or login server?
The personal server runs as exedev, the account that has your files, Git setup and agent configs, and only you use it. The shared server runs everything as a separate rex account and loses its sessions on every upgrade. For several people, each as their own Linux account, Rex's login server with Tailscale Serve is the way.
Can I use my own Claude or ChatGPT subscription?
Yes. On the VM, run claude auth login or codex login after removing what exeuntu configure added: apiKeyHelper and env.ANTHROPIC_BASE_URL in ~/.claude/settings.json, and the exe-llm provider in ~/.codex/config.toml. Keep the hooks entries Rex added.
How much does it cost?
Superlogical says Rex is and will stay free, with no account needed for the client or server. You pay for the VM as part of your exe.dev plan, and model usage through the LLM integration is billed to your exe.dev account. A free Tailscale plan is enough.
Does Rex send data anywhere?
Rex collects no telemetry. The server talks to Superlogical's package repository when apt updates, and to Tailscale's coordination servers because you turned Tailscale on. Programs you run in Rex make their own connections.
Updated Oct 31, 2026 · Markdown · manifest.json · Something wrong? Tell us