UbuntuUbuntu Based

How To Install Incus on Ubuntu 24.04 LTS

Install Incus on Ubuntu 24.04

Container and virtual machine management has become essential for modern system administration and development workflows. As organizations move toward more efficient infrastructure solutions, tools like Incus provide powerful capabilities for managing both system containers and virtual machines from a single platform.

Incus represents the next evolution in container and VM management technology, emerging from the proven foundations of LXD. This comprehensive guide will walk you through every step of installing Incus on Ubuntu 24.04 LTS, from basic container functionality to advanced virtual machine support. Whether you’re migrating from existing LXD installations or starting fresh, you’ll discover multiple installation methods, configuration best practices, and troubleshooting solutions.

Ubuntu 24.04 LTS provides an ideal foundation for Incus deployment, offering long-term stability, security updates, and native package support. By the end of this tutorial, you’ll have a fully functional Incus installation ready for production workloads or development environments.

What is Incus? Understanding the Technology

Definition and Core Capabilities

Incus serves as a modern container and virtual machine manager designed to deliver cloud-like experiences for self-hosted environments. Unlike traditional application containers that focus on single processes, Incus specializes in system containers that behave like lightweight virtual machines while maintaining container efficiency.

The platform excels at managing complete operating system environments, making it perfect for development, testing, and production scenarios. Incus supports everything from single board computers to high-end server clusters, providing scalable infrastructure management capabilities.

System administrators appreciate Incus for its unified approach to container and VM management. The same commands and interfaces work seamlessly across both container and virtual machine workloads, simplifying operational complexity while maintaining powerful functionality.

Incus vs LXD Background

The Incus project emerged following significant changes in the LXD ecosystem when Canonical made strategic decisions about LXD’s future direction. The Linux Containers project, along with the original LXD development team, created Incus to continue the open-source development model that made LXD successful.

This transition ensures continuity for existing LXD users while providing enhanced features and community-driven development. Incus maintains compatibility with LXD concepts and workflows, making migration straightforward for existing deployments.

The same experienced team that created and maintained LXD now focuses their expertise on Incus development. This continuity guarantees that proven architectural decisions and battle-tested code form the foundation of Incus.

Key Features

Incus distinguishes itself through comprehensive support for both system containers and virtual machines within a single management framework. System containers provide near-native performance while maintaining strong isolation between workloads.

Virtual machine support extends Incus capabilities to scenarios requiring complete kernel isolation or running different operating systems. The unified storage and networking subsystems work seamlessly across both container and VM workloads.

Advanced features include live migration, snapshot management, and sophisticated networking options that rival enterprise virtualization platforms.

Prerequisites and System Requirements

Hardware Requirements

Successful Incus deployment requires adequate hardware resources to support both the management daemon and guest workloads. Minimum requirements include 2GB RAM for basic container operations, though 4GB or more provides better performance for multiple containers or virtual machines.

Storage requirements vary significantly based on intended usage patterns. Plan for at least 20GB free disk space for the base installation and container images, with additional space allocated based on anticipated workload requirements.

CPU virtualization extensions (VT-x on Intel or AMD-V on AMD processors) become essential when running virtual machines. These hardware features enable efficient VM operation and must be enabled in system BIOS or UEFI firmware.

Software Prerequisites

Ubuntu 24.04 LTS installation provides the foundation for Incus deployment. Ensure your system includes current security updates and properly configured package repositories before beginning the installation process.

Administrative privileges through sudo access are mandatory for installation and initial configuration steps. The installation process modifies system configurations and installs kernel modules requiring elevated permissions.

Network connectivity enables package downloads and container image retrieval during installation and operation. Configure DNS resolution and internet access before proceeding with Incus installation.

User Account Setup

Proper user account configuration simplifies daily Incus management tasks. The installation process creates an incus-admin group for managing daemon access permissions.

Regular user accounts require group membership to interact with the Incus daemon without constant sudo elevation. Plan user access requirements during initial setup to avoid permission issues later.

Group membership changes require session refresh or system logout/login to take effect. Consider this timing when planning installation and configuration sequences.

Installation Methods Overview

Native Ubuntu Packages

Ubuntu 24.04 LTS includes Incus 6.0 LTS packages in the official Universe repository, providing stable, well-tested installations with integrated security update support. This approach offers the simplest installation path for most users.

The Universe repository contains community-maintained packages that receive regular security updates through Ubuntu’s standard update mechanisms. This integration ensures Incus updates arrive alongside other system security patches.

Native packages include proper dependency management and system integration, reducing potential conflicts with other installed software while maintaining Ubuntu’s quality standards.

Third-Party Packages

Alternative package sources provide access to newer Incus versions that may include additional features or performance improvements not yet available in Ubuntu’s repositories.

Third-party packages often decouple Incus release schedules from Ubuntu’s update cycles, enabling faster access to new features and bug fixes. This flexibility benefits users requiring specific functionality or performance characteristics.

Consider the trade-offs between stability and features when choosing installation methods, as third-party sources may introduce additional complexity in update management.

Method 1: Installing Incus via Native Ubuntu Packages

