Install
This page installs cairn from the signed package repository, gives your user access, and checks that the host is ready. It takes a few minutes.
What you need
- A computer running Linux on x86-64, with kernel 6.17 or later.
- KVM, the kernel's built-in virtualization. Most hardware has it. On a cloud server, you need an instance type that supports nested virtualization or runs on bare metal.
- Fedora (or another dnf-based distribution) or Ubuntu (or another apt-based one).
The package pulls in everything else it needs (nftables, podman, e2fsprogs). You don't need Docker.
Step 1: install the package
sudo curl -fsSLo /etc/yum.repos.d/cairn.repo https://packages.cairn.dev/cairn.repo
sudo dnf install cairn
sudo usermod -aG cairn $USERsudo curl -fsSLo /etc/apt/keyrings/cairn-packages.gpg https://packages.cairn.dev/cairn-packages.gpg
sudo curl -fsSLo /etc/apt/sources.list.d/cairn.sources https://packages.cairn.dev/cairn.sources
sudo apt update && sudo apt install cairn
sudo usermod -aG cairn,kvm $USERIn order, these commands:
- add cairn's repository, so your package manager can find cairn and verify its signature;
- install cairn;
- add you to the
cairngroup, which the package creates. Only members of this group (and root) may run VMs with cairn.
You can use the cairn group right away, with no need to log out. cairn checks /etc/group every time it runs.
Ubuntu: log out and back in once
On Ubuntu, /dev/kvm belongs to the kvm group, so the command above also adds you to kvm. Unlike cairn, membership of kvm only takes effect at your next login. Fedora lets every user open /dev/kvm, so it doesn't need this step.
Step 2: check the host
cairn doctordoctor runs about 70 checks: your access, KVM, the kernel version, networking, the jail and systemd. On a terminal it shows a summary per area, then each problem with the command that fixes it. Add -v to see every check.
[ok ] the cairn group exists (gid 964)
[ok ] you may use cairn (in the member list as work)
[ok ] this shell can open /dev/kvm
[ok ] your user manager can open /dev/kvm
[ok ] kernel 7.2.14-100.fc43.x86_64 is 6.17 or later
[ok ] builder: podman (podman version 5.8.9)
...[ok ]: all good.[warn]: worth reading, but it doesn't stop you deploying.[fail]: must be fixed first. Thefix:line underneath tells you how.
doctor never changes anything. Run it again after each fix until no failures remain.
doctor fails with "your user manager can open /dev/kvm"
"This shell" and "your user manager" are checked separately. Apps that start at boot run under your systemd user manager, which may have started before you joined the kvm group.
Log out and back in. If linger is on (loginctl show-user $USER -p Linger says yes), your user manager keeps running while you are logged out, so you also need to restart it:
sudo systemctl restart user@$(id -u).serviceThis stops every user service and VM you have running.
doctor fails with a row ending "sudo chmod go-w /"
Some Fedora Cloud images ship with / writable by its group. The jail refuses to run under a directory that other users could change, so run the command once:
sudo chmod go-w /Ubuntu: AppArmor and unprivileged user namespaces
Ubuntu 24.04 and later block unprivileged user namespaces (kernel.apparmor_restrict_unprivileged_userns=1). cairn needs them for its network agent and its disk builds. The package installs two AppArmor profiles, /etc/apparmor.d/cairn and /etc/apparmor.d/cairn-netd, that allow this for cairn's own programs only.
If loading the profiles fails, the install prints a warning, and doctor names the apparmor_parser command that loads them. Don't set the sysctl to 0 for cairn. The profiles are the intended fix.
Step 3: start apps at boot (optional)
cairn starts your apps through your systemd user manager. By default, that manager only runs while you are logged in. To have your apps start when the computer boots, turn on linger for your user:
loginctl enable-linger $USER
cairn doctorWithout systemd, everything else still works, but apps don't start at boot.
The guest kernel
Every VM boots a Linux kernel that cairn provides, separate from your host's kernel. You don't have to do anything. Your first deploy downloads cairn's pinned kernel (6.1.155), checks its checksum, and keeps it in ~/.cairn/kernels/.
On a machine without internet access, copy the kernel file over and install it yourself:
cairn kernel fetch # download now instead of on the first deploy
cairn kernel install ./vmlinux # install a copy you already haveTo boot a kernel of your own, see Guest kernels.
Updating and removing
Updates come through your package manager like any other package (sudo dnf upgrade or sudo apt upgrade). Run cairn doctor afterwards.
To remove cairn, or to take a user's access away, see Host admin.
Next
To build cairn from source instead, see Development.