LinuxCommandLibrary

podman-run

Create and start containers from images

TLDR

Run a container

$ podman run [image]
copy
Run interactively
$ podman run -it [image] [/bin/bash]
copy
Run in background
$ podman run -d [image]
copy
Run with port mapping
$ podman run -p [8080:80] [image]
copy
Run with volume mount
$ podman run -v [/host/path:/container/path] [image]
copy
Run with name
$ podman run --name [mycontainer] [image]
copy

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 after exit.

CAVEATS

Rootless by default. Docker-compatible flags.

HISTORY

podman run provides container execution as a Docker-compatible command.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community