Skip to content

Deploy to virtual machine

Prerequisites

  • RAM > 2GB
  • Two Computers: You need one computer that you're getting ready (we'll call this the Target Computer) and another one to set it up from (we'll call this the Setup Computer). Make sure both can talk to each other over the network using SSH.
  • Machine configuration: See our basic adding and configuring machine guide

Clan supports any cloud machine if it is reachable via SSH and supports kexec.

NixOS can cause strange issues when booting in certain cloud environments.

If on Linode: Make sure that the system uses "Direct Disk boot kernel" (found in the configuration panel)

The following command will generate a hardware report with nixos-facter and writes it back into your machine folder. This command will use kexec to boot the target into a minimal NixOS environment to gather the hardware information.

clan machines init-hardware-config [MACHINE] \
  --target-host myuser@<IP>

Warning

After running the above command, be aware that the SSH login user changes from myuser to root. For subsequent SSH connections to the target machine, use root as the login user. This change occurs because the system switches to the NixOS kernel using kexec.

Configure Disk Layout

Before installing, you need to configure how the disk should be partitioned. See the disk configuration guide for details on setting up your disk layout.

Install the Machine

Finally deployment time!

This command is destructive and will format your disk and install NixOS on it!

$ clan machines install [MACHINE] --target-host root@<IP>

After the installation completes, your machine will reboot into the newly installed NixOS system.