
Proxmox Virtual Environment (VE) is an open-source virtualization platform based on Debian that runs virtual machines and Linux Containers (LXC) on the same server. A container shares the host's kernel but keeps its own processes, network interfaces, and file system. It has no guest kernel to boot, so it starts in seconds and needs memory only for the applications that it runs. Proxmox VE manages containers through its web interface and the Proxmox Container Toolkit (pct) on the command line.
This guide explains how to run an unprivileged Debian 13 container on a Vultr Bare Metal server with Proxmox VE. It covers a private NAT network for internet access, creating and managing containers with pct, DHCP for additional containers, port forwarding to a container service, extra storage, and the controls that isolate containers from the host.
Before you begin:
Proxmox VE runs two types of guests. A Kernel-based Virtual Machine (KVM) guest boots its own kernel on virtual hardware, so it can run Windows, FreeBSD, or any Linux distribution. An LXC container is a group of isolated processes on the host's kernel. It skips the virtual hardware and the second kernel, but it can run only Linux, and its isolation depends on the host kernel.
Proxmox VE builds each container from a template, a compressed root file system of a minimal Linux distribution. The Proxmox VE Appliance Manager (pveam) downloads templates from an online catalog and saves them to storage with the Container template content type. Container root disks need storage with the Container content type. On a default installation, local holds templates and local-lvm holds root disks.
Check the Proxmox VE version.
Verify that the output starts with pve-manager/9.
List the storage that accepts container templates.
Verify that the output lists local.
List the storage that accepts container root disks.
Verify that the output lists local-lvm or another storage with at least 20 GB available. The containers in this guide use up to 17 GB of storage, and storage names may vary depending on your installation.
Directory storage that you add in the web interface, such as data1 from the installation guide, accepts only Disk image content by default. It appears in this list after you enable the Container content type on it.
Refresh the template catalog.
Find the Debian 13 template in the catalog.
Verify that the output lists a debian-13-standard template for amd64. This guide uses debian-13-standard_13.6-1_amd64.tar.zst. If the catalog has a newer version, use its filename in the following steps.
Download the template to the local storage.
Verify that the output shows checksum verified.
List the templates on the local storage.
Verify that local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst appears in the output. The pct create command takes this full volume ID as its template.
A Bare Metal server has one public IPv4 address, and the Vultr network does not assign addresses to container MAC addresses. A container connected to the public bridge vmbr0 therefore never receives an IP address. A private bridge solves this. vmbr1 gets its own subnet, 10.10.10.0/24, and the host acts as its gateway, using NAT to send container traffic out through vmbr0 with the server's public address.
Back up the network configuration.
If an error in the file breaks the network, use the backup to restore the working configuration.
Open the network configuration file.
Add the following bridge definition to the end of the file. Do not change the existing vmbr0 section.
Save and close the file.
In this configuration:
address: Assigns the host 10.10.10.1, the gateway address of the 10.10.10.0/24 subnet.bridge-ports none: Creates a bridge with no physical network card.post-up: Rewrites the source address of outbound container traffic to the server's public address. The -C check adds the rule only if it does not exist yet, so reloading the network does not create duplicate rules.post-down: Deletes the NAT rule when the bridge stops.Enable IPv4 forwarding at boot.
Forwarding lets the host route packets between vmbr1 and vmbr0. Files in /etc/sysctl.d/ apply at every boot.
Apply the forwarding setting now.
Verify that the output shows net.ipv4.ip_forward = 1.
Apply the network configuration.
Check the bridge address.
Verify that the output lists 10.10.10.1/24 for vmbr1.
Allow routed traffic from the private bridge to the public bridge.
The Uncomplicated Firewall (UFW) enabled by the installation guide drops routed traffic unless a route rule allows it. UFW allows ping traffic by default, so without this rule, containers can ping external hosts but cannot resolve domain names or download packages.
An unprivileged container runs without root privileges on the host, even for processes that run as root inside it. If a process escapes the container, it has only the permissions of an ordinary user on the host.
Debian 13 includes systemd 257, which isolates many of its services with features that containers can use only when nesting is enabled. The --features nesting=1 option enables it. Without nesting, pct prints WARN: Systemd 257 detected. You may need to enable nesting., and several systemd mount units fail inside the container.
Check that container ID 101 is available.
Verify that the output is 101. If the output reports that the ID is already in use by another container or a virtual machine, run sudo pvesh get /cluster/nextid to get the next available ID, and use that ID in place of 101 in the rest of this guide.
Create the container.
The container gets one CPU core, 1 GB of memory, 512 MB of swap, and an 8 GB root disk on local-lvm. Its eth0 interface connects to vmbr1 with the static address 10.10.10.10 in the 10.10.10.0/24 subnet, and it uses 10.10.10.1 as its gateway and 1.1.1.1 as its DNS server. The --onboot 1 option starts the container automatically when the host boots.
If pveam list local shows a newer template, or your root disk storage is not local-lvm, change those values in the command.
Review the container configuration.
Verify that hostname, features, net0, rootfs, and unprivileged match the options in the pct create command. The configuration file is /etc/pve/lxc/101.conf.
Start the container.
Verify that the command prints no warnings.
Check that the container is running.
Verify that the output shows status: running.
Ping the private gateway from the container.
Verify that the output shows 0% packet loss.
Update the container's package index to test DNS resolution and internet access.
Verify that the package lists download without Temporary failure resolving errors. If that error appears, run sudo ufw status numbered and check that the route rule from the previous section is listed.
pct enter attaches a root shell to a running container from the host, so you can work inside the container without an SSH server or a reachable IP address.
Open a shell in the container.
You are now working inside the container as root. Run the remaining commands in this section at the # prompt.
Check the Debian version.
Verify that the output shows VERSION_ID="13".
Check the systemd state.
Verify that the output shows running. If it shows degraded, run systemctl --failed to list the failed units.
Check the size of the root file system.
Verify that / shows a size of about 8 GB.
Set a root password for console logins, if you need them.
Enter the new password at both prompts. pct enter does not ask for this password, but the login console does.
Exit the container shell.
To use the login console later, run sudo pct console 101 on the host and log in as root.
pct reads and writes the same container configuration as the Proxmox VE web interface, so a change made with one tool appears in the other. Some resource changes apply immediately to a running container, and others remain pending until the container restarts.
List the containers on the host.
Verify that container 101 appears with the status running and the name debian-lxc.
Run a command in the container without opening a shell.
The output shows the container's hostname, debian-lxc. Everything after -- runs inside the container.
Increase the container's resources to two CPU cores and 2 GB of memory.
The memory limit applies immediately. The core count stays pending until the container restarts.
Reboot the container to apply the core count.
Check the number of CPU cores in the container.
Verify that the output shows 2.
Shut down the container.
pct shutdown asks the container to stop its services cleanly. Use sudo pct stop 101 only when a container does not respond to a shutdown command, because it ends all processes immediately.
Start the container again.
Check that the container starts when the host boots.
Verify that the output shows onboot: 1, which the --onboot 1 option set during creation. To stop the container from starting at boot, run sudo pct set 101 --onboot 0.
Container 101 has a static address. Static addresses work for a few containers, but you must manually track each address as you add more. A DHCP server on vmbr1 automatically assigns IP addresses, the default gateway, and DNS servers. dnsmasq is a small DHCP and DNS server from the Debian repositories. The configuration in this section uses only its DHCP function, with an address pool from 10.10.10.100 to 10.10.10.200 that excludes the static address 10.10.10.10.
Two DHCP servers on one bridge can assign the same address to two containers. If Proxmox VE Software-Defined Networking (SDN) or another service already provides DHCP on vmbr1, skip this section.
Install dnsmasq on the host.
Create a dnsmasq configuration file for the private bridge.
Add the following settings:
Save and close the file.
port=0 disables the DNS server, so dnsmasq handles only DHCP. interface=vmbr1 and bind-interfaces restrict it to the private bridge, so it never answers DHCP requests on the public network. dhcp-range sets the address pool and a 12-hour lease, and the dhcp-option lines send containers the gateway 10.10.10.1 and the DNS servers 1.1.1.1 and 8.8.8.8.
Check the configuration for syntax errors.
Verify that the output shows syntax check OK.
Allow DHCP requests from the private bridge through UFW.
Containers send DHCP requests to UDP port 67 on the host. UFW blocks incoming traffic that no rule allows, so without this rule the requests never reach dnsmasq.
Restart dnsmasq to load the configuration.
Check the service status.
Verify that the output shows active (running).
Create a test container that requests its address through DHCP.
The ip=dhcp setting makes the container request an address each time it starts. The test container is smaller than container 101, with 512 MB of memory and a 4 GB root disk.
Start the test container.
Display the test container's IPv4 address.
Verify that eth0 has an address between 10.10.10.100 and 10.10.10.200. If eth0 has no IPv4 address, run sudo journalctl -u dnsmasq --no-pager to check the dnsmasq log. A log with no DHCPDISCOVER entries means that UFW is still blocking the requests.
Display the test container's routes.
Verify that the default route points to 10.10.10.1.
Shut down the test container.
Delete the test container, which the rest of this guide does not use.
The --purge option also removes the container from backup and replication jobs and from high availability settings.
Containers on vmbr1 have private addresses, so clients on the internet cannot reach them directly. To publish a container service, the host forwards a port on the server's public address to the container with a destination NAT (DNAT) rule. The Nginx reverse proxy from the installation guide already listens on ports 80 and 443 on the host, so this example forwards port 8080 to port 80 in the container.
Install Nginx in the container.
Check that Nginx is running in the container.
Verify that the output shows active.
Open the network configuration file.
Add the following lines to the end of the vmbr1 section, after the post-down line. Save and close the file.
In this configuration:
post-up: Forwards TCP connections that reach port 8080 on vmbr0 to port 80 on 10.10.10.10. It uses the same -C check as the NAT rule.post-down: Deletes the forwarding rule when the bridge stops.Apply the network configuration.
Running containers stay attached to the bridge during the reload.
List the NAT rules for incoming traffic.
Verify that the output lists a DNAT rule for destination port 8080.
Allow the forwarded traffic through UFW.
Like outbound container traffic, forwarded connections need a UFW route rule. These connections do not pass through the host's input rules, so sudo ufw allow 8080 does not allow them.
Request the page from your local computer. Replace SERVER_IP with your server's public IP address.
Verify that the output contains Welcome to nginx!.
A container's root disk holds its operating system and installed packages. You can increase its size while the container runs, but you cannot reduce it. For application data, attach a mount point: a separate volume that Proxmox VE creates, lists in the container configuration, and can include in container backups. You can resize a separate data volume without changing the root disk.
Add 4 GB to the container's root disk.
pct resize expands the volume and the file system inside it in one step, so the container keeps running.
Check the new size of the root file system.
Verify that / shows a size of about 12 GB.
Attach a 5 GB volume to the container at /srv/data.
local-lvm:5 allocates a new 5 GB volume on local-lvm, and mp=/srv/data sets its path inside the container. backup=1 includes the volume in vzdump backups of the container.
Reboot the container to mount the new volume.
Check the mounted volume.
Verify that /srv/data shows a size of about 5 GB.
Every container shares the host's kernel, so a kernel bug or an unsafe container setting can expose the host to the processes inside a container. Unprivileged containers limit what an escaped process can do, and Proxmox VE also uses the following kernel features:
/proc and /sys.pct, so one container cannot use the resources that other containers need.root user to user ID 100000 on the host.Apply the following practices to every container that you run.
Check that the container is unprivileged and review its features.
Verify that the output shows unprivileged: 1 and features: nesting=1. Nesting exposes parts of the host's /proc and /sys to the container, so enable it only for containers that need it, such as Debian 13 with systemd 257.
Back up the container before major changes.
Verify that the output ends with Backup job finished successfully. In snapshot mode, Proxmox VE pauses the container for about a second to take a storage snapshot, and the container keeps running while the backup completes. The archive includes /srv/data because its mount point has backup=1.
Also follow these guidelines:
sudo ufw status numbered to review the rules before you change them. The Proxmox VE firewall is disabled by default, so UFW on the host is the only firewall in this setup.Your Vultr Bare Metal server now runs an unprivileged Debian 13 container on a private NAT network. The container reaches the internet through the host, serves Nginx on the server's public address on port 8080, and stores application data on a separate volume that its backups include. UFW allows only the routed traffic and the ports that you opened, and dnsmasq is ready to assign addresses to additional containers. For more information, refer to the Proxmox VE Linux Container documentation.
0 Comments
Be the first to comment and share your perspective with the community.