podman-run

Create and start containers from images

TLDR

Run a container
$ podman run [image]
Run interactively
$ podman run -it [image] [/bin/bash]
Run in background
$ podman run -d [image]
Run with port mapping
$ podman run -p [8080:80] [image]
Run with volume mount
$ podman run -v [/host/path:/container/path] [image]
Run with name
$ podman run --name [mycontainer] [image]
Run with environment variable
$ podman run -e [VAR=value] [image]
Run and auto-remove on exit
$ podman run --rm -it [image] [command]
Run with custom network
$ podman run --network [network_name] [image]

SYNOPSIS

podman run [options] image [command]

DESCRIPTION

podman run creates and starts a new container from a specified image. It is the primary command for launching containers, supporting interactive sessions (-it), background execution (-d), port mapping (-p), volume mounts (-v), and environment variables (-e).The --rm flag automatically removes the container when it exits. The --name option assigns a human-readable name. By default, Podman runs containers rootlessly without requiring a daemon, making it a drop-in replacement for docker run.

PARAMETERS

IMAGE

Container image.
-it
Interactive terminal.
-d, --detach
Run in background.
-p, --publish PORT
Port mapping.
-v, --volume MOUNT
Volume mount.
--name NAME
Container name.
-e, --env VAR
Environment variable.
--rm
Remove container after exit.
--network MODE
Set network mode (bridge, host, none, or custom network name).
--restart POLICY
Restart policy (no, on-failure[:max], always, unless-stopped).
-w, --workdir DIR
Working directory inside the container.
--user USER
Run as specified user (name or UID[:GID]).
--cap-add CAP
Add Linux capabilities.
--cap-drop CAP
Drop Linux capabilities.
--entrypoint CMD
Override image entrypoint.
--label KEY=VALUE
Set metadata label on container.

INSTALL

sudo apt install podman
sudo dnf install podman
sudo pacman -S podman
sudo apk add podman
sudo zypper install podman
brew install podman
nix profile install nixpkgs#podman

CAVEATS

Runs rootless by default without requiring a daemon. Most Docker CLI flags are compatible. Some features (e.g., certain network modes) may behave differently in rootless mode.

HISTORY

podman run was introduced as part of the Podman project by Red Hat, providing a daemonless, Docker-compatible container runtime.

SEE ALSO

podman(1), podman-exec(1), docker-run(1)