Docker Run Command Builder
Build a correct docker run command without memorizing flags. Fill in the form below and the full command is generated live, with shell-safe quoting for every value that contains spaces or special characters. Everything runs in your browser — nothing is uploaded.
Command options
nginx:latest or postgres:16.Generated command
# Fill in the image name to generate a command
Flag reference
| Flag | Meaning |
|---|---|
-d | Runs the container in the background (detached) and prints its ID. |
-i | Keeps standard input open, even when not attached — use for interactive sessions. |
-t | Allocates a pseudo-TTY, giving you a proper terminal inside the container. |
--name | Gives the container a fixed name so it is easy to start, stop or inspect later. |
-p host:container | Publishes a container port to a port on the host, e.g. -p 8080:80. |
-v host:container | Mounts a host path inside the container; add :ro for read-only access. |
-e KEY=VALUE | Sets an environment variable inside the container. |
--restart | Controls when Docker restarts the container: no, always, unless-stopped or on-failure. |
--network | Connects the container to a network mode such as bridge, host or none. |
| command | Any text after the image name overrides the default command of the image. |
How to use
- Type the image name, e.g.
nginx:latest— it is the only required field. - Choose detached mode, interactive or TTY, and optionally a container name, restart policy and network mode.
- Add port mappings, volume mounts and environment variables with the "Add" buttons; remove any row with the delete button.
- The full command updates live in the output box, with values containing spaces quoted safely.
- Click "Copy command" and paste it into your terminal. Click "Load example" to see a working nginx setup.
Frequently asked questions
What does the Docker Run Command Builder do?
It turns a simple form into a ready-to-paste docker run command. You fill in the image, ports, volumes, environment variables and options, and the full command is built live.
Is my data sent anywhere?
No. The command is generated fully in your browser; nothing is uploaded or stored.
Does the builder quote values safely?
Yes. Any value that contains spaces or shell-special characters is wrapped in quotes with special characters escaped, so the command is safe to paste into a terminal.
Which docker run flags does it support?
Detached mode (-d), interactive and TTY (-i, -t), container name (--name), port mappings (-p), volumes (-v), environment variables (-e), restart policy (--restart), network mode (--network) and a trailing command override.
What happens if the image name is empty?
The output area shows a validation message instead of a command, because docker run requires an image name to work.