Post

Incus vs. Docker: The Next-Generation Guide to System Containers

Incus vs. Docker: The Next-Generation Guide to System Containers

In the world of containerization, Docker has long been the household name. However, for developers who need more than just a place to run a single process, Incus has emerged as the premier community-driven alternative.

While Docker focuses on Application Containers (packaging a single app), Incus focuses on System Containers (packaging a full Linux OS). Think of Incus as a way to create “instant Virtual Machines” that run at the speed of a container.


🚀 Key Differences at a Glance

FeatureDockerIncus
Philosophy“One process per container”“One full OS per container”
Primary UseMicroservices, CI/CD, DeploymentDevelopment Labs, AI Sandboxing, VPS replacement
Init SystemNo (Usually just entrypoint)Yes (systemd, OpenRC work natively)
SecurityProcess-level isolationUnprivileged containers by default + VM support
PersistenceVolatile (requires Volumes/Bind mounts)Persistent (acts like a physical disk)
HardwareHard to pass through GPUs/USBNative, low-latency device passthrough

⌨️ Command Comparison: Speaking the Language

If you already know Docker, learning Incus is a matter of mapping your existing knowledge to a new set of verbs.

ActionDocker CommandIncus Command
Start a containerdocker run -d --name web ubuntuincus launch images:ubuntu/24.04 web
List containersdocker psincus list
Access shelldocker exec -it web bashincus shell web
Stop containerdocker stop webincus stop web
Remove containerdocker rm -f webincus delete -f web
Create Imagedocker commit web my-imageincus publish web --alias my-image
View Logsdocker logs webincus info --show-log web
Copy Filesdocker cp file web:/pathincus file push file web/path

🛠️ Setting Up Your Incus Environment (Ubuntu 24.04+)

Incus is now officially supported in the latest Ubuntu repositories, making installation a breeze.

1. Installation & Init

1
2
3
4
5
6
7
8
9
# Install the core packages
sudo apt update && sudo apt install -y incus

# Add your user to the management group
sudo usermod -aG incus-admin $USER
newgrp incus-admin

# Initialize the system (Interactive Wizard)
incus admin init

Tip: During init, choosing ZFS or Btrfs for storage allows for near-instant snapshots.

2. Launching your first “Dev Box”

Unlike Docker Hub, Incus uses multiple “remotes.” The most common is the community-maintained images: server.

1
2
3
4
5
# Launch a persistent Ubuntu 24.04 container
incus launch images:ubuntu/24.04 dev-box

# Launch a MicroVM (for AI sandboxing or extra security)
incus launch images:ubuntu/24.04 ai-box --vm

🤖 Advanced Management: The “Pro” Workflow

Using Profiles for Automation

Instead of manual configuration, you can use Profiles to apply settings (like GPU access or mounted folders) to many containers at once.

1
2
3
4
5
6
7
8
9
10
# Create a profile for Rails development
incus profile create rails-dev

# Add a device to map your code folder from the host
incus profile device add rails-dev my-code disk \
    source=/home/user/projects/app \
    path=/root/app

# Apply this profile to your container
incus profile add dev-box rails-dev

Snapshotting (The “Undo” Button)

This is where Incus shines over Docker for development. Before making a big change:

1
2
3
4
5
# Create a snapshot
incus snapshot create dev-box pre-upgrade

# Messed up? Restore instantly
incus restore dev-box pre-upgrade

Running Docker inside Incus

Yes, you can have the best of both worlds. To run Docker inside an Incus container (nesting):

1
2
3
incus config set dev-box security.nesting=true
incus restart dev-box
# Now install docker inside the dev-box as usual!

🎯 Conclusion

Use Docker when you have a finished app that you want to ship to the cloud. Use Incus when you are building that app. It provides a stable, persistent, and high-performance environment that handles system services and hardware with ease—all while keeping your host machine clean and organized.

This post is licensed under CC BY 4.0 by the author.