LinuxCommandLibrary

podman-compose

Run multi-container applications using Compose files

TLDR

List all running containers

$ podman-compose ps
copy

Create and start all containers in the background using a local docker-compose.yml
$ podman-compose up [[-d|--detach]]
copy

Start all containers, building if needed
$ podman-compose up --build
copy

Start all containers using an alternate compose file
$ podman-compose [[-f|--file]] [path/to/file.yaml] up
copy

Stop all running containers
$ podman-compose stop
copy

Remove all containers, networks, and volumes
$ podman-compose down [[-v|--volumes]]
copy

Follow logs for a container (omit all container names)
$ podman-compose logs [[-f|--follow]] [container_name]
copy

Run a one-time command in a service with no ports mapped
$ podman-compose run [service_name] [command]
copy

SYNOPSIS

podman-compose [-f FILE] [-p PROJECT_NAME] [options] COMMAND [args]

PARAMETERS

-f, --file FILE
    Compose file name(s); supports lists (default: docker-compose.yml, docker-compose.override.yml)

-p, --project-name NAME
    Project name (default: current directory basename)

--env-file PATH
    Environment variable file(s); supports lists

--log-level LEVEL
    Logging level: debug|info|warning|error|critical (default: info)

--verbose
    Increase output verbosity

-v, --version
    Print version and exit

-h, --help
    Display help message

--compatibility
    Enable legacy v2 behavior for backward compatibility

--profile NAME
    Specify profiles to enable

DESCRIPTION

podman-compose is a Python tool that provides Docker Compose compatibility for Podman, enabling users to manage multi-container applications defined in standard docker-compose.yml files without Docker. It parses Compose files (versions 2.x and 3.x up to 3.8), translates them into Podman constructs like pods, containers, networks, volumes, and secrets.

Services are typically deployed in a single Podman pod with an infra container for networking, mimicking Docker's behavior while leveraging Podman's daemonless, rootless architecture. Supports core commands including up, down, start, stop, restart, ps, logs, exec, build, scale, and more.

Key advantages: secure rootless execution, no daemon overhead, integration with Podman ecosystem. Ideal for migrations or hybrid environments. Limitations exist in advanced features like Swarm mode, certain build contexts, or Docker-specific extensions. On macOS/Windows, it uses Podman machine VMs.

CAVEATS

Not 100% docker-compose compatible; missing Swarm, some build/Dockerfile features.
Requires Podman ≥ 3.2.
Containers share pods, altering port binding/isolation.
Builds use buildah (slower than Docker BuildKit).

COMMON SUBCOMMANDS

up [options]: Create/start services.
down: Stop/remove services/volumes.
ps: List containers.
logs: View output.
exec: Run command in service.

INSTALLATION

pip install podman-compose
Or via distro packages: dnf install podman-compose, apt install podman-compose.

EXAMPLE

podman-compose -f docker-compose.yml up -d
Deploys services detached using specified file.

HISTORY

Developed 2020 by Podman team (containers/podman-compose GitHub repo) to bridge Compose gap pre-native Podman support. Evolved from compose2podman; now supports Compose spec 3.8+. Actively maintained for migration workflows.

SEE ALSO

podman(1), podman-pod-create(1), podman-network-create(1), docker-compose(1)

Copied to clipboard