Basic Container Installation

Begin the installation process by updating your system’s package index to ensure access to the latest package versions. Execute the following command to refresh repository information:

sudo apt update

Install the basic Incus package for container functionality using Ubuntu’s package manager:

sudo apt install incus

The installation process downloads and configures the Incus daemon, command-line tools, and essential dependencies. Package installation typically completes within a few minutes, depending on network speed and system performance.

Verify successful installation by checking the installed Incus version:

incus --version

This command should display the installed Incus version number, confirming successful package installation and basic functionality.

Full Installation with VM Support

Extended Incus functionality requires additional packages for virtual machine support. Install the complete package set including QEMU integration:

sudo apt install incus qemu-system-x86-64

QEMU provides the underlying virtualization technology enabling Incus to create and manage virtual machines alongside containers. This integration delivers comprehensive infrastructure management capabilities from a single platform.

Virtual machine support significantly expands Incus use cases, enabling scenarios requiring complete kernel isolation or different guest operating systems. The QEMU integration maintains performance while providing enterprise-grade virtualization features.

Confirm VM support installation by verifying QEMU availability:

qemu-system-x86_64 --version

Migration Tools Installation

Users migrating from existing LXD installations benefit from specialized migration tools included in the incus-tools package:

sudo apt install incus-tools

The lxd-to-incus migration tool handles data transfer, configuration migration, and service transition from LXD to Incus installations. This automation reduces migration complexity and minimizes downtime during transitions.

Migration tools support LXD versions from 4.0.0 through 5.21, covering most production LXD deployments. Check your current LXD version before attempting migration to ensure compatibility.

Verify migration tool availability:

lxd-to-incus --help

Initial Configuration and Setup

User Group Management

Proper user group configuration enables non-privileged access to Incus functionality. Add your user account to the incus-admin group:

sudo adduser $USER incus-admin

This command adds the current user to the administrative group, enabling daemon communication without constant sudo elevation. Group membership changes require session refresh to take effect.

Log out and log back in to activate group membership changes, or use the following command to refresh group assignments in the current session:

newgrp incus-admin

Verify group membership using the groups command:

groups

The output should include incus-admin among the listed groups, confirming proper configuration.

Daemon Initialization

Initialize the Incus daemon with default configuration settings suitable for most use cases:

incus admin init --minimal

The minimal initialization creates basic storage pools and network configurations without interactive prompts. This approach works well for standard installations and can be customized later as requirements evolve.

For advanced users requiring specific storage backends or network configurations, run the interactive initialization:

incus admin init

Interactive initialization prompts for storage pool types, network bridge configurations, and clustering options. Answer each prompt based on your specific infrastructure requirements.

Verification Steps

Test basic Incus functionality by listing available containers and virtual machines:

incus ls

An empty list confirms successful daemon initialization and proper communication between client tools and the daemon. This command serves as a basic connectivity test for the installation.

Check daemon status using systemctl:

sudo systemctl status incus

The service should show active (running) status, indicating proper daemon startup and operation. Any errors in service status require investigation before proceeding with container or VM operations.

Migrating from LXD to Incus

Pre-Migration Preparation

Successful LXD to Incus migration requires careful preparation and compatibility verification. Check your current LXD version to ensure migration tool support:

lxd --version

Supported LXD versions range from 4.0.0 to 5.21, covering most production deployments. Versions outside this range may require intermediate updates or alternative migration strategies.

Back up critical LXD data before beginning migration, including container data, configuration files, and any custom storage pools. While the migration process preserves data, backups provide insurance against unexpected issues.

Clean up LXD configuration conflicts that might interfere with migration. Remove or reset the core.trust_password setting if configured:

lxc config unset core.trust_password

Migration Process

Execute the LXD to Incus migration using the specialized migration tool:

sudo lxd-to-incus

The migration tool automatically handles service shutdown, data transfer, configuration conversion, and service startup. This process typically completes without user intervention, though complex configurations may require additional steps.

Monitor migration progress through the tool’s output messages. The process includes stopping LXD services, converting configuration formats, transferring container and VM data, and starting Incus services.

Verify migration success by listing containers and virtual machines using Incus commands:

incus ls

All previously configured LXD containers and VMs should appear in the Incus listing with preserved configurations and data.

Common Migration Issues and Solutions

Version compatibility errors represent the most common migration challenge. If your LXD version falls outside the supported range, update LXD to a compatible version before attempting migration.

Configuration conflicts, particularly with networking or storage settings, may require manual resolution. Review error messages carefully and adjust conflicting settings before retrying migration.

In cases where migration encounters persistent issues, consider downgrading LXD to version 5.0.2 LTS, which provides broad compatibility with migration tools:

sudo snap refresh lxd --channel=5.0/stable

Post-migration verification should include testing container startup, network connectivity, and storage access to ensure complete functionality transfer.

Post-Installation Configuration

Storage Pool Setup

Configure storage pools to optimize performance and manage disk space efficiently. Create a storage pool using the directory backend for simple deployments:

incus storage create default dir source=/var/lib/incus/storage-pools/default

