Free Docker Run to Compose Converter
Paste a docker run command, get a clean docker-compose.yml back.
Your docker run command
Something not working?
Tell us what went wrong — it helps us fix the tool. Only what you type below is sent; your commands never leave your device.
Need more power? Meet Docker Run to Compose Pro
One-time payment. Yours forever. No subscription.
| Feature | Free | Pro |
|---|---|---|
| Convert one docker run command | Yes | Yes |
| Ports, env vars, volumes, restart, network | Yes | Yes |
| Copy & download docker-compose.yml | Yes | Yes |
| Batch: whole stack of commands → one file | — | Yes |
| Multi-service stacks with depends_on | — | Yes |
| Saved conversion presets | — | Yes |
| Ads | Shown on page | Ad-free |
| Updates | — | Lifetime free updates |
Frequently asked questions
Is my docker run command uploaded anywhere?
No. The command is parsed entirely inside your browser. That matters because run commands often contain production passwords (-e POSTGRES_PASSWORD=...), API keys and private hostnames — none of it ever leaves your device.
Which docker run flags are converted?
Container name, ports (-p, including IP-bound and UDP mappings), environment variables (-e), volumes (-v, named and bind), restart policy, network, user, working directory, entrypoint, labels, hostname and env files. Flags with no Compose equivalent (--rm, --privileged, --cap-add) are listed as warnings so you can add them by hand.
Do I need the version line in docker-compose.yml?
Not with modern Docker Compose (v2), which ignores it — the converter leaves it out by default. Tick the checkbox if you run an older Compose v1 setup that still expects version: '3.8'.
What happens to named volumes?
A volume like pgdata:/var/lib/postgresql/data is detected as a named volume and declared in a top-level volumes: block, so docker compose up creates it automatically. Bind mounts (/host/path:/path) are passed through unchanged.