Proxmox Series – Part 4: Creating a Linux Container in Proxmox VE

Table of Contents:

Tags:

In the previous article, we showed you how to create Virtual Machines in Proxmox VE. In this blog post we will explore the alternative – lightweight Linux containers (LXC). 

What is a Container Template? 

A container template is a pre-configured filesystem image that contains the necessary files to run a specific Linux distribution or application. Proxmox VE uses these templates to create containers quickly and efficiently. 

Uploading a Container Template 

Proxmox VE provides a repository of pre-built container templates. You can download these templates directly from the Proxmox server or manually upload them. 

Via the Proxmox Web Interface: 

To upload a Template through the web interface, choose a storage pool that has been configured for ISO files, such as „local“ or a dedicated ISO storage. To begin, click local from the side panel on the left-hand side of your screen. 

Once inside the storage pool, select the “CT Templates” tab. Then click on “Templates” to open the template download window. Select the desired template (e.g., Debian 12) and click “Download”.  

Via the Command Line (CLI): 

For those who prefer the command line, you can download templates using the pveam tool. 

Run the following command to list available templates: 

pveam available 

To download a specific template, use: 

pveam download <storage> <template-name> 

Creating Containers (LXC) in Proxmox VE 

Click „Create CT“ in the top-right corner to launch the setup wizard. 

This will bring up the following pop-up window. 

General Settings: 

Proxmox will automatically assign a container ID, but as talked about in the last blog post you should customize it. Give your container a name and set a root password. This password will be used to access the container’s root account. Click next. 

Info: While you have the option to choose between unprivileged and privileged containers, it is highly recommended to use unprivileged containers due to their enhanced security benefits. 

Template Settings: 

Next, select the template you downloaded earlier and click next. This template will serve as the base for your container  

Disk Settings: 

Select a storage type based on your use case and chose how much storage you need: 

  • Ceph or GlusterFS: Ideal for highly available block storage environments. 
  • LVM-Thin: Perfect for local thin-provisioned storage (saves space on unused capacity). 
  • LVM (Thick): Recommended for SAN-based systems (iSCSI or Fibre Channel) to guarantee allocated capacity. 
  • qcow2: A flexible choice for file-based storage (local or over NFS). 

Once you have selected the hard disk space that you need, click the Next button. 

CPU Settings: 

Allocate the number of CPU cores you want the CT to have. 

Memory Settings: 

On the Memory tab, select how much RAM you wish to allocate to your VM, but avoid over-provisioning to prevent performance degradation. 

Network Settings: 

In the “Network” section, configure the container’s network interface. By default, Proxmox wants you to assign a static IP address to the container, but you can also configure it to use DHCP if preferred. Keep in mind that the IP address must be entered in CIDR notation (like /24 or /26). 

DNS Settings: 

Set a custom DNS server or use the same as your Proxmox host, then click next. 

Confirm and Create:  

Once you’ve configured all the settings, review your choices and click „Finish“ to create the container. Proxmox will create the container based on your specifications, which usually takes just a few seconds. 

Start and Configure the Container 

After the container is created, you can start it by selecting it in the „Server View“ panel and clicking the „Start“ button at the top of the screen.  
 
Once the container is up and running, you can immediately access and start using it. Simply log in with the username `root` and the password you set during installation. 

Having read this guide, you shouldnow be able to create an LXC container from scratch using nothing but Proxmox VE and a container template. In the next blog post, we’ll dive deeper into Proxmox to explore its underlying architecture and gain a more comprehensive understanding of how Proxmox VE works.

Autor

Pius Werner

Consultant

Pius Werner ist Consultant bei der Söldner Consult GmbH für Virtualisierung und IT-Sicherheit.