Project: lxd (Runtime / Container Runtime)
File: installing.md

(installing)= The easiest way to install Incus is to {ref}`install one of the available packages <installing-from-package>`, but you can also {ref}`install Incus from the sources <installingfromsource>`. After installing Incus, make sure you have an `incus-admin` group on your system. Users in this group can interact with Incus. See {ref}`installing-manage-access` for instructions. % Include content from ```{include} support.md :start-after: <!-- Include start release --> :end-before: <!-- Include end release --> ``` LTS releases are recommended for production environments, because they benefit from regular bugfix and security updates. However, there are no new features added to an LTS release, nor any kind of behavioral change. To get all the latest features and monthly updates to Incus, use the feature release branch instead. (installing-from-package)= The Incus daemon only works on Linux. The client tool () is available on most platforms. Packages are available for a number of Linux distributions, either in their main repository or through third party repositories. ````{tabs} ```{group-tab} Alpine Incus and all of its dependencies are available in Alpine Linux's community repository as `incus`. Install Incus with: apk add incus incus-client Then enable and start the service: rc-update add incusd rc-service incusd start Please report packaging issues . ``` ```{group-tab} Arch Linux Incus and all of its dependencies are available in Arch Linux's main repository as `incus`. Install Incus with: pacman -S incus Please report packaging issues . ``` ```{group-tab} Debian There are three options currently available to Debian users. Native `incus` package A native `incus` package is currently available in the Debian testing and unstable repositories. This package will be featured in the upcoming Debian 13 (`trixie`) release. On such systems, just running `apt install incus` will get Incus installed. Native `incus` backported package A native `incus` backported package is currently available for Debian 12 (`bookworm`) users. On such systems, just running `apt install incus/bookworm-backports` will get Incus installed. NOTE: Users of backported packages should not file bugs in the Debian Bug Tracker, instead please reach out or directly to the Debian packager. Zabbly package repository provides up to date and supported Incus packages for Debian stable releases (11 and 12). Those packages contain everything needed to use all Incus features. Up to date installation instructions may be found here: ``` ```{group-tab} Docker Docker/Podman images of Incus, based on the Zabbly package repository, are available with instructions here: ``` ```{group-tab} Fedora RPM packages of Incus and its dependencies are not yet available via official Fedora repositories but via the Community Project (COPR) repository. Install the COPR plugin for `dnf` and then enable the COPR repository: dnf install 'dnf-command(copr)' dnf copr enable ganto/lxc4 Install Incus with: dnf install incus For the additional setup steps see . Note that this is not an official project of Incus nor Fedora. Please report packaging issues . ``` ```{group-tab} Gentoo Incus and all of its dependencies are available in Gentoo's main repository as . Install Incus with: emerge -av app-containers/incus Note: Installing LTS vs. feature-release will be explained later, when Incus upstream and Gentoo's repository has those releases available. There will be two newly created groups associated to Incus: `incus` to allow basic user access (launch containers), and `incus-admin` for `incus admin` controls. Add your regular users to either, or both, depending on your setup and use

After installation, you may want to configure Incus. This is optional though, as the defaults should also just work. `openrc`: Edit `/etc/conf.d/incus` `systemd`: `systemctl edit --full incus.service` Set up `/etc/subuid` and `/etc/subgid`: echo "root:1000000:1000000000" | tee -a /etc/subuid /etc/subgid For more information: {ref}`Idmaps for user namespace <userns-idmap>` Start the daemon: `openrc`: `rc-service incus start` `systemd`: `systemctl start incus` Continue in the . ``` ```{group-tab} NixOS Incus and its dependencies are packaged in NixOS and are configurable through NixOS options. See for a complete set of available options. The service can be enabled and started by adding the following to your NixOS configuration. virtualisation.incus.enable = true; Incus initialization can be done manually using `incus admin init`, or through the preseed option in your NixOS configuration. See the NixOS documentation for an example preseed. virtualisation.incus.preseed = {}; Finally, you can add users to the `incus-admin` group to provide non-root access to the Incus socket. In your NixOS configuration: users.users.YOUR_USERNAME.extraGroups = ["incus-admin"]; For any NixOS specific issues, please in the package repository. ``` ```{group-tab} Ubuntu There are two options currently available to Ubuntu users. Native `incus` package A native `incus` package is currently available in the Ubuntu development repository. This package will be featured in the upcoming Ubuntu 24.04 (noble) release. On such systems, just running `apt install incus` will get Incus installed. Zabbly package repository provides up to date and supported Incus packages for Ubuntu LTS releases (20.04 and 22.04). Those packages contain everything needed to use all Incus features. Up to date installation instructions may be found here: ``` ```{group-tab} Void Linux Incus and all of its dependencies are available in Void Linux's repository as `incus`. Install Incus with: xbps-install incus incus-client Then enable and start the services with: ln -s /etc/sv/incus /var/service ln -s /etc/sv/incus-user /var/service sv up incus sv up incus-user Please report packaging issues . ``` ```` ```{important} The builds for other operating systems include only the client, not the server. ``` ````{tabs} ```{group-tab} macOS Incus publishes builds of the Incus client for macOS through . To install the feature branch of Incus, run: brew install incus ``` ```{group-tab} Windows The Incus client on Windows is provided as a and package. To install it using Chocolatey or Winget, follow the instructions below: Chocolatey Install Chocolatey by following the . Install the Incus client: choco install incus Winget Install Winget by following the Install the Incus client: winget install LinuxContainers.Incus ``` ```` You can also find native builds of the Incus client on : Incus client for Linux: , Incus client for Windows: , Incus client for macOS: , (installingfromsource)= Follow these instructions if you want to build and install Incus from the source code. We recommend having the latest versions of `liblxc` (>= 5.0.0 required) available for Incus development. Additionally, Incus requires a modern Golang (see {ref}`requirements-go`) version to work. ````{tabs} ```{group-tab} Alpine Linux You can get the development resources required to build Incus on your Alpine Linux via the following command: apk add acl-dev autoconf automake eudev-dev gettext-dev go intltool libcap-dev libtool libuv-dev linux-headers lz4-dev tcl-dev sqlite-dev lxc-dev make xz To take advantage of all the necessary features of Incus, you must install additional packages. You can reference the list of packages you need to use specific functions from

<!-- wokeignore:rule=master --> Also you can find the package you need with the binary name from . Install the main dependencies: apk add acl attr ca-certificates cgmanager dbus dnsmasq lxc libintl iproute2 iptables netcat-openbsd rsync squashfs-tools shadow-uidmap tar xz Install the extra dependencies for running virtual machines: apk add qemu-system-x86_64 qemu-chardev-spice qemu-hw-usb-redirect qemu-hw-display-virtio-vga qemu-img qemu-ui-spice-core ovmf sgdisk util-linux-misc virtiofsd After preparing the source from a release tarball or git repository, you need follow the below steps to avoid known issues during build time: NOTE: Some build errors may occur if `/usr/local/include` doesn't exist on the system. Also, due to a , you may need to set those additional environment variables: export CGOLDFLAGS="$CGOLDFLAGS -L/usr/lib -lintl" export CGO_CPPFLAGS="-I/usr/include" ``` ```{group-tab} Debian and Ubuntu Install the build and required runtime dependencies with: sudo apt update sudo apt install acl attr autoconf automake dnsmasq-base git golang-go libacl1-dev libcap-dev liblxc1 liblxc-dev libsqlite3-dev libtool libudev-dev liblz4-dev libuv1-dev make pkg-config rsync squashfs-tools tar tcl xz-utils ebtables There are a few storage drivers for Incus besides the default `dir` driver. Installing these tools adds a bit to initramfs and may slow down your host boot, but are needed if you'd like to use a particular driver: sudo apt install btrfs-progs sudo apt install ceph-common sudo apt install lvm2 thin-provisioning-tools sudo apt install zfsutils-linux To run the test suite, you'll also need: sudo apt install busybox-static curl gettext jq sqlite3 socat bind9-dnsutils NOTE: If you use the `liblxc-dev` package and get compile time errors when building the `go-lxc` module, ensure that the value for `LXC_DEVEL` is `0` for your `liblxc` build. To check that, look at `/usr/include/lxc/version.h`. If the `LXC_DEVEL` value is `1`, replace it with `0` to work around the problem. It's a packaging bug, and we are aware of it for Ubuntu 22.04/22.10. Ubuntu 23.04/23.10 does not have this problem. ``` ```{group-tab} OpenSUSE You can get the development resources required to build Incus on your OpenSUSE Tumbleweed system via the following command: sudo zypper install autoconf automake git go libacl-devel libcap-devel liblxc1 liblxc-devel sqlite3-devel libtool libudev-devel liblz4-devel libuv-devel make pkg-config tcl In addition, for normal operation, you'll also likely need sudo zypper install dnsmasq squashfs xz rsync tar attr acl qemu qemu-img qemu-spice qemu-hw-display-virtio-gpu-pci iptables ebtables nftables As OpenSUSE stores QEMU firmware files using an unusual filename and location, you will need to create some symlinks for them: sudo mkdir /usr/share/OVMF sudo ln -s /usr/share/qemu/ovmf-x8664-4m-code.bin /usr/share/OVMF/OVMFCODE.4MB.fd sudo ln -s /usr/share/qemu/ovmf-x8664-4m-vars.bin /usr/share/OVMF/OVMFVARS.4MB.fd sudo ln -s /usr/share/qemu/ovmf-x8664-ms-4m-vars.bin /usr/share/OVMF/OVMFVARS.4MB.ms.fd sudo ln -s /usr/share/qemu/ovmf-x8664-ms-4m-code.bin /usr/share/OVMF/OVMFCODE.4MB.ms.fd ``` ```` These instructions for building from source are suitable for individual developers who want to build the latest version of Incus, or build a specific release of Incus which may not be offered by their Linux distribution. Source builds for integration into Linux distributions are not covered here and may be covered in detail in a separate document in the future. ```bash git clone https://github.com/lxc/incus cd incus ``` This will download the current development tree of Incus and place you in the source tree. Then proceed to the instructions below to actually build and install Incus. The Incus release tarballs bundle a complete dependency tree as well as a local copy of `libraft` and `libcowsql` for Incus' database setup. ```bash tar zxvf incus-0.1.tar.gz cd incus-0.1 ``` This will unpack the release tarball and place you inside of the source

