Installing NixOS on Vultr

contents

This is a method of installing NixOS on a virtual private server (VPS) provided by the cloud host, Vultr.

NixOS is a build system, package manager, and lazily evaluated functional DSL for building and deploying a complete Linux operating system declaratively. All the system's configuration files are kept in the immutable Nix store, meaning that they are no longer stateful, and can also be provisioned declaratively, and rolled back with ease. The whole system configuration is kept in one file, configuration.nix.

This method installs NixOS, without nixos-infect or NixOps, instead using Vultr's provided NixOS installation ISO, and generating a snapshot which can be stored for free, and re-used to spin up as many VPS servers as you like. There is some manual set-up required in order to create the snapshot, but this only has to be done once; the initial set up can't be automated since the install process used to generate the snapshot needs to be done using Vultr's KVM console, with SSH being initially unavailable.

Overall, I find this to be a simple method of installing NixOS onto server in the cloud. There is potential to automate the deployment of new servers using the generated snapshots, which should be possible over SSH, and using the Vultr API, though this isn't covered here.

Spin up a server from the web UI

Install NixOS onto the server's storage

Create a snapshot

Deploy new servers with the snapshot