What is LXC and how does it differ from Docker and a VM
Published on 2026-09-12 by frfrand
System containers vs application containers: what changes between LXC, Docker and a virtual machine, why so many VPSs use LXC and how to know which one you have.

Short answer: LXC and Docker use the same kernel pieces (namespaces and cgroups), but LXC creates system containers, which behave like a complete Linux machine with init, services, and users, and Docker creates application containers, designed for a single process and to be recreated from an image. A virtual machine, on the other hand, has its own kernel. To find out which one you are in, run systemd-detect-virt.
LXC and Docker use exactly the same Linux kernel functions: namespaces to isolate and cgroups to limit resources. The difference is not down there, it is in what they set out to do with that.
System container vs application container
LXC creates a system container. Inside there is something that behaves like a complete Linux machine: an init process, services, multiple users, logs, scheduled tasks. You log in via SSH and work as on any server.
Docker creates an application container. Inside ideally runs a single process: your web server, your database, your worker. It has no init, no users, and is not meant to live inside.
That difference in purpose explains all the others.
What it implies in practice
The lifecycle. An LXC container is a pet: it is created, updated, maintained for months. A Docker container is cattle: it is destroyed and recreated from the image every time there is a change.
The state. In LXC, the state inside is normal and expected. In Docker, everything that needs to survive goes in a volume, because the container is discarded.
The image. Docker builds immutable images from a recipe file, versioned and distributable. LXC starts from a distribution template and then you configure it like any machine.
Why this affects you even if you don't use LXC
Because many cheap VPS are LXC containers, not virtual machines. And that has consequences worth knowing before choosing:
- You share the host kernel. You cannot load modules, you cannot use a different kernel version, and some tools that need deep access do not work.
- Isolation is lower than with a virtual machine, because there is only one kernel.
- In return, it is usually cheaper and starts faster.
How to know which one you are in:
systemd-detect-virt
It returns "kvm" if you are in a virtual machine, "lxc" if you are in a container of that type, "none" if it is bare metal.
That command is worth running on any new server, because it changes what you can do and what you can expect.
When to choose each thing
LXC (or managers built on top of it, such as LXD or Incus, its community fork) makes sense when you want many machine-like environments on the same physical server, with high density and without the overhead of a full operating system for each one. It is a frequent option in labs and in own infrastructure.
Docker makes sense for deploying applications: the image brings the exact versions of everything, what you tested is literally what runs, and the ecosystem of tools around it is huge.
A virtual machine makes sense when isolation really matters: different clients, workloads you don't trust, or need for your own kernel.
At ArduMaker, each VPS is exactly a system container: an unprivileged LXD container with Ubuntu, root, systemd and the CPU and memory limits of its plan, on shared physical hosts. If you run systemd-detect-virt inside, you will see lxc. That is why the consequences above apply: you share the host kernel and you cannot load modules. Inside you can install Docker from the panel (the VPS is born with the nesting Docker needs, without being privileged), and so you have application containers inside a system container.
Is Docker inside a VPS the same as a VPS?
No: Docker packages and runs applications sharing its host's kernel; a VPS provides a system environment with resources and isolation assigned according to the provider's infrastructure. Both can be combined.
In ArduMaker you can create a VPS and run Docker containers inside it. For example, an API, Redis, and a worker can live in separate containers; you will need to plan volumes, networks, image updates, and backups. A container that is deleted without a persistent volume should not be considered permanent storage.
Frequently asked questions
Is LXC the same as Docker? No. They use the same kernel functions, but LXC runs a complete system and Docker, an application packaged in an image.
Is an LXC container a virtual machine? No: it shares the host's kernel. That is why it starts faster and is lighter, and also isolates less.
How do I know if my VPS is a container or a virtual machine? With systemd-detect-virt: kvm indicates a virtual machine, lxc a system container and none dedicated hardware.
Can I use Docker inside an LXC container? Yes, if the container has nesting enabled. This is what an ArduMaker VPS comes with.
Related: Docker: when it's worth it · What is a VPS.