api.ephemera.run is one way to run ephemera. The other is to run ephemera-server yourself. It’s the same program, open source, and it keeps everything on machines you control: tokens, hosts and the run history too.
Two parts run server-side:
- The central server (
ephemera-server) places sandboxes on hosts and keeps track of them. It never sees your files, command output or secrets. - A host agent (
ephemera-host) runs sandboxes as Firecracker microVMs. The CLI talks to it directly to send files and stream output.
What you need
- An x86_64 machine running Ubuntu 24.04, with hardware virtualization (Intel VT-x or AMD-V) turned on. A bare-metal server, a spare PC, or a cloud VM with nested virtualization all work.
- A private network between your laptop and the machine. Your laptop talks to hosts over TLS, checked against each host’s own key, but the central server serves plain HTTP, so the installer refuses to serve on a public address. Use a LAN, or a VPN of your choice.
- About 2 GB of disk for the guest image, plus room for sandboxes. Each sandbox’s disk is sparse, so it takes only what the sandbox writes.
Install
On the machine, from a checkout of the repository:bootstrap.sh prepares the machine. It checks KVM, then installs Firecracker and Go, creates an ephemera user, and joins Tailscale with SSH. On a server with a public IP, run it again with --lock-public-ssh once Tailscale works, so the machine accepts connections only over Tailscale.
install.sh installs ephemera itself:
- Builds
ephemera,ephemera-serverandephemera-hostinto/usr/local/bin. - Builds the guest image into
/var/lib/ephemera/image. This takes a few minutes and needs network. - Writes
/etc/ephemera/ephemera.envwith the machine’s addresses. It serves on the machine’s Tailscale address, or another private one with--listen-ip. - Starts both parts as systemd services,
ephemera-serverandephemera-host, and waits until the host has connected. - Creates the first API token, named
admin, and prints it once.
Connect your laptop
Install the CLI and log in with the server address and the tokeninstall.sh printed:
ephemera doctor says which step is broken, and how to fix it.
Let your laptop reach port 7701
The host can be online in the dashboard while every run fails to connect: the host’s connection goes out to the central server, but your laptop connects in to the host, on tcp:7701, so whatever sits between them must let that through: the machine’s firewall, a cloud firewall, or a VPN’s access rules. Or skip the network and runephemera on the machine over SSH; see Use it over SSH.
bootstrap.sh joins the machine to Tailscale as tag:lab. If your tailnet has access rules that allow only SSH to that tag, a common setup, add a rule for 7701 to your tailnet policy:
{ "src": ["autogroup:member"], "dst": ["tag:lab"], "ip": ["tcp:7701"] }. The central server’s port, 7700, needs the same if your laptop logs in to it over the tailnet.
On a laptop with a small MTU, large packets can stall even when the access rules are right. WSL2, for one, can give eth0 an MTU of 1280, which leaves no room for a VPN’s own headers. Small requests get through and anything big hangs, which looks like the same “no answer”. ephemera doctor tells the two apart. For the MTU, lower the tunnel’s; on Tailscale, that’s:
Tokens and limits
Make one token per person, laptop, agent or CI system, so each can be limited and revoked on its own:--max-sandboxes caps how many run at once, and --max-minutes caps sandbox-minutes per UTC day. ephemera-server token limits <name> changes them later. The server picks up changes without a restart.
Every token belongs to an account, and a token only sees and destroys its own account’s sandboxes. Tokens made without --account share the account local, which suits one person or a small team who trust each other. To keep people apart, give each their own account:
Add another host
A new host joins the central server once, with a one-time code. On the server machine, make one; it works once, for 15 minutes:--account NAME to join the host to that account instead of local. On the new machine, run the host installer, pointed at your central server:
ephemera-host join prints the key’s fingerprint, so you can check it against the server’s logs or the dashboard.
To take a host out of an account, DELETE /v1/hosts/<id> with one of the account’s tokens. Its sandboxes are destroyed, and it can’t sign in again until it joins with a new code.
Settings
/etc/ephemera/ephemera.env holds the addresses and settings. To change them, run install.sh again with new options rather than editing the file:
Upgrades, logs, benchmarks and where everything lives: Self-hosting reference.