Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 37 ยท Getting Started

Podman vs Docker: Differences and Migration

Compare Podman and Docker fairly: architecture, rootless mode, pods, systemd, compose, the docker alias and socket, and a checklist for moving existing projects.

Most people arrive at Podman from Docker, so the first question is "what is different, and will my things still work?" For everyday use the answer is mostly "almost nothing is different, and what is different is on purpose". The command line was designed to be compatible: podman run, podman ps, podman build, podman pull and many more take the same options as the commands you know.

This lesson gives a fair comparison, shows the compatibility tricks, lists the real differences you will hit, and ends with a migration checklist for an existing project.

The big architectural differences

Topic Docker Engine Podman
Process model client talks to a long-running daemon (dockerd) no daemon; each command forks, with conmon per container
Default privileges daemon runs as root; rootless mode is an option rootless is a first-class mode, and rootful is the option
Pods not a concept (Swarm and Compose use services) built in, like Kubernetes pods
System services restart policies handled by the daemon integrates with systemd, including Quadlet files
Kubernetes YAML not built in podman kube generate and podman kube play
Image builds BuildKit Buildah library; Containerfile or Dockerfile
Clustering Swarm mode none; use Kubernetes
Compose docker compose plugin podman compose wrapper, or the podman-compose project

It is not that one of them is "secure" and the other is not. Docker also supports a rootless mode now. The practical difference is what you get by default and how naturally the tool fits a normal Linux system without a privileged daemon.

Compatibility tricks

Because the commands match, you can often switch without touching scripts:

Terminal
alias docker=podman

That one line makes docker run ... call Podman. On Fedora and related systems, the package podman-docker goes one step further: it installs a real docker command that runs Podman, and it provides the /var/run/docker.sock path pointing at Podman's API socket.

Terminal
sudo dnf install podman-docker
systemctl --user enable --now podman.socket

Podman can expose a Docker-compatible HTTP API through a socket. Tools that normally talk to the Docker daemon, such as some IDE plugins, docker-compose and test libraries, can be pointed at it with an environment variable:

Terminal
export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"

The socket is started on demand by systemd (socket activation), so it costs nothing when not in use. The compatible API covers the common calls, but it is not a copy of everything the Docker daemon does.

Differences you will actually notice

1. Registries and short names. docker pull nginx assumes Docker Hub. Podman asks which registry, because "nginx" could be on several. On first use it may prompt you to choose, or fail when no terminal is available. The cure is to write the full name, docker.io/library/nginx. See Pulling and Searching Images.

2. Separate storage per user. Your rootless images and the images that sudo podman sees are different sets. Docker has one shared store inside the daemon.

3. Ports below 1024. Rootless users cannot bind them by default. Publishing -p 80:80 fails until an administrator changes a kernel setting, or you use a high port like 8080.

4. File ownership in volumes. In rootless mode, container UID 0 is your user, and other container users map to higher host IDs. Files in a bind mount can look owned by strange numbers. Volume Permissions and Backups shows how to handle that.

5. SELinux labels. On Fedora, RHEL and similar systems, bind mounts need :z or :Z to be readable by the container. Docker documents the same flags, but Podman users meet SELinux far more often because Podman's main audience runs those distributions. See SELinux, Seccomp and Capabilities.

6. No daemon means no auto-restart by itself. Docker's daemon restarts containers with --restart always after a reboot. Podman accepts the same flag, but nothing is watching, so the real answer is systemd: a user service or a Quadlet file (both come later in the course, in chapters 6 and 8).

7. Compose files. Many Compose files work as they are, but a few features that depend on the Docker daemon do not, such as Swarm-specific deploy: keys and some BuildKit extras.

A stand-in migration checker

Here is a little scanner that reads a docker run command and flags the places where Podman needs attention. It is a stand-in written in JavaScript, not an official tool, and it only knows the rules from this lesson.

JS Stand-in: migration hints for a docker command

Press Run (or Ctrl + Enter) to see the console output here.

No output.

What stays the same

A lot, and that is why the move is easy:

  • Image formats: OCI and Docker v2 images are both understood, and images from Docker Hub run in Podman.
  • Command names and most flags: run, exec, logs, inspect, cp, build, push, login, network, volume.
  • Dockerfile syntax: Podman builds a Dockerfile as is, and also accepts the neutral name Containerfile.
  • Environment variables, health checks, resource limits, user, working directory and entrypoint.

What does not carry over: Docker Swarm, Docker Desktop's built-in extensions, and tools that need the real dockerd internals.

A migration checklist

  1. Install Podman, run podman run --rm quay.io/podman/hello to check it.
  2. Try alias docker=podman for a day and note what breaks.
  3. Change image names to fully qualified ones.
  4. Add :z/:Z to bind mounts on SELinux machines, and move to high ports.
  5. Replace restart policies for servers with systemd or Quadlet.
  6. Test Compose files with podman compose, or convert to pods and Quadlet later.
  7. Point CI and tools that need an API at podman.socket.
  8. Move images you need with podman pull again (the stores are separate), or use podman image scp and podman save/load to transfer.

You do not have to choose forever. Both tools can be installed on the same machine, and many teams use Docker on laptops and Podman on servers, because the images and Dockerfiles are shared.

Another stand-in: command mapping

This one prints the Podman equivalents for common commands. In almost every row the answer is "the same words", which is the point.

JS Stand-in: command mapping table

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which statement about Podman and Docker is accurate?

    Both follow OCI standards and share most command-line options. The main difference is the daemonless, rootless-first design.
  2. 2. What does alias docker=podman achieve?

    An alias just rewrites the command. It works because the command lines are compatible.
  3. 3. Why does docker run --restart always not survive a reboot under Podman by itself?

    Nothing keeps running between boots in Podman. Use systemd units or Quadlet files to start containers at boot.
  4. 4. A tool needs the Docker API. What does Podman offer?

    podman.socket (socket activation) serves a compatible API, and DOCKER_HOST can point tools to it.

Summary

  • Podman keeps the Docker command line and image formats, but drops the daemon and defaults to rootless.
  • alias docker=podman and the podman-docker package make migration easy.
  • Watch for short names, separate storage, low ports, volume ownership, SELinux labels and restarts.
  • Podman adds pods, Kubernetes YAML and systemd integration; it has no Swarm.
  • Follow a short checklist and test Compose files before relying on them.

Next: Podman Architecture