Blog
Docker and Podman: what changes and how to migrate an application

Docker and Podman: what changes and how to migrate an application

A practical migration path covering images, Compose, rootless permissions, persistent data and testing before switching traffic.

5 min read
#docker
#podman
#vps

An application running in Docker can often run in Podman from the same image. Persistent data, networking and startup after a reboot need closer attention. Start with one service on a separate port so you can verify the result while keeping the working deployment available.

What changes

Docker Engine manages containers through a persistent daemon. Local Podman commands do not require a shared management daemon; an API socket can be enabled for tools that need it. Installing Podman does not migrate Docker images or volumes automatically. Podman architecture and modes.

Both Podman and Docker support rootless operation. Host and container user IDs may map differently, so a writable directory in Docker may need an ownership or mapping adjustment in Podman. Investigate UID/GID mappings before changing permissions; making a directory writable by everyone hides the problem. Docker rootless mode.

Docker and Podman compared

AreaDocker EnginePodman
Container managementThe CLI talks to a persistent Docker daemonThe local CLI does not need a shared management daemon; an API service can be enabled separately
Running without rootRootless mode is available and needs configurationRootless operation is available for regular users with suitable host configuration
Application imagesRegistry images and Dockerfile buildsCommon container image formats, with Dockerfile or Containerfile builds
Composedocker compose with the Compose plugin installedpodman compose calls an external provider; test project compatibility
Linux startupContainer restart policies and Docker service startupQuadlet definitions managed through systemd are an option
Persistent dataDocker has its own containers, volumes and storageSeparate storage; Docker volumes are not imported automatically
First evaluation stepCheck the existing application and deployment toolsTest rootless permissions, Compose and services with a copy of the data

Changing engines does not promise a speed improvement. On a VPS, application compatibility, file permissions and service management are often more useful criteria. References: Docker rootless, Podman, Compose providers and Quadlet.

Install Podman

On Linux, start with the package supplied by your distribution. Its version may differ from the latest upstream release, so check the documentation matching the installed version.

Ubuntu and Debian:

bash
sudo apt-get update
sudo apt-get install podman
podman --version

Fedora:

bash
sudo dnf install podman
podman --version

Follow the project's instructions for Debian, Ubuntu, Fedora or RHEL. There is also a rootless setup guide.

On macOS and Windows, Podman runs Linux containers in a VM. Follow the official instructions for those systems; the example below targets a Linux VPS.

Can Podman run alongside Docker?

Yes, they can coexist on Linux. Install the regular podman package, keep Docker running, and use docker ps and podman ps separately. Each command lists containers managed by its own engine. Installing Podman does not take over Docker containers or volumes.

For this setup, avoid the podman-docker package and an alias docker=podman. That package provides a docker command which invokes Podman and can conflict with an existing Docker CLI. Fedora's podman-docker package description.

Review the package manager's transaction before accepting it. If it proposes removing or replacing components of a working Docker installation, resolve the dependency conflict first. On Debian and Ubuntu, preview the transaction without installing:

bash
sudo apt-get --simulate install podman

Use a free test port, such as 127.0.0.1:18080, while Docker continues to serve the main site. Keep database data directories separate and avoid changing the global DOCKER_HOST for tools that still need Docker. Engine storage remains separate; Podman also separates root and regular-user storage.

Record the current deployment

Keep the Compose file, exact image versions, environment configuration, exposed ports and volume mappings. These commands inspect the current state:

bash
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Ports}}'
docker volume ls
docker inspect app > app-inspect.json

Replace app with your container name. Inspection output can include credentials from environment variables. Restrict access to the file and keep it out of public repositories. Identify deployment tools that use the Docker socket: they may rely on specific API behaviour.

Create a consistent database dump using the database's own backup tools. Copy uploaded files while writes are stopped, or use an application-aware process. Container export does not include mounted volume data. Docker export limitations.

Test Podman independently

After installation, try a disposable web container alongside the running services:

bash
podman --version
podman run --rm -d --name podman-web-check \
  -p 127.0.0.1:18080:80 docker.io/library/nginx:stable
curl --fail http://127.0.0.1:18080/
podman stop podman-web-check

The port is bound to the VPS loopback interface. Use an SSH tunnel to view it remotely. A fully qualified image name avoids registry ambiguity. The example uses stable; pin a tested version or digest for the real deployment. Podman run reference.

For an image available only in local Docker storage:

bash
docker image save -o app-image.tar myapp:release
podman load -i app-image.tar

The archive transfers image layers, while application data needs a separate restore. Podman image loading.

Check your Compose provider

podman compose wraps an external provider such as podman-compose or docker-compose. Test the features your project actually uses, including networks, health checks, secrets, builds and startup dependencies. Compose provider behaviour.

Use a separate project name, different ports and a restored copy of the data. Two application instances should not share a production database if both may run migrations or background tasks independently.

Switch traffic after functional checks

Verify authentication, uploads, background jobs and persistence across a restart. Stop writes to the old instance, transfer the final data changes, then point the reverse proxy at the new port. Keep the old containers and a tested backup until the new deployment has completed a normal workload cycle.

Once the new deployment accepts writes, pointing the proxy back at an older database discards those changes. Plan how to move data back before treating that switch as a rollback. Remove Docker and its old volumes only after recovery has been tested.