Docker Compose Generator

Generate a docker-compose.yml from a form.

docker-compose.yml
services:
  web:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "8080:80"
    environment:
      NODE_ENV: production
      TZ: UTC
    volumes:
      - ./data:/data

Free online docker-compose.yml generator. Enter a service name, image, ports, environment variables, volumes and restart policy to produce valid Compose YAML. Generated locally in your browser.

How to use the Docker Compose Generator

  1. 01Enter the service name and image.
  2. 02Add ports, environment variables and volumes, one per line.
  3. 03Pick a restart policy, then copy the generated docker-compose.yml.

Frequently asked questions

Which Compose version does this use?

It uses the modern Compose specification, which no longer needs a top-level version key — just a services block. It works with recent Docker Compose v2.

What restart policy should I pick?

unless-stopped keeps the container running across reboots but respects a manual stop, which suits most services. Use on-failure for one-off jobs and always for critical daemons.