Docker Alternatives: When and Why to Switch
In this article
Yes, you can stop using Docker and switch to alternatives like Podman, containerd, LXD, or even plain chroot and systemd-nspawn, depending on your needs. Docker is not the only container runtime, and for some use cases—such as running containers rootless, integrating with systemd, or avoiding a central daemon—other tools are better fits.
Why People Look Beyond Docker
Docker popularized containers by making them easy to build, ship, and run. Its central daemon (dockerd) manages images, networks, and containers, and the docker CLI talks to that daemon. But that architecture has trade-offs:
- Root privileges: The daemon traditionally runs as root, which can be a security concern in multi-tenant environments.
- Single point of failure: If the daemon crashes, all running containers on that host are affected.
- Systemd integration: Docker manages its own networking and process lifecycle, which can conflict with systemd’s supervision model.
- Licensing and governance: Some organizations prefer open-source projects with permissive licenses (e.g., Apache 2.0) over Docker’s current licensing.
These issues don’t affect everyone, but they are common enough that alternatives have grown into mature projects.
What the Alternatives Actually Do
Containers are not a Docker invention. The underlying Linux kernel features—namespaces, cgroups, and layered filesystems—are what make containers work. Docker is a user-friendly wrapper around those features. Alternatives typically do the same wrapping but with different design choices.
- Podman: A daemonless container engine that is largely CLI-compatible with Docker. It can run rootless (without
sudo) and supports pods, a concept borrowed from Kubernetes. - containerd: A core container runtime that manages the full lifecycle of a container, from image transfer to execution. It is used by Docker internally and can be used directly via
ctror higher-level tools likenerdctl. - LXD: A system container manager that runs full Linux distributions (not just single processes) with a focus on density and live migration. It feels more like managing VMs but with container speed.
- systemd-nspawn: A lightweight tool that runs containers or virtual machines using systemd’s own primitives. It is simple, integrates with systemd, and is often used for testing or sandboxing.
- chroot: The oldest form of filesystem isolation. It changes the root directory for a process, but does not isolate processes, users, or networking. It is not a full container solution but can be enough for simple sandboxing.
Comparing Docker and Podman
Podman is the most direct alternative for most Docker users. The CLI is designed to be a drop-in replacement: you can often alias docker to podman and keep using the same commands (podman run, podman build, podman compose). The key differences are architectural:
- Daemon vs. fork/exec: Podman does not run a background daemon. Each command talks directly to the kernel via a library (using
conmonto monitor processes). This makes it easier to integrate with systemd and avoids a single point of failure. - Rootless by default: Podman can run containers as a non-root user, using user namespaces to map root inside the container to your user outside. This reduces the attack surface.
- Pods: Podman supports pods, which are groups of containers that share a network namespace and other resources. This is similar to Kubernetes pods and can ease the transition to orchestration.
- Compatibility: Podman can run Docker images and even build them with
podman build(which uses Buildah under the hood). It also supports Docker Compose viapodman-compose, though not all features are identical.
One practical difference: Podman stores images and containers in a different directory structure (/var/lib/containers for rootful, ~/.local/share/containers for rootless) and uses a different storage driver (usually overlay). If you have existing Docker images, you can export them with docker save and import them into Podman with podman load.
When to Choose containerd or LXD
containerd is not a drop-in replacement for Docker in the sense of a user-friendly CLI, but it is the runtime that Docker itself uses. If you are building a custom container platform, you might use containerd directly. Tools like nerdctl provide a Docker-like CLI for containerd, with support for features like lazy pulling and encrypted images. containerd is also the default runtime in Kubernetes, so if you are deploying clusters, you are already using it.
LXD is different: it runs system containers, which are full operating systems (e.g., Ubuntu, Debian, Alpine) rather than single processes. This makes LXD ideal for running multiple Linux distributions on one host without virtualization overhead. It offers features like snapshots, live migration, and resource limits. LXD is commonly used in cloud infrastructure and development environments where you need a complete OS per container.
Migration Steps and Common Pitfalls
Switching from Docker to an alternative involves more than installing new software. Here are practical steps and pitfalls to expect:
- Inventory your images and volumes. List all images (
docker images) and volumes (docker volume ls). Export images withdocker save -o image.tar image:tagand volumes by copying their data (e.g.,docker run --rm -v volume:/data -v $(pwd):/backup alpine tar czf /backup/volume.tar.gz /data). - Install the new runtime. For Podman, install via your package manager (e.g.,
apt install podmanon Debian/Ubuntu). For containerd, you may need to installcontainerdandnerdctlseparately. - Test with a simple container. Run a basic image like
podman run hello-worldto verify the runtime works. For rootless Podman, check thatslirp4netnsorpastais installed for networking. - Migrate your compose files. If you use Docker Compose, try
podman-composeorpodman play kubeto convert YAML to Kubernetes pods. Note that some Compose features (likedepends_onwith conditions) may not be fully supported. - Adjust networking and storage. Podman uses CNI or Netavark for networking, which may require different port mappings or DNS settings. Check your firewall rules, as rootless containers use a different IP range.
- Update scripts and CI/CD. Any script that calls
dockerwill need to callpodman(or use an alias). In CI, ensure the runner has the new runtime installed and that permissions are set for rootless operation if needed.
Common pitfalls include missing conmon (Podman’s container monitor), SELinux/AppArmor denials, and differences in image naming (e.g., Docker Hub vs. Quay.io). Also, rootless containers may have limitations with certain kernel features like overlayfs—you might need to use fuse-overlayfs as a storage driver.
Costs and Licensing Considerations
Docker is free for personal and small business use, but Docker Desktop for Windows/macOS requires a paid subscription for larger companies (over 250 employees or over $10M in revenue). This has driven some organizations to seek alternatives. Podman, containerd, and LXD are open-source under Apache 2.0, which allows free commercial use without such restrictions. However, “free” does not mean zero cost: you may need to invest time in migration, retraining, and updating infrastructure. For example, if you rely on Docker’s built-in Swarm mode for orchestration, you will need to adopt Kubernetes or another orchestrator, which has its own operational overhead.
Security and Safety Considerations
Containers share the host kernel, so isolation is not as strong as VMs. This is true regardless of the runtime you choose. When evaluating alternatives, consider:
- Rootless operation: Podman and containerd (with
nerdctl) support rootless modes, which reduce the risk of a container breakout granting root on the host. - User namespaces: Tools like LXD use user namespaces by default, mapping container root to a non-root host user.
- Seccomp and AppArmor/SELinux: Most runtimes apply security profiles by default. Check that your alternative enables these; for example, Podman applies a default seccomp profile, and LXD uses AppArmor on Ubuntu.
- Image signing: Podman supports
podman image trustto enforce signature verification, which is useful for supply chain security.
Remember that no container runtime is inherently “safe” if you run untrusted workloads. Always update your host and runtime, and run containers with the least privileges needed.
Frequently Asked Questions
Can I use Podman as a drop-in replacement for Docker?
For most commands, yes. Podman’s CLI is designed to be compatible with Docker. You can alias docker to podman and run run, build, pull, and push commands similarly. However, some Docker-specific features like docker swarm are not available, and Compose support is not 100% identical.
Do I need to change my Docker images to use Podman?
No. Podman can run standard OCI images, which is what Docker uses. You can pull images from Docker Hub or any registry and run them with Podman. If you have images stored locally, export them with docker save and import with podman load.
Is containerd easier than Docker?
containerd is lower-level and not designed as a user-friendly CLI. It is more of a building block for platforms like Kubernetes. If you want a Docker-like experience on top of containerd, use nerdctl, which provides a similar interface.
What is the difference between system containers and application containers?
System containers (like LXD) run a full init system and multiple processes, similar to a VM. Application containers (like Docker and Podman) typically run a single process. System containers are useful when you need to run an entire OS, while application containers are better for microservices.
Will my Docker Compose files work with Podman?
Mostly, but not always. You can use podman-compose or convert Compose files to Kubernetes with podman play kube. Some Compose features like depends_on with healthchecks may not be fully supported, so test your stack thoroughly.
Is it worth switching if Docker works fine for me?
If Docker meets your needs and you don’t have licensing or security concerns, there is no urgent reason to switch. However, if you want rootless operation, better systemd integration, or to avoid the Docker daemon, trying Podman is low-risk since it is mostly compatible.