Documentation

How to install nspawn, pull images from the hub, run machines and apps, wire their network, build your own images and configure the tool.

nspawn manages systemd-nspawn machines the way docker manages containers: images come from an OCI registry (the hub), are stored as shared layers and are started, inspected and stopped through the D-Bus APIs of systemd-machined and systemd. This documentation describes nspawn 0.2.0.

If you are new, start with the overview and then get started. The command reference lists every command and option.


Overview

What nspawn is, what it is not, and how images, machines, the hub and systemd fit together.

Getting started

Requirements, installation from source, a first machine pulled from the hub and an app from Docker Hub.

Images and the hub

Image references, the hub and Docker Hub, search and credentials, what pull does, the storage backends, boot and app detection, more machines from one image, and where everything lives on disk.

Machines

Starting and stopping machines, entrypoints, environment and volumes, running commands inside, reading their output, and how boot and app images differ.

Networking

The nspawn0 bridge, published ports, DNS and machine names, how apps get their network, firewalls, and the veth and host alternatives.

Building images

Building an image with mkosi through nspawn build, and uploading it to the hub or another registry with push.

Configuration

The configuration file, environment variables and global flags, what wins when they disagree, and what is remembered per machine.

Command reference

Every command and option of nspawn 0.2.0.

FAQ

Short answers to the questions that come up most.

Contributing

Where the code lives, how to build and test it, and how to send changes.