Then proceed to the instructions below to actually build and install Incus. The actual building is done by two separate invocations of the Makefile: `make deps` -- which builds libraries required by Incus -- and `make`, which builds Incus itself. At the end of `make deps`, a message will be displayed which will specify environment variables that should be set prior to invoking `make`. As new versions of Incus are released, these environment variable settings may change, so be sure to use the ones displayed at the end of the `make deps` process, as the ones below (shown for example purposes) may not exactly match what your version of Incus requires: We recommend having at least 2GiB of RAM to allow the build to complete. ```{terminal} :input: make deps ... make[1]: Leaving directory '/root/go/deps/cowsql' Please set the following in your environment (possibly ~/.bashrc) :input: make ``` Once the build completes, you simply keep the source tree, add the directory referenced by `$(go env GOPATH)/bin` to your shell path, and set the `LDLIBRARYPATH` variable printed by `make deps` to your environment. This might look something like this for a `~/.bashrc` file: ```bash export PATH="${PATH}:$(go env GOPATH)/bin" export LDLIBRARYPATH="$(go env GOPATH)/deps/cowsql/.libs/:$(go env GOPATH)/deps/raft/.libs/:${LDLIBRARYPATH}" ``` Now, the `incusd` and `incus` binaries will be available to you and can be used to set up Incus. The binaries will automatically find and use the dependencies built in `$(go env GOPATH)/deps` thanks to the `LDLIBRARYPATH` environment variable. You'll need sub{u,g}ids for root, so that Incus can create the unprivileged containers: ```bash echo "root:1000000:1000000000" | sudo tee -a /etc/subuid /etc/subgid ``` Now you can run the daemon (the `--group sudo` bit allows everyone in the `sudo` group to talk to Incus; you can create your own group if you want): ```bash sudo -E PATH=${PATH} LDLIBRARYPATH=${LDLIBRARYPATH} $(go env GOPATH)/bin/incusd --group sudo ``` ```{note} If `newuidmap/newgidmap` tools are present on your system and `/etc/subuid`, `etc/subgid` exist, they must be configured to allow the root user a contiguous range of at least 10M UID/GID. ``` (installing-manage-access)= Access control for Incus is based on group membership. The root user and all members of the `incus-admin` group can interact with the local daemon. See {ref}`security-daemon-access` for more information. If the `incus-admin` group is missing on your system, create it and restart the Incus daemon. You can then add trusted users to the group. Anyone added to this group will have full control over Incus. Because group membership is normally only applied at login, you might need to either re-open your user session or use the `newgrp incus-admin` command in the shell you're using to talk to Incus. ````{important} % Include content from ```{include} ../README.md :start-after: <!-- Include start security note --> :end-before: <!-- Include end security note --> ``` ```` (installing-upgrade)= After upgrading Incus to a newer version, Incus might need to update its database to a new schema. This update happens automatically when the daemon starts up after an Incus upgrade. A backup of the database before the update is stored in the same location as the active database (at `/var/lib/incus/database`). ```{important} After a schema update, older versions of Incus might regard the database as invalid. That means that downgrading Incus might render your Incus installation unusable. In that case, if you need to downgrade, restore the database backup before starting the downgrade. ```