Why I Stopped Using VMs for Everything
When I started, every service got its own virtual machine. That is the obvious way to get isolation. It works until you run it on small hardware. My on-prem nodes are low-power mini-PCs (Din has an Intel N95, Nayru an N150). A VM for one small service means a whole guest kernel, virtual hardware and a fixed RAM slice. Most of that RAM sits idle.
Now I use three tools and choose by the job. LXC containers are for infrastructure. Docker is for multi-part application stacks. A VM is only for something that truly needs its own kernel or OS. This post is the playbook I follow, with the exact snippets. You can paste it into your own notes or your own AI assistant.
What Each One Is
An LXC is a lightweight Linux machine. It shares the host kernel, but it has a persistent root filesystem and a full init system (systemd). On Proxmox it sits on the normal bridge and gets its own LAN address. So it acts like a small standalone host. Your firewall, DNS and monitoring tools see it as a real device.
Docker works one level up. A Docker container has one main process and no init system. The purpose of Docker is to package an app and its runtime dependencies and to tear it down quickly. Compose groups several containers into a stack. Docker containers usually talk over private virtual networks. They expose only the ports you choose, often behind a reverse proxy.
A VM gets its own kernel and virtual hardware. That is the heaviest option, so I keep it for things that need it. An example is a gateway, or an isolated OS that must not share the host kernel.
| LXC | Docker | VM | |
|---|---|---|---|
| Best for | Infrastructure services (DNS, proxy, monitoring) | Multi-container app stacks, throwaway tests | Anything needing its own kernel or OS |
| Network identity | Own LAN address on the Proxmox bridge | Host port or private bridge, usually behind a proxy | Own LAN address |
| Init / daemons | Full systemd, cron, several daemons fine | One main process | Full OS |
| Backups | Native per-guest Proxmox backups | Volumes and Compose files, or the backup of the LXC/VM it runs in | Native per-guest Proxmox backups |
| Overhead | Small, shares host kernel | Small, shares host kernel | Highest |
| Managed with | Proxmox UI and pct | docker CLI and Compose files | Proxmox UI and qm |
The backup row is more important than it looks. When each service is its own LXC, I can back it up, restore it or roll it back. Nothing else changes.
The Decision Rule
When I add something new, I go through these questions in order. First: does it need its own kernel or a different OS? If yes, it is a VM. If no, use an LXC if it matches one of these:
- It is part of the core network layer (DNS, gateway helpers, network sentry).
- It needs its own LAN address on the main bridge.
- It uses systemd, background daemons, cron, or several tools together.
- It needs specific kernel capabilities, such as raw sockets, without the cost of a VM.
- I want an independent Proxmox backup schedule for it.
Use Docker if one of these is true:
- It is a multi-container stack, like an app plus a cache plus a database.
- It is a short-lived test environment that I want to create and destroy quickly.
- The vendor ships it only as an official container image.
- It sits cleanly behind a reverse proxy and does not need its own LAN address.
The two work well together. A common pattern is a dedicated LXC that runs Docker inside it. I get the Proxmox-level backup and the network identity of the LXC, plus Compose for the stack. That is also why the Docker column of the table says “or the backup of the LXC it runs in”.
I have one more preference. I try to keep databases out of Docker sidecars. Instead, I point apps at a shared PostgreSQL instance. This is not a hard rule for the container choice, but it keeps the stacks simpler.
Give an LXC Raw Network Access
Some tools need low-level network operations. My network sentry is a LAN discovery and alert tool. It scans the subnet with several utilities:
nmapneeds raw sockets for SYN scans and OS fingerprinting.arp-scancrafts raw Ethernet frames to list the MAC addresses on the local segment.fpingsends parallel ICMP echo requests for fast host discovery.- DHCP probes broadcast discovery packets to find rogue DHCP servers.
Unprivileged containers can often do basic scans inside their own network namespace. But some of these features need more. My sentry runs as a privileged LXC with nesting on. These are the relevant lines of its config on the Proxmox host:
# /etc/pve/lxc/<ctid>.conf (relevant lines)
features: nesting=1
# no "unprivileged: 1" line: a privileged container, which keeps raw-socket access
Proxmox sets privileged or unprivileged when you create the container. You use the “Unprivileged container” checkbox, or --unprivileged 0 with pct create. So decide before you build the guest. Do not plan to toggle it later.
With this, I get a bare-metal-style scanner in a container. It idles at a few hundred MB of RAM, and it backs up like any other Proxmox guest. The trade-off is real. Root inside a privileged container is much closer to root on the host. I do it only for this one appliance-style guest, which runs software I trust. Every other container stays unprivileged.
How I Lay Out My Services
I split the services across nodes by role. None of this is exotic, but it shows the rule in practice.
Core network services, as standalone LXCs:
- DNS: AdGuard Home in its own LXC on Nayru, with a static LAN address. It filters the whole network. It also rewrites a wildcard internal domain to the reverse proxy.
- Network sentry: the scanner above, in an LXC with the raw-socket capabilities.
- Reverse proxy and SSO: Nginx Proxy Manager terminates the wildcard certificate. Authelia does the forward-auth login before traffic gets to an app.
Utility and app services, mostly one LXC each:
- A push notification server, with one token per source so the alerts stay separate.
- A local AI chat portal. It connects across the LAN to a separate local AI host.
- A speed test tracker that logs ping, jitter and bandwidth on a schedule.
- A password manager, a home automation hub, an RSS reader, a personal finance app and a GPS timeline server.
Each one is a separate Proxmox guest. So each has its own backup and its own restart. When one has a problem, I reboot only that one.
Route Everything Through Domain Names
One habit saved me the most work. I never use container IPs in bookmarks or client configs. Every app gets a hostname under a wildcard internal domain. A request takes this path:
client -> https://app.lab.example.com
-> DNS: wildcard rewrite to the reverse proxy
-> reverse proxy: checks SSO, then forwards to the container
The scope of the SSO session cookie is the parent domain, not an address. So when I move a container to a new IP, I change exactly one place: the forward hostname/IP field in the reverse proxy. Bookmarks keep working and logins stay valid. I gave my network sentry a new IP this way after I moved it between nodes. Nothing on the client side saw a change.
The same idea lets me move a workload between nodes or move its storage. Clients do not care, as long as the proxy knows the new location.
A Starter Checklist for a New Service
This is the sequence I follow. You can paste it into your own notes. Create the LXC and give it a static address. Add the capabilities only if the tool needs them:
# on the Proxmox node
pct create <ctid> local:vztmpl/<template>.tar.zst \
--hostname <name> \
--net0 name=eth0,bridge=vmbr0,ip=<ip>/24,gw=<gateway> \
--unprivileged 1
pct start <ctid>
For a Docker-based service, I create an LXC like the one above and turn on nesting for it. Then I install Docker inside it:
# on the Proxmox node: allow containers inside the LXC
pct set <ctid> --features nesting=1,keyctl=1
After that, the rest is routine:
- Add a DNS rewrite that points the service hostname at the reverse proxy.
- Add a proxy host with the container address as the forward target. If the app is internal-only, turn on SSO.
- Make sure the guest is in the daily backup job.
- Add a monitor, so I find out if it goes down.
What I Would Do Again, and What to Watch
This split still works for me. These are the things I would repeat:
- Start with an LXC for all infrastructure. Use Docker when the app is a multi-part stack.
- Keep one service per guest where you can. The real payoff is per-guest backups and restarts.
- Use hostnames behind a reverse proxy everywhere.
Things to watch:
- Capability overrides give a container more reach. Keep them to a minimum and write down which guests have them.
- Nested Docker inside an LXC adds a layer to debug. If the stack fails, find out if the problem is the app, Docker or the LXC feature flags.
- Do not choose one technology and use it everywhere. The goal is to match the tool to the layer.
Takeaways:
- Use LXCs for infrastructure that needs its own LAN address, systemd, or specific kernel capabilities.
- Use Docker for multi-container stacks. Use a VM only when you need a separate kernel.
- One service per LXC gives you per-service backups and restarts.
- Keep containers unprivileged by default. Make an exception (privileged) only for a trusted guest that truly needs raw network access, like a LAN scanner.
- Put every app behind a wildcard hostname and a reverse proxy. Then a new IP is a one-field change.
- Docker inside an LXC gives you Compose plus Proxmox-level backups.