Skip to main content
A snapshot captures a configured rig’s filesystem as a reusable base image. New rigs that boot from it start with your dependencies, tools, and environment already in place, with no waiting on a fresh install each time.
You can create snapshots from the CLI, the web UI, the TypeScript SDK, or the HTTP API, for rigs on Amika Cloud and for rigs on your own hosts.
For a walkthrough of the whole flow, watch the demo:
The flow is:
  1. Create a base rig with the setup script skipped.
  2. Configure it the way you want the base to look.
  3. Take a snapshot.
  4. Launch new rigs from the snapshot, and optionally set it as the repository default.

Step 1: Create a base rig, skipping setup

When you build a base rig for a snapshot, skip the repository’s setup script. The setup script runs automatically every time a rig is created. If it runs while you build the snapshot and again when someone boots from that snapshot, it executes twice. Skip it now, and let it run once at boot time later.
1

Open the create form

Open Create a rig at app.amika.dev and select your repository.
2

Check Skip setup script

On the Setup script row, check Skip setup script. Click Show script first if you want to see what you’re skipping. Then create the rig.
From the CLI, pass --no-setup to provision the rig with a no-op setup script:

Step 2: Configure the environment

Connect to the rig and set it up the way you want the base image to look: install dependencies, build caches, configure tools.
See SSH and connect for the connection options.

Step 3: Take the snapshot

The source rig must be running. Choose a capture mode:
Snapshot everything captures the filesystem as-is, so any secrets present in the rig are baked into the image. Prefer Snapshot and delete for shared base images.
Not every rig offers both modes. Rigs on your own hosts, for example, only support Snapshot and delete. Capture the snapshot from any of these surfaces:
amika snapshot create is interactive by default: it prompts for the capture mode and name, and for scrub_and_delete it previews the injected secrets that will be removed and asks you to confirm.
Capture runs in the background. Check progress with amika snapshot list.
The snapshot moves through capturing, then finalizing, then active. Once it’s active it’s ready to launch from.

Step 4: Launch from a snapshot

When you create a new rig, pick your snapshot from Start from snapshot in the Rig Snapshot section. On the Rigs page’s create panel, that section is under Advanced. The new rig boots from the captured image instead of the preset. From the CLI, pass --snapshot:

Set a repository default

Make every new rig for a repository boot from a snapshot by default, either from the web UI or in your .amika/config.toml.
Commit the default to your repository configuration so every collaborator shares it. Add a [sandbox] section to .amika/config.toml:
A default set in the web UI (stored in the database) takes precedence over the [sandbox] value in .amika/config.toml. See the [sandbox] reference for the full resolution order.

Snapshots on your own hosts

Rigs on your own hosts can be snapshotted too, with a few differences:
  • The snapshot stays on the host. It is stored on that host’s disk and can only boot new rigs on the same host. Pick it when you create a rig there, or pass --snapshot along with --host.
  • Only Snapshot and delete. The host stops the rig to capture its disks, so Snapshot everything isn’t offered.
  • No defaults. Repository and organization default snapshots never apply to a rig on your own host. The create form offers each host only its own snapshots.
amika snapshot list --long shows a HOST column for snapshots taken on your hosts. See Snapshots on your host for where the host keeps them.

Next steps

Rig lifecycle

Create a rig

SSH and connect

Manage secrets