Skip to main content

Installation & Configuration

The official way of installing LXD is via Canonical's Snaps. It is possible to install via your distributions package manager, but your mileage may vary.


Ensure snapd is installed on your system, installation instructions vary by distribution, check snapcraft.io for specific installation instructions.

On Debian:

sudo apt update
sudo apt install snapd

Once the installation is complete, we can now install LXD via the snap. There is a guide on the LXC forum on how to manage versions and updates with the snap package, this can be found here.

sudo snap install lxd

Installation of LXD is now complete.

Initial configuration

In order to use LXD we must run through a quick configuration process.

Run:

sudo lxd init

Which will ask you a series of questions, the defaults work perfectly fine for testing, adjust the configuration to your preference once used in production. For a quick rundown on what each option is asking for, check it out here

Would you like to use LXD clustering? (yes/no) [default=no]: 
Do you want to configure a new storage pool? (yes/no) [default=yes]: 
Name of the new storage pool [default=default]: 
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default=zfs]: 
Create a new ZFS pool? (yes/no) [default=yes]: 
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: 
Size in GB of the new loop device (1GB minimum) [default=9GB]: 
Would you like to connect to a MAAS server? (yes/no) [default=no]: 
Would you like to create a new local network bridge? (yes/no) [default=yes]: 
What should the new bridge be called? [default=lxdbr0]: 
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: 
Would you like the LXD server to be available over the network? (yes/no) [default=no]: 
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] 
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:

The initial setup is now complete