Open In App

How to Install Ubuntu Server Edition with LXD Containers?

Last Updated : 23 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Managing several types of isolated environments on a single host is made possible with Ubuntu Server Edition installed in LXD containers for the system requirement. The Ubuntu team developed and maintained all the LXD container systems by following the practical implementation. A hypervisor service is offered by LXD throughout the system server to oversee the full life cycle of containers.

In this article, we'll explore the steps to Install Ubuntu Server Edition with LXD Containers.

Initial Requirements

Before moving forward, users need to follow some system requirements or prerequisites to install the Ubuntu server edition with LXD Containers.

  • Note the server's public IP address and the system or virtual machine with a minimum of 20 GB of disc space and 2 GB of RAM.
  • A downloaded Ubuntu Server Edition ISO image system.
  • Internal connection to the internet for downloading and updating packages as per requirement.

How to Install Ubuntu Server Edition with LXD Containers?

LXD can be downloaded as an official snap package as of Ubuntu 20.04 configuration. There are various types of advantages to this new package in the system. Any Linux distribution process that supports snap packages can be used to install a snap package modification system. Now, we'll explore the steps to install and use the Ubuntu server edition with LXD containers.

Step 1: Download Official Ubuntu Server

  • Go to Ubuntu's Official Website > Download the latest Ubuntu Server ISO image system.
  • Configure a bootable USB drive or mount the ISO to use it within a virtual machine.
  • Install Ubuntu Server > Create a user profile by providing a username and password.
Download_Ubuntu_Server

Step 2: Update the Entire System

  • Reboot the system > Log in with the Username and Password > Update the system to use the latest packages.
sudo apt update
sudo apt upgrade -y

Step 3: Install and Configure LXD

  • Install LXD by using the following command -
sudo apt install lxd -y
  • Create a system container by using the following command -
lxc launch ubuntu:20.04 my-container or webserver
  • Rename the new container as "my-container" > List all the required running containers by using the following command -
lxc list
  • Use "exec" to access the shell of the internal container by using the following command -
lxc exec my-container -- /bin/bash
  • Also, users can use the following commands to start, stop, and delete the running container as per requirement.
lxc start my-container or webserver
lxc stop my-container or webserver
lxc delete my-container or webserver

Step 4: Configure the Network

The containers' default bridge network is set up by LXD configuration through the network system. Users can build more networks if they require unique network configurations in the process by following the below-mentioned command:

lxc network create my-network
lxc network attach my-network my-container eth0

Conclusion

User containers' default bridge network is set up by the initial process of LXD. Then, using Nginx running inside an LXD container, users established an efficient website and used IPtables to make it publicly accessible for the initial processes. Although LXD comes with a default storage pool by which users can make more pools to suit their requirements. This configuration is perfect for a systematic way of deployment, testing, and development scenarios since it makes it easy to handle several separate environments or systems.

Also Read


Similar Reads