Online Tool Store Online Tool Store

Docker Run to Compose

Paste a docker run command and get an equivalent docker-compose.yml, with ports, environment variables, and volumes mapped correctly. Runs entirely in your browser.

🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.

Example shown — paste your own docker run command.

docker-compose.yml

 

How it works

  1. Paste a docker run command.
  2. Its flags are parsed and mapped to their docker-compose.yml equivalents.
  3. Copy the generated YAML into a docker-compose.yml file.

FAQ

Which docker run flags are supported?

--name, -p/--publish, -e/--env, -v/--volume, --restart, and -d/--detach (compose runs detached via `up -d`, so it has no direct field). Unrecognized flags are skipped.

Does it support multiple containers at once?

Not yet — paste one docker run command at a time and combine the resulting services blocks yourself if you need a multi-container file.

Is my command sent anywhere?

No — parsing and conversion both happen locally in your browser.

Why is my container name always "app" if I don't set --name?

Docker itself would generate a random name in that case — this tool uses "app" as a readable placeholder instead. Add --name to your command for a specific service name.

How we compare

Feature Online Tool Store Writing YAML by hand Other online converters
No file upload — runs in your browser
Instant, no YAML indentation mistakes

Hand-translating flags to YAML is easy to get wrong — a misplaced indent breaks the file. Docker Run to Compose gets the structure right every time.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.