Managing LXD containers
With Docker out of the way, let’s take a look at how to run containers with LXD. Let’s dive right in and install the required package:
sudo snap install lxd
As you can see, installing LXD is just as easy as installing Docker. In fact, managing containers with LXD is very straightforward as well, as you’ll soon see. Installing LXD gives us the lxc
command, which is the command we’ll use to manage LXD containers. Before we get going though, we should add our user account to the lxd
group:
sudo usermod -aG lxd <yourusername>
Make sure you log out and log in for the changes to take effect. Just like with the docker
group with Docker, the lxd
group will allow our user account to manage LXD containers.
Next, we need to initialize our new LXD installation. We’ll do that with the lxd init
command:
lxd init
The process will look similar to the following screenshot:
Figure 17.4: Setting...