Skip to main content

images ls


images get

Shows what the image panel in the web dashboard shows, in this order:
  1. Details: name, description, status, distribution, SSH user and type; then size, minimum disk and regions; then, for an image that follows a GitHub branch, its Git Repo, Git Branch and Dir; then monthly price, total cost and creation date.
  2. The latest failed build or disk image import, when there is one: a block headed v<N> build failed: with the end of the build log, or the import’s error.
  3. Versions: every version with its status, type, regions and creation date.
  4. Machines: your machines that depend on the image, with name, status and creation date. The temporary m0-build-* builder of an image build is not listed. It says None of your machines use this image. when there are none, Showing N of M machines. when the list is cut short, and Machines: unavailable if the list could not be loaded.
A NixOS image that follows a branch also has a Nix Flake row after Type: the flake reference it follows, for example github:acme/infra/main#web01, printed in full so you can copy it. It is the same form images new --flake accepts. When the last push to that branch did not start a build, a Last Rebuild row after Git Branch says why and what to do: for example Last push was not built: balance too low. Add credit, then push again, or A push is waiting: draft v4 holds the build slot. Promote or remove it. The row goes away when a build starts or a newer version exists. Only the image’s owner sees it. If you have an image with the same name as a system image, images get shows yours, with its own versions and SSH user. machine0 images versions ls, get, promote and rm and machine0 new --image <name> pick your image first too. The price and cost rows describe what the image costs its owner, so they show on your own images, including a system image you own, and not on other system images. machine0 images versions get follows the same rule for a version’s price and cost rows.

images new

Create an image by snapshotting a VM, building from a nix flake, or importing a disk image. Aliases: images save, images create. Snapshot mode — snapshot a VM into a reusable image (the VM is stopped automatically before snapshotting):

Building from a nix flake

With --flake, images new builds a NixOS image server-side from a nix flake — same reference syntax as nixos-rebuild switch --flake. The build is always asynchronous: the command returns immediately and you watch progress with machine0 images versions get <image> <version>.
The #attr fragment is required — it names the nixosConfigurations attribute to build (nixos-rebuild defaults to the hostname; there is no hostname here). Supported references (v1): github:owner/repo (with optional /ref path segment or ?ref= branch, ?rev= 40-hex commit pin, ?dir= subdirectory) and local folder paths (absolute, relative, ~/, or path:). Other schemes (git+https, gitlab:, …) aren’t supported yet. A ?rev= pin needs its branch named alongside it (?rev=<sha>&ref=<branch>) — ?rev= alone is rejected, because GitHub-built images track their branch. GitHub builds track their branch: pushes to it automatically build a new version and promote it on success, as long as the machine0 GitHub App is installed on the repo (the CLI warns when it isn’t; rebuild admission enforces it). The tracked source shows as the Nix Flake, Git Repo and Git Branch rows in machine0 images get; turn it off with machine0 images update <image> --no-track. See branch tracking for the full semantics (what turns tracking off, promotion rules, blocked pushes). Private GitHub repos work once you’ve connected GitHub to your account (dashboard → Account → GitHub) and the GitHub App installation includes the repo — no new flags, the same github:owner/repo#attr reference just resolves. Without a connection, only public repos resolve (the error message tells you where to connect). The builder fetches private sources with your connection’s credentials, and those credentials are removed before the image is snapshotted. Publicly reachable repos always build without your credentials — so a public flake whose lock file pins private inputs won’t resolve them; the build fails with the nix fetch error (fully visible, see below). Make the top-level repo private, or vendor the inputs, to build with credentials. --builder-region also accepts the old region names (us-east, us-west, uk, eu, asia) for backwards compatibility — each maps to its datacenter (e.g. eu → ams3) with a notice printed to stderr. When the build starts, the command prints the base image the builder boots from, the builder’s size, and the minimum disk the built image will need. How it works: a temporary builder VM named m0-build-* boots from the NixOS base image, applies nixos-rebuild switch --flake pinned to your source, is snapshotted, and destroyed. The builder is visible in machine0 ls and bills like a normal machine for the duration of the build (typically 10–40 minutes). The builder belongs to the build pipeline: stop, start, reboot, suspend, rename, and images new snapshots of it are rejected — only machine0 rm works, which cancels the build. If your balance hits the suspension threshold mid-build, the builder is destroyed without a suspend snapshot and the build fails; top up and re-run the same command. A brand-new image name is published on success; building onto an existing image creates a draft version to test and promote, same as a snapshot save. Local folders: inside a git repository the WHOLE repo is the flake source (exactly like nix) and only git-tracked files are uploaded — commit or git add your flake first. Plain folders are packed whole, minus .git (the CLI warns, since untracked files like .env travel too). The packed source is uploaded over your authenticated session (no public URL), capped at 32MB gzipped, and deleted server-side once the build finishes. Submodule contents are not packed. The builder garbage-collects its nix store before snapshotting so your uploaded sources are not baked into the published image — with one nix-inherent exception: a flake whose system closure references its own source (self, ${./.}) keeps that source alive in /nix/store, and it ships inside the image. This applies to private GitHub sources too: a self-referencing private flake ships its own source inside the image it builds. If the build runs out of disk on the builder, the error says so and names --builder-size. If the build fails, the error (including the tail of the nixos-rebuild log) is recorded on the image version and kept for 7 days — machine0 images versions get <image> <version> prints the full log tail (for nix errors, the actual cause is at the END of the log, after the warnings), the dashboard’s image panel shows it, and the events feed carries an excerpt. GitHub tokens that appear in the log or in the builder’s error output are replaced with [redacted] before the error is stored, so they never show in any of those places. Re-running the same command retries (re-resolving branches / re-uploading local sources), and any new build or snapshot onto the image supersedes the failed draft — a disk image import does too, but only once the image is ready (a brand-new image whose first build failed isn’t, so retry, push, or snapshot it instead). Limitations (v1): GitHub.com repositories only (private ones via the account GitHub connection); no git submodules or LFS; the profile must import the machine0-nixos base modules (keep the nix user and SSH enabled), or the build fails verification. A ?rev= pin is taken as given — the server verifies the repo exists but not that the commit belongs to it (exactly like nix), so recorded rev provenance on pinned builds is user-asserted and a bad rev fails on the builder with a nix fetch error.

