Docker Run to Compose
Convert docker run commands to docker-compose.yml online and turn compose files back into docker run commands. Free converter that runs in your browser.
What is Composerize?
Composerize is an open-source utility that converts a docker run command into an equivalent docker-compose.yml file, so you can manage the same container declaratively with Docker Compose instead of a long terminal one-liner.
How do I convert a docker run command to docker-compose.yml?
Paste your docker run (or docker container run) command into the input box. The YAML output appears instantly as you type, and you can copy it or download it as a docker-compose.yml file.
Can I convert docker-compose.yml back to a docker run command?
Yes. Switch to the compose → run tab and paste your compose file. The tool reads the first service that defines an image and builds the equivalent docker run command you can paste into a terminal.
Which docker run flags are supported?
Common flags such as -d, --name, -p, -v, -e, --restart, --network, --entrypoint, --user, --workdir, --privileged, labels, devices and environment variables are recognized. Very new or rarely used options may be ignored in the output.
Is my command or YAML sent to a server?
No. The conversion engine runs completely inside your browser. Nothing you type is transmitted, logged or stored anywhere, so it is safe to use with internal image names and ports.
Why use Docker Compose instead of docker run?
Compose stores the container configuration in a readable YAML file that can be version-controlled and reviewed, documents every option in one place, and starts or recreates containers with a single short command.
What does decomposerize mean?
It is the reverse of composerize: it takes a service definition from a docker-compose.yml file and reconstructs the docker run command that would create the same container with the same ports, volumes and environment.
Does it support podman or docker create commands?
Yes. podman run, podman create and docker create share the same flag syntax as docker run, so those commands are converted as well.
How are multi-service compose files handled?
When converting from compose, the first service that declares an image is used, because a single docker run command can only start one container. Other services, networks and top-level volumes are ignored.
What should I do if conversion fails?
Check that the command or YAML is complete and correctly formatted - the red panel below the output shows the exact error. Remove unsupported flags or advanced sections such as deploy or healthcheck, then try again.
How to Use Docker Run to Compose
Paste a docker run command and get a clean docker-compose.yml — or turn a compose file back into a run command. Parsing and YAML generation happen entirely in your browser, so nothing leaves your machine.
- Pick the conversion direction with the two tabs: run → compose turns a docker run command into a docker-compose.yml, while compose → run does the opposite.
- Type or paste your command (or YAML) into the left input box — the result appears on the right automatically as you type, with no button to press. Malformed input shows a red error panel instead.
- Not sure what to feed it? Press Load example to fill the editor with a ready-made sample you can adapt.
- Use the small Copy button above the output to copy the result, or Download to save it as docker-compose.yml (or docker-run.txt). Clear empties both sides.
When converting compose → run, only the first service with an image becomes a command, so give each service its own pass. Running docker compose config locally before deploying catches typos early.
Related Tools
- Docker Compose Validator Validate Docker Compose YAML files online for syntax errors, structure issues, and best practices. Get detailed error messages with line numbers instantly.
- cURL to Code Convert cURL commands to JavaScript, Python, Go, Java, PHP, Ruby, C#, Rust code instantly. Free online converter supporting headers, POST data, auth and more.
- .htaccess Generator Generate Apache .htaccess rules for redirects, rewrites, security headers, caching, compression, and more.
- HTTP Status Codes Complete reference of HTTP status codes with descriptions. Search and filter by code, category, or keyword.
- File Hash Checker Calculate and verify MD5, SHA-1, SHA-256, SHA-512 file hashes locally
- Chmod Calculator Free online chmod calculator to visualize and calculate Linux file permissions with checkboxes. Instantly convert between numeric (755, 644) and symbolic notation (rwxr-xr-x). Supports special permissions like setuid, setgid, sticky bit.
- ASCII Table Complete ASCII character encoding reference with decimal, hexadecimal, octal, binary codes, HTML entities, and character descriptions. Search and filter instantly.
- Hex Viewer View file contents in hex dump format with search, offset navigation, and virtual scrolling