amika-hostd daemon on a machine, it registers that machine with Amika as
a host, and each rig you create on that host runs there as a local VM.
By default (transport = "tunnel"), the daemon dials out to Amika’s gateway,
so the machine needs no open port and works behind a home router or firewall.
If you’d rather expose a port yourself, the daemon can
listen on one instead.
Requirements
- Linux x86_64 or arm64 with glibc 2.34+ and KVM, or macOS on Apple silicon.
e2fsprogs, which smolvm needs for disks under 20 GiB. The installer adds it if it is missing.- Outbound HTTPS from the machine to Amika.
- A user-scoped Amika API key, owned by you rather than your organization. Create one under Settings → API Keys at app.amika.dev, or with the CLI during setup. A listening host also accepts an organization key.
Set up a host
1
Install the daemon
On the machine you want to run rigs:See Installer options to pin a version, skip smolvm, or
preview the install with
--dry-run.If resize2fs is missing, the installer installs e2fsprogs. On macOS it
runs brew install e2fsprogs. On Linux it uses apt-get, dnf, or yum as
root or with sudo, and asks first. With --install-deps it installs without
asking, but only as root or when sudo needs no password. When it can’t
install, it prints a warning with the reason and the exact command to run, and
the install still succeeds.The installer creates a config file at
$XDG_CONFIG_HOME/amika-hostd/config.toml (~/.config/amika-hostd/config.toml
by default).2
Store your credentials
secret_store = "file" in the config file before
running setup.To set up a host without prompts, for a script or an AI agent, pipe the API key
into setup --non-interactive. amika auth api-key create writes a new key
straight to a file without printing it:--non-interactive asks nothing. It keeps any secret key the host already has,
and it stops without changing anything if the hostname is invalid or no key
arrives on stdin.amika auth api-key create needs amika CLI v0.24.0 or later. Run it while
signed in as yourself (amika auth login): an organization key can’t create a
user key. Otherwise, create the key in the web UI and save it to a file.3
Start the daemon
To listen on a port instead, set
This registers the host with Amika, connects the daemon to Amika’s gateway,
and starts smolvm alongside it. Amika assigns the host’s address, so there is
no URL to set up. Pass
transport = "listen" in the config first.--fg to stay in the foreground.Listen on a port instead
The daemon can instead listen on a port that you expose to the internet over HTTPS, with ngrok or Cloudflare Tunnel, for example. Set this in the config file, above its first[ line (the
installer’s config has it commented out):
127.0.0.1:3020 by default. To use another address or
port, set host and port in the config, or pass --host and --port to
up.
Expose the port, then start the daemon:
amika-hostd register-url https://<public-url>.
A host set up before the gateway was the default has no
transport line in
its config. Its next amika-hostd up moves it to the gateway and drops its
registered URL. Add transport = "listen" first to keep it listening.Create a rig on your host
- CLI
- Web UI
- TypeScript
- HTTP API
--size takes one of that host’s own sizes, not the cloud size names. Omit
--host and the rig runs on Amika Cloud. On a host with more than one
runtime, --runtime picks one (smol, lume or bare_metal).
Without it, the rig uses its preset’s runtime. To boot from a snapshot, add
--snapshot <name>. It must be a snapshot taken on that same host (see
Snapshots on your host).The first amika-hostd up downloads the preset images in the background, and a
rig created before that finishes can time out. The daemon logs the progress.Configure sizes and images
The config file you set up above sets the rig sizes this host offers and the preset image each rig boots. Everyamika-hostd up publishes the sizes
to Amika, so the file is the source of truth for them. Preset images stay
local: the host pins the version it boots. Edit the file and restart the daemon
either way.
:latest follows each release. To hold a version, pin a 12-character commit
SHA instead, such as amika-coder:855d403678d5.
amika-hostd 0.7.0 and later refuse to start with the old
[preset_images]
table. Run amika-hostd config upgrade to convert it. The installer runs it
for you when it upgrades the daemon.Runtimes
A runtime is the way a host runs rigs. A host can offer more than one.
Turn a runtime on or off with one command. It installs what the runtime
needs, updates the config file, and reloads the running daemon:
amika host list shows
each host’s runtimes.
lume: the host needs a macOS image to clone. Build it withmacos-image/build.sh. Then create rigs with--preset macos-coder.bare_metal: see Bare-metal rigs.
Snapshots on your host
You can snapshot a rig that runs on your host. The snapshot is a.smolmachine file that stays on that host’s disk, and it can
only boot new rigs on the same host.
- Snapshot and delete is the only mode. The daemon stops the rig to pack its disks, so Snapshot everything, which keeps the source rig running, isn’t offered.
- Repository and organization default snapshots don’t apply. A host rig boots its preset image unless you pick one of that host’s snapshots when you create it.
- Snapshots are large. Each one is several gigabytes. Point
snapshot_dirin the config (orAMIKA_HOSTD_SNAPSHOT_DIR) at a disk with room for them. By default they go under~/.local/state/amika-hostd/snapshots.
amika snapshot list --long shows a HOST column, so you can tell which
snapshots belong to which host.
Previews and service access
Each service on a host rig gets a preview link. Opening it asks you to sign in to Amika, and only members of your organization get through. The link carries no credential, so sharing it gives no one access. Where it points depends on the host’s transport:
On a listening host, all previews share one origin and one sign-in:
- A page in one preview can act on any other preview you’ve opened there, so don’t run untrusted code on that host.
- Open one preview at a time. Root-relative assets, such as a Vite or Next.js dev server’s, follow the preview you opened last.
curl, mint a short-lived service token with the
HTTP API. It works only for rigs on your own hosts, never for amikad.
url, the header to send the token in
(X-Amika-Authorization), the token, and expires_at. Tokens last an hour
by default and at most a day.
Manage hosts
Hosts register themselves, so there is no command to add one. A host that
still has rigs on it can’t be deleted: delete the rigs first. You can also
delete a host from Hosts in the sidebar.
To take a host offline, run
amika-hostd down on the machine. That stops the
daemon and the VMs it is running, keeping their disks. The next up brings the
daemon back, but not the rigs: start those with amika rig start. Deleting the
host record alone leaves the machine untouched, so it registers itself again on
the next amika-hostd up.
Rigs on a host that’s gone
Deleting a rig needs its host to answer. When the host is offline, the delete fails and the web UI offers Remove from Amika only. That deletes Amika’s record of the rig but leaves anything still running on the machine, which you then clean up yourself. The HTTP API does the same withDELETE /api/v0beta1/rigs/{id}?forget=true.
Uninstall the daemon
Run the installer with--uninstall on the host:
smolvm is removed only if you type
remove smolvm at its prompt.
Installer options
Pass flags after
sh -s --, for example
curl -fsSL .../install-amika-hostd.sh | sh -s -- --dry-run.
AMIKA_INSTALL_DIR sets where the launcher goes (default /usr/local/bin),
and AMIKA_HOSTD_HOME where the daemon’s files go.
Next steps
amika host reference
Every flag for the
amika host commands.Create a rig
The full rig creation flow, on cloud or your own host.
Bare-metal rigs
Make your host machine itself a rig, and reach it over SSH.