Skip to main content
A host is a machine you own that runs your sandboxes as Firecracker microVMs. Add as many as you like; each sandbox goes to the connected host running the fewest, among those with room.

What a host needs

  • x86_64 Linux with KVM. Ubuntu 24.04 is what ephemera is tested on. Check with ls /dev/kvm. A bare-metal server, a spare PC, or a cloud VM with nested virtualization all work.
  • About 2 GB of disk for the guest image, plus what sandboxes write. Each sandbox’s disk is sparse: it takes only what’s written.
  • Memory sets how many sandboxes fit. An idle sandbox costs about 60 MB, so a 16 GB machine holds well over a hundred idle ones. A busy one uses what its workload uses, up to its limit, 1 GB by default.
  • A way to reach it. The host connects out to the central server by itself and needs no open port for that. But the machine you run ephemera on sends files and reads output straight from the host, on port 7701. Any of these works:
    • the same LAN as your laptop,
    • a VPN you already use, with tcp:7701 allowed to the host,
    • the machine’s public address, with a firewall that lets in only your own address,
    • no network at all: SSH into the machine and run ephemera there. See Use it over SSH.
    • or make your laptop the host: see Run it on one machine.

Join it to your account

1

Make a join code

In the dashboard, under Hosts, choose Make a join code. It looks like ej_ and 26 letters and digits, works once, and lasts 15 minutes.On a central server you run, make one with sudo ephemera-server join-code create instead.
2

Install the host agent

On the machine, with the code at the end:
It checks KVM, installs Firecracker and the host agent from the latest release, checking each download against its checksum, and builds the guest image (a few minutes; it downloads Ubuntu’s packages). Then it joins your account with the code and runs the agent as the ephemera-host systemd service. It sets up no network of its own.Your laptop reaches the host at the machine’s private address. With exactly one, the installer uses it; with several, such as a LAN address and a VPN address, it lists them and asks you to pick one with --address:
A public address works too, such as a rented server’s, but then the host’s port, 7701, is open to the internet. The host serves TLS with its own key and checks each sandbox’s token, but it’s safer to let only your own address through the firewall. Or pass --address 127.0.0.1 and use ephemera on the machine itself, over SSH.
3

Check it

The installer prints the host’s key fingerprint when it joins, then waits until the host is connected:
The dashboard shows the host online, with the same fingerprint. From your laptop:
For a host that’s offline, LAST SEEN says when it last checked in, such as 4 days ago.
Delete the code file afterwards. It can’t be used again anyway.

Use it over SSH

If you work on the machine over SSH anyway, run ephemera there too, and skip the network: with --address 127.0.0.1, the host listens only on the machine itself, and nothing is open to anyone else.
ephemera login prints a code and a page to open. Open it on any device, such as your laptop, and approve. Then run ephemera from a checkout on the machine. Changes you make on your laptop need to reach that checkout first, with git or rsync. ephemera dev forwards the sandbox’s ports to the machine’s own localhost. To open one in your laptop’s browser, forward it over SSH as well:
A host on another address works over SSH the same way; 127.0.0.1 just keeps everything else out.

Already have ephemera-host

To join a machine that has the binary:
It makes the host’s key in /var/lib/ephemera/host.key if there isn’t one, joins, and saves what it joined as in /var/lib/ephemera/host.json. From then on the host signs in with that key; there’s no shared secret. --name sets its name in your account; the default is the machine’s hostname.

Keys and pinning

Every host has an Ed25519 key. It signs the host in, makes the host’s TLS certificate, and signs its records. The first time your CLI uses a host, it checks the key against the central server’s record and pins it. If the key changes later, the CLI refuses the host until you accept it:
Do that only when you know why it changed, such as a rebuilt machine.

Settings

Pass host agent flags through the installer, for example:
These host agent flags are the ones you’re most likely to want: The host reference lists every flag.

Upgrade a host

Run the installer again, without a code:
It keeps the host’s key, name, server and address, installs the latest release, and rebuilds the guest image when the guest agent changed. It restarts the host agent only if something changed, and a restart destroys the sandboxes running on it, so upgrade when none are in use.

Remove a host

In the dashboard, under Hosts, choose Remove. Its sandboxes are destroyed, and it can’t sign in again until it joins with a new code. With a token instead: DELETE /v1/hosts/<id>, see the API reference. To take ephemera off the machine itself:
Without --purge, it keeps the host’s key and guest image in /var/lib/ephemera.