| |

Installing Incus on Debian 12 with ZFS Storage

In our previous tutorial, we set up ZFS on Debian 12 and created a dedicated ZFS pool named incus-zfs. Now, we’ll continue by installing Incus, a powerful system container manager, and configuring it to use our ZFS storage backend.

Prerequisites

  • Debian 12 (Bookworm) installed
  • Root access to your server
  • ZFS pool incus-zfs created and available
  • Basic understanding of Linux command line operations

Adding the Incus Repository

First, let’s add the official Incus repository to our system.

  1. Create the directory for the repository key:
mkdir -p /etc/apt/keyrings
  1. Download the Zabbly repository signing key:
curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
  1. Add the Incus repository configuration:
cat > /etc/apt/sources.list.d/zabbly-incus-stable.sources << EOF
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc
EOF

Installing Incus

Now that we’ve added the repository, let’s update our package lists and install Incus:

apt update
apt install -y incus

Initializing Incus

After installation, we need to initialize Incus and configure it to use our existing ZFS pool. Run the following command:

incus admin init

You’ll be prompted with several configuration questions. Here are the recommended responses, with explanations:

Would you like to use clustering? (yes/no) [default=no]:
# Press Enter to accept the default (no). Clustering is for multi-server setups.

Do you want to configure a new storage pool? (yes/no) [default=yes]:
# Press Enter to accept the default (yes).

Name of the new storage pool [default=default]:
# Press Enter to accept the default name.

Name of the storage backend to use (lvm, lvmcluster, zfs, btrfs, dir) [default=zfs]:
# Press Enter to accept the default (zfs).

Create a new ZFS pool? (yes/no) [default=yes]: no
# Type 'no' and press Enter, as we're using our existing pool.

Name of the existing ZFS pool or dataset: incus-zfs
# Enter the name of our previously created ZFS pool.

Would you like to create a new local network bridge? (yes/no) [default=yes]:
# Press Enter to accept the default (yes).

What should the new bridge be called? [default=incusbr0]:
# Press Enter to accept the default name.

What IPv4 address should be used? (CIDR subnet notation, "auto" or "none") [default=auto]: 10.0.10.1/24
# Enter '10.0.10.1/24' for our custom subnet.

Would you like to NAT IPv4 traffic on your bridge? [default=yes]:
# Press Enter to accept the default (yes).

What IPv6 address should be used? (CIDR subnet notation, "auto" or "none") [default=auto]:
# Press Enter to accept the default (auto).

Would you like the server to be available over the network? (yes/no) [default=no]:
# Press Enter to accept the default (no) for security.

Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:
# Press Enter to accept the default (yes).

Would you like a YAML "init" preseed to be printed? (yes/no) [default=no]:
# Press Enter to accept the default (no).

Verifying the Installation

After initialization, let’s verify that everything is set up correctly:

  1. Check the storage configuration:
incus storage list

Expected output:

+--------+--------+-------------+---------+---------+
| NAME   | DRIVER | DESCRIPTION | USED BY | STATE   |
+--------+--------+-------------+---------+---------+
| default| zfs    |             | 1       | CREATED |
+--------+--------+-------------+---------+---------+
  1. Verify the network setup:
incus network list

Expected output:

+----------+----------+---------+-------------+---------+
| NAME     | TYPE     | MANAGED | DESCRIPTION | USED BY |
+----------+----------+---------+-------------+---------+
| incusbr0 | bridge   | YES     |             | 0       |
+----------+----------+---------+-------------+---------+
  1. Check the overall Incus status:
incus info

This command will display general information about your Incus installation.

Conclusion

You’ve now successfully installed Incus on Debian 12 and configured it to use your existing ZFS pool. The system is set up with a custom network bridge (10.0.10.1/24) and is ready for container deployment.

In the next tutorial, we’ll cover:

  • Creating your first container
  • Basic container management
  • Setting up resource limits
  • Implementing backup strategies

Stay tuned for more Incus tutorials!

Similar Posts