Incus on Ubuntu: Installation Guide and Upgrading from LXD

Virtualization tutorial - IT technology blog
Virtualization tutorial - IT technology blog

Incus vs LXD: Why Should You Care?

If you’ve ever used LXD on Ubuntu, you know how convenient it is for running system containers. However, since Canonical moved LXD to internal management, the community quickly created an independent fork called Incus.

Incus retains the power of LXD but completely removes the dependency on Snap. Installation is now handled via traditional APT, keeping the system cleaner and much more flexible. For me, ditching Snap for Incus is the best way to regain control over your server.

I’m currently running a homelab cluster with Proxmox managing about 12 VMs. Proxmox is great for centralized management, but Incus is the ultimate “weapon” for quick CLI operations. An Ubuntu container on Incus boots in less than a second—a speed traditional VMs can never reach.

Step 1: Installing Incus from the Zabbly Repository

Since Incus isn’t yet available in the default repositories of older Ubuntu versions, we’ll use the repository from Zabbly. This is a reputable source managed by the original maintainers of the project.

1.1 Adding the Repository

First, update your system and install curl and gpg:

sudo apt update && sudo apt install -y curl gpg

Next, download the Zabbly GPG key to authenticate the packages:

sudo mkdir -p /etc/apt/keyrings
sudo curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc

Now, add the repository to the Ubuntu source list:

cat <<EOF | sudo tee /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Signed-By: /etc/apt/keyrings/zabbly.asc
EOF

1.2 Installing the Packages

Just two more commands and the installation is complete:

sudo apt update
sudo apt install -y incus

Don’t forget to check if the service is running correctly:

systemctl status incus

Step 2: Quick Configuration with incus admin init

You can’t use it immediately after installation. We need to set up the storage and network infrastructure via the initialization command.

sudo incus admin init

Here is the “template” I often use for a single server:

  • Storage backend: Prefer zfs or btrfs. These formats allow instant snapshots and save about 20-30% of space thanks to compression. If your drive has no free partitions, choose dir to get started quickly.
  • Network Bridge: Choose yes to create a bridge (default is incusbr0). Containers will communicate with each other and the internet via NAT seamlessly.
  • IPv4/IPv6: Choose auto for Incus to assign IPs automatically.
  • Server access: If you only use it on that specific machine, choose no for security.

To make operations easier without typing sudo constantly, add your user to the admin group:

sudo usermod -aG incus-admin $USER
newgrp incus-admin

Step 3: Creating and Managing Your First Instance

Incus supports both Containers (lightweight, shared kernel) and Virtual Machines (fully isolated).

3.1 Initializing a Container

This command will download the image and run an Ubuntu 22.04 container named web-server:

incus launch images:ubuntu/22.04 web-server

3.2 Initializing a Virtual Machine (VM)

If you need to run Docker inside or require a separate kernel, use the --vm flag:

incus launch images:ubuntu/22.04 my-vm --vm

3.3 Handy Commands for SysAdmins

  • List instances: incus list (replaces the old lxc list).
  • Access the terminal: incus exec web-server bash.
  • Real-time resource usage: incus top.
  • Quick delete: incus delete web-server --force.

Step 4: Monitoring and Scaling

When running dozens of containers, you can’t just guess which one is hogging RAM. The incus top command gives you an overview just like the top command on Linux but separated clearly for each instance.

If you want to monitor system logs in real-time (e.g., when debugging network issues), use:

incus monitor

One thing I love is the ability to limit resources extremely fast. For example, want to limit web-server to a maximum of 2GB RAM? Just one command:

incus config set web-server limits.memory 2GB

Switching from lxc to incus might feel a bit awkward for the first few days. However, its stability and openness are well worth the transition effort. For Juniors, mastering Incus is a great foundation for understanding how Linux manages system resources, rather than just knowing the application layer like Docker.

Share: