How to Install Incus Container in Ubuntu 22.04/20.04, Debian 12/11

image from ubuntu.com

This simple tutorial shows you how to install Incus container, the community fork of Canonical’s LXD, in Ubuntu 22.04, Ubuntu 20.04, Debian 11 & 12.

The Linux Containers team announced the first 0.1 release of Incus few days ago. It’s a community fork of Canonical LXD, and the first release roughly equivalent to LXD 5.18 but with removal a lot of unused or problematic features from LXD.

  • Remove /1.0/containers and /1.0/virtual-machines
  • Replace /dev/lxd with /dev/incus
  • Remove legacy Container functions from the Go API
  • Remove Ubuntu Fan bridges.
  • Remove shiftfs
  • Remove Canonical RBAC authorization.
  • Remove Canonical MAAS integration
  • Remove the concept of trust password
  • lxd-to-incus tool used to transition a system from LXD to Incus.

How to Install Incus in Debian & Ubuntu:

Incus is available through Homebrew for Linux and Mac OS. For Ubuntu, Debian, and based systems, there’s an official apt repository for current LTS and stable.

1. Setup the key

First, launch terminal from start/application menu or ‘Activities’ overview. Ubuntu users can simply press Ctrl+Alt+T on keyboard.

When terminal opens, run command to download & install key to ‘/etc/apt/keyrings‘:

  1. Create the keyring folder in case it does not exist:
    sudo mkdir -p /etc/apt/keyrings
  2. Then, download & install the key:
    curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc

    If ‘curl’ not found, run sudo apt install curl to get it

Download Incus key

2. Add the apt repository

After installing the key, run command to create and edit the source file:

sudo nano /etc/apt/sources.list.d/zabbly-incus-stable.sources

Then, copy and paste the following line into it:

Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: jammy
Components: main
Signed-By: /etc/apt/keyrings/zabbly.asc

Here you need to replace jammy (for Ubuntu 22.04, Linux Mint 21, etc), with focal (for Ubuntu 20.04), bookworm (for Debian 12), or bullseye (for Debian 11).

Finally, press Ctrl+x, type y and hit Enter to save file.

3. Install Incus

After setting up the key and source repository, run command to refresh package cache:

sudo apt update

Finally, install the container package by running command:

sudo apt install incus

Verify

After installation, run incus version to verify. And, as the terminal output recommends, you may run incus admin init to configure the daemon. Or, run incus --help for more command usage.

See more about Incus 0.1 via the official announcement.

Uninstall Incus

To remove the container, simply open terminal and run command:

sudo apt remove --autoremove incus

And remove the apt repository by simply deleting the source file:

sudo rm /etc/apt/sources.list.d/zabbly-incus-stable.sources

In case you use Zabbly repository of the latest Linux Kernel, you may keep the key file. Or, remove it by running command:

sudo rm /etc/apt/keyrings/zabbly.asc

Finally, run sudo apt update to refresh your system package cache.

Exit mobile version