Skip to main content

Custom Compose Overrides

The platform runs as a set of Docker Compose services. On every upgrade, the base docker-compose.yml and docker-compose.prod.yml files are overwritten with the latest versions. Any manual edits to those files will be lost.

To make persistent customizations, create a custom override file that is automatically merged during upgrades.

How It Works​

Place a file at:

/data/coolify/source/docker-compose.custom.yml

During startup and upgrades, the upgrade script checks for this file. If it exists, the containers are started with:

docker compose \
-f docker-compose.yml \
-f docker-compose.prod.yml \
-f docker-compose.custom.yml \
up -d

Docker Compose merges these files in order — properties in later files override the same properties in earlier files. You only need to specify the keys you want to change.

tip

The base files are re-downloaded on every upgrade. Your docker-compose.custom.yml is never touched by the upgrade process, so your customizations persist automatically.

Corelix Enhanced

The Corelix addon installation uses this exact mechanism — it creates a docker-compose.custom.yml that overrides the Coolify image with the enhanced image. This is why your Corelix customizations survive Coolify upgrades.

Service Names​

Service nameContainer nameDescription
coolifycoolifyMain application
postgrescoolify-dbPostgreSQL database
rediscoolify-redisRedis cache
soketicoolify-realtimeWebSocket server

Examples​

Set Resource Limits​

services:
coolify:
cpus: 2.0
mem_limit: 2G
mem_reservation: 512M

Change Port Binding​

Bind to localhost only:

services:
coolify:
ports:
- "127.0.0.1:8000:8080"

Adjust Database Configuration​

services:
postgres:
command: postgres -c max_connections=200 -c shared_buffers=512MB

Combine Multiple Customizations​

services:
coolify:
mem_limit: 2G
labels:
com.example.monitoring: "true"

postgres:
mem_limit: 1G

redis:
mem_limit: 256M

Important Considerations​

danger

A malformed docker-compose.custom.yml can prevent the platform from starting. Always validate your YAML:

cd /data/coolify/source
docker compose \
-f docker-compose.yml \
-f docker-compose.prod.yml \
-f docker-compose.custom.yml \
config

If the output is valid merged YAML with no errors, your file is safe.

  • Service names must match exactly — use coolify, postgres, redis, and soketi
  • Do not redefine the image property unless you know what you are doing
  • Scalar properties are replaced, list properties are merged
  • To apply changes immediately, re-run the upgrade script:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash