docker run to Compose Converter
Paste a long docker run command and get a tidy compose.yaml back. Ports, volumes, environment variables, networks and the restart policy are mapped across for you.
🔒 Runs entirely in your browser. Nothing you type is sent anywhere.
How to use it
- Paste a full
docker runcommand into the box. - Copy the
compose.yamlthat appears. - Save it as
compose.yamlnext to your project and bring the container up withdocker compose up -d.
Why move to Compose
A docker run command lives in your shell history and is easy to lose. A Compose file is a record of exactly how the container is set up: the image, the ports, the volumes and the environment. You can keep it in Git, read it back in six months, and recreate the container with one command.
What gets mapped
Ports, volumes, environment variables, networks, the restart policy, the container name, labels, capabilities, devices, DNS servers, the user, the working directory, memory and CPU limits, and the trailing command. Flags the converter does not recognise are listed below the output so you can add them by hand.
FAQ
Does it handle multi-container setups?
It converts one docker run into one service. For a stack, convert each container and paste the services into the same file under services:.
Why does it default to restart: unless-stopped? It is a sensible default for a self-hosted service that should come back after a reboot. Change or remove it if you do not want that.
Is anything sent to a server? No. The conversion runs in your browser.