Importing a disk image

With --disk-image-url, images new imports an existing disk image from a URL instead of snapshotting a VM. The image is private to your account, like a snapshot.
The import is asynchronous: the command returns immediately, the image shows as creating, and machine0 images get <image> shows when it is ready. Importing onto a name you already use creates a draft version to test and promote, same as a snapshot save (--description and --distribution only apply to a brand-new image). The URL:
  • must use http, https, or ftp and end in .qcow2, .img, .raw, .vmdk, .vdi, or .vhdx, optionally compressed as .gz or .bz2;
  • must be reachable from the public internet — the cloud provider downloads it directly, so local files and private-network hosts don’t work;
  • must not embed credentials (a URL with a user:pass@ prefix before the host is rejected). A presigned URL works, but it is stored with the import job, so use one that expires soon.
The image has to boot as a cloud VM: use a cloud image with cloud-init and an SSH server, so your SSH key can be installed on first boot. You can run two imports at a time; a third is rejected until one finishes. Imports also share a platform-wide limit: when it is full, the command asks you to try again in a few minutes. An import that hasn’t completed after 60 minutes fails, and a file the cloud provider rejects fails straight away with its reason. If an import fails, the error is recorded and nothing is billed. For a brand-new image, the image shows as errored — read the error with machine0 images versions get <image> 1, remove the image with machine0 images rm <image>, and run the import again. For a new version, the failed draft keeps its error for 7 days (machine0 images versions get <image> <version>) and the next import or snapshot onto the image replaces it. An imported image is billed as image storage once it is ready, based on its size.

images update

--region also accepts old region names (us-east, us-west, uk, eu, asia) alongside datacenter slugs in the comma-separated list — each maps to its datacenter (e.g. eu → ams3) with a notice printed to stderr.

images rm

Deleting the auto-saved snapshot of a suspended machine (named suspended-<machine>-<date>-<time>) also destroys that machine — the snapshot is its only copy of its disk. Check machine0 ls for suspended machines before removing suspended-* images.

System images you own

System images are visible to every account. Most are platform images, but if you own one (machine0 images get <image> shows Owner: you, and machine0 images ls --all shows SYSTEM (yours)), you can update it, change it back to a user image and destroy it, whatever your role. Adding, promoting or removing versions of a system image still needs an image admin. Change it back to a private user image:
Other accounts can no longer see the image or create machines from it, and their pending orders on it won’t be filled. Machines they already created keep running. Making an image a system image again needs an image admin. Destroy it:
This removes the image for every account and can’t be undone. Machines already created from it keep running; new machines and pending creates that use it fail. Without --system, the CLI asks an extra question at a terminal and refuses in scripts (--yes alone never destroys a system image). Platform images that every account depends on (such as ubuntu-24-04) can’t be destroyed, renamed or changed back to a user image.