The directory backend stores container and VM data in standard filesystem directories, providing simplicity and broad compatibility. This approach works well for development environments and smaller deployments.

For production environments requiring advanced features, consider ZFS or Btrfs storage backends:

incus storage create zfs-pool zfs source=/dev/sdb

Advanced storage backends provide features like snapshots, compression, and deduplication that enhance performance and reduce storage requirements.

Network Configuration

Set up network bridges to provide container and VM connectivity. Create a managed bridge for automatic configuration:

incus network create incusbr0

Managed bridges include DHCP services, NAT configuration, and firewall rules that provide immediate connectivity for new containers and VMs. This configuration works well for isolated development environments.

Integration with existing network infrastructure may require custom bridge configurations or external DHCP services. Plan network topology carefully to avoid conflicts with existing services.

Configure DNS settings for proper name resolution within containers:

incus network set incusbr0 dns.domain incus.local

System Integration

Improve command-line efficiency by setting up shell aliases for common Incus operations:

echo 'alias lxc="incus"' >> ~/.bashrc
source ~/.bashrc

This alias provides compatibility for users familiar with LXD command syntax while using Incus functionality.

Configure automatic service startup to ensure Incus availability after system reboots:

sudo systemctl enable incus

Service management through systemctl provides reliable daemon control and integration with Ubuntu’s init system.

Advanced Installation: From Source

Build Requirements

Source-based installation provides access to development versions and custom configurations not available through package management. Install Go development tools and build dependencies:

sudo apt install golang-go build-essential git pkg-config liblxc-dev libsqlite3-dev libacl1-dev libuv1-dev

Building from source requires recent Go versions and development libraries for core functionality. Ensure your Go installation meets minimum version requirements specified in Incus documentation.

Clone the Incus source repository:

git clone https://github.com/lxc/incus.git
cd incus

Environment Setup

Configure environment variables for proper compilation and execution:

export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib"

Build and install Incus from source:

make deps
make
sudo make install

Configure user ID mapping for unprivileged container operation:

echo "root:1000000:1000000000" | sudo tee -a /etc/subuid
echo "root:1000000:1000000000" | sudo tee -a /etc/subgid

Start the Incus daemon manually for testing:

sudo incusd --group incus-admin

Testing Your Installation

Basic Functionality Tests

Verify container functionality by creating and starting a basic Ubuntu container:

incus launch ubuntu:22.04 test-container

This command downloads the Ubuntu 22.04 container image and creates a running container instance. Image downloads may take several minutes depending on network connectivity.

Test container interaction through command execution:

incus exec test-container -- ls -la /

Successful command execution confirms proper container operation and daemon communication.

Virtual Machine Testing

Test virtual machine functionality by creating an Ubuntu VM:

incus launch ubuntu:22.04 test-vm --vm

VM creation requires more time than containers due to boot processes and initialization sequences. Monitor VM startup progress using the info command:

incus info test-vm

Access the VM console for direct interaction:

incus console test-vm

Successful console access confirms complete VM functionality and proper virtualization support.

Troubleshooting Common Issues

Permission Problems

Group membership issues prevent normal users from accessing Incus functionality. Verify group membership and refresh sessions:

groups
newgrp incus-admin

File permission problems may prevent daemon startup or container operation. Reset Incus directory permissions:

sudo chown -R root:root /var/lib/incus
sudo chmod -R 755 /var/lib/incus

Service and Network Issues

Daemon startup failures often relate to configuration conflicts or missing dependencies. Check service logs for specific error messages:

sudo journalctl -u incus -f

Network connectivity problems may stem from bridge configuration issues or firewall rules. Verify bridge status:

ip addr show incusbr0

Storage access problems require investigation of filesystem permissions and available disk space:

df -h /var/lib/incus

Migration-Specific Problems

Version mismatch errors during migration require LXD updates to compatible versions. Check migration tool documentation for supported version ranges.

Configuration conflicts may require manual intervention to resolve incompatible settings between LXD and Incus. Review error messages carefully and adjust conflicting configurations.

Data corruption during migration, while rare, may require restoration from backups and retry of migration procedures.

Best Practices and Security Considerations

Security Hardening

Implement proper access controls by limiting incus-admin group membership to trusted users. Regular audit of group membership prevents unauthorized access to infrastructure management capabilities.

Configure network security through appropriate firewall rules and network segmentation. Isolate container networks from sensitive infrastructure components where appropriate.

Enable and configure storage encryption for sensitive workloads. Many storage backends support encryption features that protect data at rest.

Performance Optimization

Optimize resource allocation through proper CPU, memory, and storage limits for containers and VMs. Prevent resource contention by monitoring usage patterns and adjusting limits accordingly.

Storage performance benefits from proper backend selection and configuration. Consider SSD storage for high-performance workloads and implement appropriate file system options.

Network optimization involves tuning bridge configurations and considering dedicated network interfaces for high-throughput applications.

Congratulations! You have successfully installed Incus. Thanks for using this tutorial for installing Incus container and virtual machine manager on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Incus website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button