LinuxcontainersTested on real hardware

Create a Proxmox LXC Container from the CLI

Download a Debian 12 container template with pveam and create an unprivileged LXC with pct — cores, memory, rootfs, DHCP networking, and nesting enabled, started and updated in one pass.

Distrosproxmox, debian
Shellbash
Updated
Script
bash
# ── Run on the Proxmox host. Placeholders: CTID 200, hostname ct01,
# ── local-lvm (rootfs storage). Walkthrough: /blog/proxmox-create-lxc/

# 1. Refresh the template catalog and download Debian 12
pveam update
pveam download local debian-12-standard_12.12-1_amd64.tar.zst

# 2. Create an unprivileged container (nesting on — Docker-ready)
pct create 200 local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst \
  --hostname ct01 \
  --cores 2 --memory 1024 --swap 512 \
  --rootfs local-lvm:8 \
  --net0 name=eth0,bridge=vmbr0,ip=dhcp \
  --unprivileged 1 \
  --features nesting=1 \
  --start 1

# 3. First update inside the container
pct exec 200 -- bash -c "apt update && apt -y dist-upgrade"

echo "Container 200 running. Shell in with: pct enter 200"

Prerequisites

  • Proxmox VE 8.x/9.x host with internet access
  • Root shell on the node

Check the current template name first

Template filenames change as point releases ship. List what’s actually available before downloading, and substitute the exact name into the script:

pveam available --section system | grep debian-12

Notes

  • --unprivileged 1 is the safe default — the container’s root maps to an unprivileged host UID
  • --features nesting=1 costs nothing and lets the container run Docker later (which to choose?)
  • Static IP instead of DHCP: --net0 name=eth0,bridge=vmbr0,ip=10.0.0.50/24,gw=10.0.0.1 (placeholder subnet — use yours; see LXC networking)
  • Full wizard walkthrough with the reasoning: Creating Your First LXC