Proxmox

Creating an LXC Container in Proxmox

In addition to virtual machines, Proxmox can also run LXC containers. A container uses the kernel of Proxmox itself, instead of its own operating system. That makes it much lighter: it starts in seconds and uses little memory. Ideal for small Linux services like Pi-hole, a web server or a database.

Container or virtual machine?

  • Container (LXC): light and fast, Linux only. Shares the kernel with the server, so less separated than a VM.
  • Virtual machine: completely separated, suitable for Windows, other operating systems and anything that needs its own kernel settings.

Step 1: download a template

  1. Click local on the left and choose CT Templates.
  2. Click Templates, choose for example a recent Debian or Ubuntu and click Download.

Step 2: create the container

Click Create CT in the top right and go through the tabs:

  • General: choose a name (hostname) and a password, or paste your SSH key. Leave Unprivileged container enabled; that’s safer.
  • Template: choose the template you just downloaded.
  • Disks, CPU, Memory: choose a small disk (for example 8 GB), 1 or 2 cores and 512 MB to 1 GB memory. You can adjust that later.
  • Network: choose bridge vmbr0 and DHCP, or enter a fixed IP address.
  • DNS: leave the default values.
  • Confirm: check Start after created and click Finish.

Step 3: log in and update

Select the container and open Console. Log in with root and the chosen password. Then update the system:

apt update
apt upgrade

Useful tips

  • Docker in a container can work (enable Nesting under Options → Features), but some people choose Docker in a VM because it’s more stable and causes fewer issues with updates.
  • Container and VM both use the same backups.
  • With pct enter 101 in the Shell of the server you directly open the terminal of container 101.
  • Many popular programs have ready-made installation scripts. Read our tips and tricks about the helper scripts.
Can't do it yourself? Have an expert come to your home via hulpaanhuis.nl