Skip to main content
Docker Compose deployments allow you to run multi-container applications defined in a docker-compose.yml file. This is ideal for complex applications that require multiple services working together.

What is Docker Compose?

Docker Compose is a tool for defining and running multi-container Docker applications. With Dokploy, you can deploy entire application stacks that include:
  • Multiple interconnected services
  • Databases and caching layers
  • Message queues and background workers
  • Reverse proxies and load balancers
  • Any combination of containerized services

Multi-Service

Deploy multiple containers that work together as a single application stack.

Service Dependencies

Define relationships and dependencies between services.

Shared Networks

Services automatically share a network for seamless communication.

Templates

Use pre-built templates for popular application stacks.

Compose vs Stack Mode

Dokploy supports two deployment modes for Docker Compose:
Standard Docker Compose mode using docker compose CLI:
  • Suitable for single-server deployments
  • Simpler configuration
  • Direct mapping of compose file features
  • Recommended for most use cases

Creating a Compose Deployment

Compose deployments are created within environments, similar to applications and databases.

Basic Configuration

string
required
Display name for your compose deployment
string
required
Unique internal identifier (auto-generated if not provided)
string
Optional description to help identify the deployment’s purpose
string
required
The complete docker-compose.yml content
enum
default:"docker-compose"
Deployment mode: docker-compose or stack
string
required
The environment where this compose deployment will be created

Source Types

Compose deployments support multiple source options:

Git Repositories

Deploy from GitHub repositories:
string
required
Repository name (e.g., myorg/myrepo)
string
required
Repository owner or organization
string
required
Branch to deploy from
string
default:"./docker-compose.yml"
Path to the compose file in the repository

Raw Compose File

Paste or upload your docker-compose.yml content directly:

Environment Variables

Compose deployments support environment variable substitution:

Setting Variables

Using Variables in Compose File

Variables from the environment and project levels are automatically inherited. Compose-level variables take precedence.

Isolated Deployments

Dokploy supports isolated compose deployments, which modify service names to enable multiple instances:
boolean
default:false
Enable isolated deployment mode
string
Suffix to append to service names (auto-generated if not provided)

How It Works

When isolated deployments are enabled:
  1. Service names get a unique suffix: web becomes web-abc123
  2. Container names are similarly modified
  3. Networks are isolated per deployment
  4. Volume names can be isolated (optional)
This allows running multiple instances of the same compose stack side-by-side.

Example

Original compose file:
With isolated deployment (suffix: abc123):

Randomization

Randomization automatically generates unique identifiers for services:
boolean
default:false
Enable service name randomization
Use randomization carefully as it changes service discovery names. Applications must be designed to handle dynamic service names.

Domain Configuration

Compose deployments can have multiple domains configured for routing traffic to specific services:

Adding Domains

Multiple Services, Multiple Domains

See Domains & Routing for detailed information.

File Mounts

Inject configuration files into your compose deployment:

Automatic Deployments

boolean
default:true
Automatically deploy when changes are pushed to the repository
enum
default:"push"
When to trigger deployments: push or pull_request
array
Only trigger deployments when specific paths change

Watch Paths Example

Deploying Templates

Dokploy provides pre-built templates for popular application stacks:

Available Templates

Fetch available templates:
Templates include:
  • WordPress + MySQL
  • Ghost + MySQL
  • Nextcloud + PostgreSQL
  • GitLab + PostgreSQL + Redis
  • Directus + PostgreSQL
  • And many more…

Deploying a Template

Templates automatically configure:
  • Environment variables with secure defaults
  • Persistent volume mounts
  • Domain configuration
  • Service dependencies

Managing Services

View and manage individual services within your compose deployment:

Loading Services

Returns service information:
  • Service names
  • Image names
  • Port mappings
  • Environment variables
  • Volume mounts
  • Network configuration

Service Volumes

View volume mounts for a specific service:

Deployment Operations

Manual Deployment

Trigger a deployment manually:

Rebuild Deployment

Rebuild without fetching latest code:

Start/Stop

Control the compose stack:

Advanced Features

Custom Commands

Override the default docker compose command:
string
Custom command to append to docker compose
Example:

Submodule Support

boolean
default:false
Clone Git submodules when fetching repository

Fetch Source Type

Load the latest compose file from the repository:
This clones the repository and loads the compose file without deploying.

Get Converted Compose

Get the final compose file with all transformations applied (variables substituted, domains added, etc.):

Importing Templates

Import custom templates or configurations:
The template data should include:
  • Docker compose file content
  • Configuration (environment variables, domains, mounts)

Database Schema

Compose deployments are stored with the following structure:

Monitoring & Logs

Deployment Logs

View logs for the deployment process:
  • Service build output
  • Pull progress
  • Container startup logs
  • Error messages

Service Logs

Access logs for individual services:

Resource Usage

Monitor resource consumption for all services in the stack:
  • Combined CPU usage
  • Total memory usage
  • Network traffic
  • Disk I/O

Best Practices

Always use specific image tags instead of latest to ensure reproducible deployments:
Define health checks for services to ensure proper startup order and monitoring:
Use labels to organize and document your services:
Enable isolated deployments when you need to test changes without affecting production.
Never commit secrets to your compose file. Use environment variables instead:

Troubleshooting

Services Won’t Start

  1. Check the deployment logs for error messages
  2. Verify all required environment variables are set
  3. Ensure image names are correct and accessible
  4. Check for port conflicts with other services

Service Communication Issues

  1. Verify services are on the same network
  2. Use service names (not container names) for communication
  3. Check firewall rules if accessing external services
  4. Verify port mappings in your compose file

Volume Mount Problems

  1. Ensure volume paths are correctly specified
  2. Check file permissions in mounted directories
  3. Verify volumes are created before containers start

Next Steps

Domains & Routing

Configure domains for your compose services

Templates

Explore available compose templates