To install LXD (Linux Containers) on Ubuntu 18.04 LTS, you can use the following steps:
- Install the necessary packages:
sudo apt install lxd lxd-client - Initialize LXD by running
sudo lxd initand following the prompts. You can choose to use the default settings or customize the storage pool and network settings. - Verify the installation by checking the version of LXD:
lxd --version - You can now create and manage containers using the
lxccommand, for examplelxc launch ubuntu:18.04 mycontainer - To manage the container you can use the command
lxc listto see the list of container andlxc stopandlxc startto stop and start a container.
Note: It is recommended to use the latest version of LXD, if you are using an older version of Ubuntu, you may need to install from a PPA or from source.