Docker Run to Compose Converter

Convert a docker run command into a docker compose.yaml service with ports, volumes and environment.

Runs instantly in your browser — results update as you type.

How do I convert docker run to docker compose?

Paste your docker run command and the tool maps each option to its compose key — -p to ports, -v to volumes, -e to environment, --restart to restart, --name to container_name — and writes a compose.yaml you can start with docker compose up -d.

How to use the Docker Run to Compose Converter

    Frequently asked questions

    Is the file called docker-compose.yml or compose.yaml?

    Both work; compose.yaml is the current recommended name.

    Do I need the version: key?

    No, it is obsolete in Docker Compose v2.

    Is anything sent to a server?

    No, conversion runs in your browser.