Choose your release¶
LXD upstream maintains different release branches in parallel:
- Long term support (LTS) releases: currently LXD 5.0.x and LXD 4.0.x
- Feature releases: LXD 5.x
LTS releases are recommended for production environments as they will benefit from regular bugfix and security updates but will not see new features added or any kind of behavioral change.
To get all the latest features and monthly updates to LXD, use the feature release branch instead.
Installing a package¶
The easiest way to install LXD on Linux is to install the snap package, which is available for different Linux distributions.
If this option does not work for you, see the other installation options.
LXD upstream publishes and tests snap packages that work for a number of Linux distributions, for example, Ubuntu, Arch Linux, Debian, Fedora and OpenSUSE.
Complete the following steps to install the snap:
snapd. See the installation instructions on snapcraft.io.
Install the snap package.
For the latest feature release, use:
sudo snap install lxd
For the LXD 5.0 LTS release, use:
sudo snap install lxd --channel=5.0/stable
For more information about LXD snap packages (regarding more versions, update management etc.), see Managing the LXD snap.
On Ubuntu 18.04, if you previously had the LXD deb package installed, you can migrate all your existing data over with:
Other installation options¶
Some Linux distributions provide installation options other than the snap package.
To install the feature branch of LXD on Alpine Linux, run:
apk add lxd
To install the feature branch of LXD on Arch Linux, run:
pacman -S lxd
Fedora RPM packages for LXC/LXD are available in the COPR repository.
To install the LXD package for the feature branch, run:
dnf copr enable ganto/lxc4 dnf install lxd
See the Installation Guide for more detailed installation instructions.
To install the feature branch of LXD on Gentoo, run:
emerge --ask lxd
Other operating systems¶
The builds for other operating systems include only the client, not the server.
LXD upstream publishes builds of the LXD client for macOS through Homebrew.
To install the feature branch of LXD, run:
brew install lxc
You can also find native builds of the LXD client on GitHub. To download a specific build:
- Make sure that you are logged into your GitHub account.
- Filter for the branch or tag that you are interested in (for example, the latest release tag or
- Select the latest build and download the suitable artifact.
Installing from source¶
To build and install LXD from source, follow the instructions in Installing LXD from source.
"Instances" means both containers and virtual machines.
Before you can create an instance, you need to configure LXD.
Run the following command to start the interactive configuration process:
sudo lxd init
See Interactive setup options for an explanation of the different configuration options.
To create a non-optimized minimal setup with default options, you can skip the configuration steps by adding the
sudo lxd init --minimal
Compared to the interactive configuration, the minimal setup will be slower and provide less functionality. Especially the
dir storage backend (which is used by default) is slower and doesn't provide fast snapshots, fast copy/launch, quotas and optimized backups.
If you want to use an optimized setup, go through the interactive configuration process instead.
Security and access control¶
Access control for LXD is based on group membership. The root user and all members of the
lxd group can interact with the local daemon.
lxd group is missing on your system, create it and restart the LXD daemon. You can then add trusted users to the group. Anyone added to this group will have full control over LXD.
Because group membership is normally only applied at login, you might need to either re-open your user session or use the
newgrp lxd command in the shell you're using to talk to LXD.
Anyone with access to the LXD socket can fully control LXD, which includes the ability to attach host devices and file systems. Therefore, you should only give access to users who would be trusted with root access to the host.
You can learn more about LXD security here.
Interactive setup options¶
You can configure the following options during the initial configuration of LXD.
default=no means the feature is disabled by default.
|Feature||Description||Basic configuration options||More information|
|Clustering||A cluster combines several LXD servers. They share the same distributed database and can be managed uniformly using the LXD client (lxc) or the REST API.||default=
If set to
|MAAS server||MAAS is an open-source tool that lets you build a data center from bare-metal servers.||default=
If set to
- MAAS - How to manage VM hosts
|Network bridge||Provides network access for the instances.||You can either use an existing bridge (or interface) or let LXD create a new bridge (recommended).
You can also create additional bridges and assign them to instances later.
- Network interface
|Storage pools||Instances etc. are stored in storage pools.||For testing purposes, you can create a loop-backed storage pool.
But for production use you should use an empty partition (or full disk) instead of loop-backed storages (because loop-backed pools are slower and their size can't be reduced).
The recommended backends are
You can also create additional storage pools later.
- About storage
- Storage drivers
|Network access||Allows access to the server over network.||default=
If set to
You can set a
|Automatic image update||You can download images from image servers. In this case, images can be updated automatically.||default=
If set to
|YAML lxd init preseed||Will display a summary of your chosen configuration options in the terminal.||default=
Instances are based on images, which contain a basic operating system (for example a Linux distribution) and some other LXD-related information.
In the following we will use the built-in remote image servers (see below).
For more options see Advanced Guide - Advanced options for Images.
Use remote image servers¶
The easiest way is to use a built-in remote image server.
You can get a list of built-in image servers with:
lxc remote list
LXD comes with 3 default servers:
ubuntu:(for stable Ubuntu images)
ubuntu-daily:(for daily Ubuntu images)
images:(for a bunch of other distros)
List images on server¶
To get a list of remote images on server
lxc image list images:
Most details in the list should be self-explanatory.
- Alias with
cloud: refers to images with built-in cloud-init support (see Advanced Guide - Cloud-Init and official cloud-init documentation)
Search for images¶
You can search for images, by applying specific elements (e.g. the name of a distribution).
Show all Debian images:
lxc image list images: debian
Show all 64-bit Debian images:
lxc image list images: debian amd64
Images for virtual machines¶
It is recommended to use the
cloud variants of images (visible by the
cloud-tag in their
ALIAS). They include cloud-init and the LXD-agent. They also increase their size automatically and are tested daily.
Further information & links¶
You find more information on the following pages: