Run system containers with LXD
Fast, dense, and secure container and VM management at any scale
LXD provides a unified user experience for managing system containers and virtual machines. For more demanding workloads, LXD can be set up in a cluster environment to run containers, VMs, or a combination of the two on a set of machines. LXD has direct hardware access, minimising overhead and matching the density and efficiency of containers.
Why choose LXD?
Run a full Linux OS inside a container
LXD system containers run a complete filesystem with background processes. This allows you to run any workload, or containerise your traditional systems and apps without modifying the apps or your operations. LXD containers offer the density and efficiency of containers with a VM-like experience.
LXD is image based, providing images for a large number of Linux distributions. It comes with a built-in image store that allows you to spin up a container or a VM in a matter of seconds. Existing integrations with various deployment and orchestration tools allow you to manage your infrastructure in a cloud-like way.
Secure and scalable
LXD runs unprivileged containers by default - protecting the host system from potential attacks. For virtual machines, LXD uses modern virtual hardware (VirtIO) exclusively. In addition, it utilises UEFI SecureBoot and provides vTPM support.
Resource restrictions through cgroups and ulimits, as well as RBAC, are also supported.
LXD is also easy to scale — from containers on your laptop to thousands of instances in the data centre.
Alternatives for running workloads
- To run a full Linux OS inside a container
- Utilises Kernel of the host
- Identical performance to bare metal
- For workloads needing a different kernel or OS than the host
- Legacy free
- Cloud-like experience
Clusters for more demanding workloads
- Up to 50 servers in a unified cluster with 1000s of instances
- Run containers, VMs, or a combination of the two
- Same distributed database
- Managed uniformly
Want to know more? Watch this deep dive into LXD clustering
- Flexible resource limits (CPU, memory, network I/O, disk space, and some kernel resources)
- Advanced snapshot support, including scheduling and automatic expiry
- Projects for segmenting your LXD server, and easy multi-user setup for enhanced security
- Hardware passthrough (GPU, USB, NIC, disks, and more)
- Support for live-migration and stateful snapshotting
- Advanced networking support (OVN, SR-IOV, hardware acceleration support, ...)
- High availability clustering when combined with CEPH and OVN for storage and network redundancy
- LTS releases every two years - supported for five years
- Commercial support available through Ubuntu Advantage
Install LXD in 4 easy steps
Install LXD as a snap
If you are running Ubuntu 16.04 or later, just run:
snap install lxd
Run the following command and either accept the defaults or choose different options when prompted:
Install the OS you’d like to use in your container or VM
lxc launch <image_server>:<image_name><instance_name>
lxc launch ubuntu:20.04 ubuntu-container
lxc launch <image_server>:<image_name><instance_name> --vm
lxc launch ubuntu:20.04 ubuntu-container-vm --vm
Check the community image server for other Linux distributions.
You now have your instance up and running! You’re all set to experiment with any commands you need.
lxc exec <instance_name> -- <command>
lxc exec ubuntu-container -- apt-get update
For a list of available commands and options, just run lxc
For other installation options, please check our documentation.
Enhance your experience with best-in-class open-source tools
Deploy workloads across different platforms with Juju
Juju makes it easy to deploy the exact same software on a variety of different platforms, including public and private cloud, bare metal, Kubernetes clusters. It is also a useful tool for local deployments, ideal for development.
For operating your instances using Juju please read this tutorial.
Easily manage bare metal infrastructure with MAAS and LXD
MAAS can automatically deploy and configure LXD as part of the deployment of a physical machine. Or it can be connected to an existing LXD deployment to dynamically create virtual machines on it.
To set up your own MAAS and LXD environment please read this tutorial.
Run Linux Apps on ChromeOS
Linux Apps allow a Chrome OS user to install applications from the Debian repositories and have them integrated into the underlying Chrome OS desktop. This gives users easy access to a variety of applications and tools.
Want to run Linux applications on your Chromebook using LXD? Learn how in this blog.