docker run to Compose Converter

Paste a docker run command and get a docker-compose.yml. Ports, volumes, environment, restart policy and devices are mapped for you — nothing is uploaded.

Convert docker run to docker-compose in your browser. Paste one command or several and get a docker-compose.yml that follows the current Compose Spec (no obsolete version: key). Handy when you move a container from a Synology or other NAS guide into Compose, and nothing you paste is uploaded.

How to use the docker run to Compose Converter

  1. Paste your docker run command, or several of them, into the input. Backslash or backtick line continuations are fine.
  2. The docker-compose.yml updates as you type. Check the Not converted list for flags that have no Compose equivalent.
  3. Press Copy YAML or Download docker-compose.yml, then start it with docker compose up -d.

Frequently asked questions

How do I convert docker run to docker-compose?

Paste the docker run command into the input. A docker-compose.yml appears instantly; press Copy or Download docker-compose.yml. Several docker run commands pasted together become several services in one file.

Does the output use the version key?

No. The output follows the current Compose Spec, where the top-level version: key is obsolete, so it is left out. Current Docker Compose versions read the file as is.

Can I use the file on a Synology or other NAS?

Usually yes. Synology Container Manager, Portainer and most NAS tools accept a standard docker-compose.yml. Check the host paths in volumes, because NAS folders such as /volume1/docker differ from your desktop.

Is my command uploaded anywhere?

No. The conversion runs entirely in your browser. Nothing you paste is sent to a server, and the command is never stored or added to the URL.

What happens to docker run flags that cannot be converted?

They are never dropped silently. Every flag without a Compose mapping is listed under Not converted with the service name and a reason, and anything that needs your attention is listed as a note.

Fun facts about Docker Compose