Skip to content

About

A production-ready, self-hosted deployment of Coolify with automated setup, backup/restore functionality, and weekly auto-updates.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Coolify Self-Hosted Stack

A production-ready, self-hosted deployment of Coolify with automated setup, backup/restore functionality, and weekly auto-updates.

Features

  • One-command setup - Automated folder structure, SSH keys, and secure credential generation
  • Online backup/restore - Consistent backups without downtime using pg_dump and Redis BGSAVE
  • Safe auto-updates - Weekly systemd timer (Saturdays at 3:00 AM): repository, images, migrations, verification and automatic rollback
  • IPv6 ready - Dual-stack network configuration out of the box
  • Security focused - Proper file permissions, no default passwords, read-only config mounts

Architecture

+------------------------+     +------------------+
|        Coolify         |---->|    PostgreSQL    |
|  App        :8000      |     |    (Database)    |
|  Realtime   :6001      |     +------------------+
|  Terminal   :6002      |     +------------------+
|                        |---->|      Redis       |
+------------------------+     |     (Cache)      |
                               +------------------+

Quick Start

One-Line Install (Recommended)

# Interactive mode - asks what to install
curl -fsSL https://raw.githubusercontent.com/bauer-group/CS-Coolify/main/install.sh | sudo bash

# Full installation (server setup + Docker + Coolify)
curl -fsSL https://raw.githubusercontent.com/bauer-group/CS-Coolify/main/install.sh | sudo bash -s -- --full

# Coolify only (existing Docker host)
curl -fsSL https://raw.githubusercontent.com/bauer-group/CS-Coolify/main/install.sh | sudo bash -s -- --coolify-only

Option A: Fresh Ubuntu 24.04 Server (Manual)

# 1. Clone repository
git clone https://github.com/bauer-group/CS-Coolify.git /opt/coolify
cd /opt/coolify && chmod +x *.sh server-setup/*.sh

# 2. Run interactive server setup (installs Docker, configures system)
cd /opt/coolify/server-setup
sudo ./install.sh
# System will reboot

# 3. After reboot, run Coolify setup
cd /opt/coolify
sudo ./setup.sh

# 4. Start Coolify
sudo ./coolify.sh start

Option B: Cloud-Init (Automated)

Use server-setup/cloud-init.yaml when provisioning a new VPS:

  • Fully automated Ubuntu 24.04 setup
  • Docker pre-installed with IPv6 support
  • Coolify folders prepared
  • Just copy files and start

Option C: Existing Docker Host (Manual)

# 1. Clone repository
git clone https://github.com/bauer-group/CS-Coolify.git /opt/coolify
cd /opt/coolify && chmod +x *.sh

# 2. Run setup (creates folders, SSH keys, .env)
sudo ./setup.sh

# 3. Start the stack
sudo ./coolify.sh start

# 4. Access Coolify at http://<server-ip>:8000

Requirements

  • Linux server (Ubuntu 24.04 LTS recommended)
  • Docker 20.10+ with Compose v2
  • Root access
  • Ports: 8000 (Coolify), 6001 (Realtime), 6002 (Terminal)

File Structure

/opt/coolify/                # Installation directory
├── docker-compose.yml       # Stack definition
├── setup.sh                 # Coolify setup script
├── coolify.sh               # Management script
├── doctor.sh                # Diagnostics & repair script
├── migrate.sh               # Host-to-host migration script
├── README.md                # This file
├── .env                     # Environment configuration (generated)
├── proxy/                   # Optional hardened Traefik proxy override (see proxy/README.md)
└── server-setup/            # Server provisioning scripts
    ├── install.sh           # Interactive main installer
    ├── 01-system.sh         # System packages & configuration
    ├── 02-network.sh        # Network & file limits
    ├── 03-docker.sh         # Docker installation
    ├── cloud-init.yaml      # Cloud-init for automated setup
    ├── server.conf.example  # Example configuration file
    └── lib/                 # Shared libraries
        ├── common.sh        # Common functions
        └── config.sh        # Configuration loader

/data/coolify/               # Coolify application data
├── ssh/                     # SSH keys for host access
├── applications/            # Deployed application configs
├── databases/               # Database configurations
├── services/                # Service configurations
├── backups/                 # Coolify-managed backups
├── proxy/                   # Traefik proxy config (auto-generated; optional hardening in /opt/coolify/proxy)
└── webhooks-during-maintenance/

/data/system/                # System services data
├── postgres/                # PostgreSQL data
├── redis/                   # Redis data
└── backups/                 # Script-generated backups

Management Commands

sudo ./coolify.sh <command>
Command Description
start Start the Coolify stack
stop Stop all containers
restart Restart all containers
status Show container status and access URL
logs [service] Show logs (all or specific service)
update Update repository and images, apply migrations, verify; rolls back on failure
autoupdate [status|enable|disable] Manage the weekly unattended update (systemd timer)
backup Create online backup (stack must be running)
restore <file> Restore from backup (stack must be stopped)
destroy Remove all containers and volumes
help Show help message

Examples

# View logs for specific service
sudo ./coolify.sh logs coolify
sudo ./coolify.sh logs database-server

# Create backup
sudo ./coolify.sh backup

# Restore from backup
sudo ./coolify.sh stop
sudo ./coolify.sh restore /data/system/backups/coolify_backup_20241219_143022.tar.gz
sudo ./coolify.sh start

Diagnostics & Repair

sudo ./doctor.sh <command> [options]

doctor.sh diagnoses a running stack and repairs the most common breakage after a container image update: the database migrations were never applied, so Coolify fails with Undefined column ... or a blank page until they are.

Command Description
check Read-only diagnosis incl. storage growth and disk usage. Exits 1 when a problem was found (cron/monitoring safe). Runs daily, see Daily health check
fix Guided repair: backup → migrations → caches → queue workers → verification
migrate Apply pending database migrations only
cache Clear and rebuild the Laravel caches only (optimize:clear + optimize)
workers Restart the queue workers (horizon:terminate, fallback queue:restart)
artisan <args> Run any artisan command inside the Coolify container
psql [sql] Open a psql shell, or run a single statement
logs [lines] Show the newest Laravel log file (default: 100 lines)
help Show help
Option Description
-n, --dry-run Change nothing. For migrations this prints the actual SQL (migrate --pretend)
-y, --yes Assume "yes" for all prompts
--force Pass --force to artisan migrate (see below)
--no-backup Skip the safety database dump before migrating
--expect-column <table.column> Verify this column exists afterwards. Repeatable

Typical repair after an update

# 1. What is actually wrong?
sudo ./doctor.sh check

# 2. What would the repair do? (prints the real SQL, changes nothing)
sudo ./doctor.sh fix --dry-run

# 3. Repair. Take the column from the error message to verify the outcome.
sudo ./doctor.sh fix --expect-column applications.domain_dns_statuses

check, artisan, psql and logs are read-only and need only Docker access. fix, migrate, cache and workers change state and require root.

Why --force is opt-in

Coolify runs with APP_ENV=production, so Laravel asks "Are you sure you want to run this command?" before migrating. --force skips exactly that prompt.

The prompt is left in place by default — it is one more pair of eyes on a schema change. But it needs a real terminal: without one, Symfony answers with the default (no) and the migration is silently cancelled while the command still looks like it succeeded. doctor.sh therefore refuses upfront instead of pretending to work:

# Interactive shell: confirm the prompt yourself (default)
sudo ./doctor.sh fix

# Cron, CI, or a piped shell: no terminal, so --force is required
sudo ./doctor.sh fix --yes --force

Daily health check

A systemd timer runs doctor.sh check every day at 06:00 (installed and enabled by coolify.sh start/update, like the update timer). The output goes to the journal; when the check finds a problem the unit ends failed, so it shows up in systemctl --failed and in sudo ./coolify.sh autoupdate.

journalctl -u coolify-check.service -n 60      # last check
systemctl disable --now coolify-check.timer    # turn it off (stays off)

Besides health, migrations and disk usage (/, /data, /var/lib/docker, each filesystem once) the check watches what grows on the host:

Check Problem (exit 1) Warning Threshold variable
Access log rotation Traefik writes an access log but coolify-proxy-logrotate is not running
Proxy access log Live file above the threshold ACCESS_LOG_WARN_MB (500)
Sentinel data (/data/coolify/sentinel) Above the threshold SENTINEL_WARN_MB (5120)
Laravel logs (container) Above the threshold LARAVEL_LOG_WARN_MB (500)
Backups (/data/system/backups) Above the threshold (manual backups and doctor dumps are never pruned) BACKUP_WARN_MB (10240)
Disk 90 % used 80 % used

The storage figures need root (/data/coolify is mode 0700).

Coolify's own log is bounded by the stack: docker-compose.yml sets LOG_CHANNEL=daily, so Coolify writes one laravel-<date>.log per day and keeps 14 (Coolify's default single channel writes one laravel.log that grows until the container is recreated). doctor.sh logs always reads the newest file.

The journal is the only output — nothing sends a message. For an alert, set up a notification channel in Coolify (its disk alert at 80 % watches / only), or hook the failed unit into your monitoring.

Safety backup

Before applying migrations, doctor.sh dumps the Coolify database to /data/system/backups/coolify_db_<timestamp>.dump (PostgreSQL custom format). It is skipped when nothing is pending, and can be disabled with --no-backup. On failure the restore command is printed. For a full archive (database, Redis, SSH keys, .env) run sudo ./coolify.sh backup first — doctor.sh deliberately dumps only the database, because that works even when parts of the stack are down.

Backup & Restore

What's Included in Backups

File Description
01_postgres.dump Coolify database (all projects, servers, deployments)
02_redis.rdb Redis snapshot (sessions, queues, cache)
03_ssh.tar SSH keys for host access
04_env.conf Environment configuration

What's NOT Included

  • Deployed application data (managed by Coolify's built-in backup)
  • Docker volumes of deployed services
  • Application databases

Backup Requirements

  • Creating backup: Stack must be running (online backup)
  • Restoring backup: Stack must be stopped

Configuration

Environment Variables

Edit /opt/coolify/.env to customize:

Variable Default Description
PUSHER_HOST (server IP) WebSocket host - must be reachable from browser
PUSHER_PORT 6001 WebSocket port (use 443 for HTTPS/Traefik)
APPLICATION_PORT 8000 Coolify web interface port
REALTIME_PORT 6001 Host port for realtime (Reverb, inside the coolify container)
TERMINAL_PORT 6002 Host port for the web terminal (inside the coolify container)
COOLIFY_VERSION latest Coolify image version (this compose needs 4.4.0 or newer)
POSTGRES_VERSION 18 PostgreSQL version
REDIS_VERSION 8 Redis version
TIME_ZONE (from host) Container timezone
COOLIFY_PHP_MEMORY_LIMIT 256M PHP memory limit
REDIS_MEMORYLIMIT 1gb Redis max memory
DATABASE_POOLMAXSIZE 100 PostgreSQL max connections

WebSocket Configuration

Coolify uses WebSockets for realtime updates (port 6001) and web terminal (port 6002). Since Coolify 4.4 both are served by the coolify container itself (Laravel Reverb and the terminal server); the separate coolify-realtime (Soketi) container is gone. ./coolify.sh start and ./coolify.sh update remove a leftover coolify-realtime container automatically.

HTTP access (:8000):

PUSHER_HOST=<server-ip>
PUSHER_PORT=6001

HTTPS access (via Traefik with domain):

PUSHER_HOST=example.com
PUSHER_PORT=443

When using HTTPS, Traefik automatically routes:

  • /app → coolify-realtime:6001 (realtime)
  • /terminal/ws → coolify-realtime:6002 (terminal)

coolify-realtime is a network alias of the coolify container, so these routes keep working unchanged.

Container Network Subnet

Every app Coolify deploys attaches to the coolify Docker network so Traefik can route to it, so that network's size caps how many containers a host can run. The default here is 100.65.0.0/16 (65534 IPs, IPv6 fdff:8000:65::/64), chosen over a /24 (254 IPs) because a busy host exhausts a /24. The IPv4 range sits in RFC 6598 CGNAT space, outside the Docker daemon address-pool (10.128.0.0/9, see server-setup/03-docker.sh), so it never collides with the auto-created per-resource networks and needs no daemon.json change.

Caveats: 100.65.0.0/16 is still inside Tailscale's 100.64.0.0/10 — it is conflict-free only on hosts not running Tailscale in that block (check with ip route | grep 100.64). The IPv6 /64 deliberately stays in the pool half fdff:8000::/17; a fdff:100:65::/64 would overlap docker0's fixed-cidr-v6: fdff::/17 and be rejected.

Changing the subnet is NOT hot-swappable — Docker will not re-subnet an existing network on up. On a live host it is a maintenance-window operation:

# 1. Edit the coolify network subnet in docker-compose.yml
# 2. Detach everything from the network (apps briefly go down):
sudo ./coolify.sh stop
docker ps --filter network=coolify -q | xargs -r docker stop
# 3. Remove + recreate the network with the new subnet:
docker network rm coolify
sudo ./coolify.sh start
# 4. Redeploy apps from the Coolify UI so they reconnect to the new network
#    (a plain `docker start` fails: stopped containers point at the old net ID)

Do this before deploying apps where possible; on an established host, treat it as a planned migration.

Changing the Hostname

There are three independent "hostnames" in this stack. Changing one does not change the others — pick the layer you actually mean:

Layer What it is Where to change it
OS hostname The server's machine name (hostname command, shell prompt, logs) hostnamectl on the host
PUSHER_HOST Realtime/WebSocket host the browser must reach /opt/coolify/.env
Instance domain The FQDN Coolify is served on (reverse proxy + SSL) Coolify UI → Settings

1. OS hostname (machine name):

sudo hostnamectl set-hostname new-name
# Also update /etc/hosts if it pins the old name

HOSTNAME in server-setup/server.conf is applied only during the initial server setup (hostnamectl set-hostname in server-setup/install.sh). Editing it later has no effect on a running system — use hostnamectl.

2. PUSHER_HOST (realtime host reachable from the browser):

sudo nano /opt/coolify/.env     # set e.g. PUSHER_HOST=coolify.example.com
sudo ./coolify.sh start         # NOT 'restart' — see note below

Important: Use start (docker compose up -d), not restart. restart reuses the existing container definition and will not pick up .env changes. start compares the config and recreates the container when values changed. The same applies to any other .env edit.

3. Instance domain (the FQDN with SSL): set this in the Coolify dashboard under Settings → Instance Domain (FQDN). It is stored in Coolify's own database, not in .env, so the setup scripts intentionally leave it unset.

Auto-Updates

sudo ./coolify.sh update is the one update path, used manually and by a weekly systemd timer (Saturday 03:00, server timezone, up to 15 minutes random delay; a missed run is caught up after boot). Every stable Coolify release is picked up (COOLIFY_VERSION=latest).

What one run does:

  1. Repository - update.sh pulls this repository, then the update continues with the freshly pulled coolify.sh and docker-compose.yml. Local edits that conflict with the update are not merged: the repository stays on its previous state and the run stops
  2. Images - validates compose file and .env, pulls all images. Nothing new: the run ends here, without backup or restarts
  3. Backup - full online backup (/data/system/backups/coolify_backup_preupdate_*.tar.gz, the newest 4 are kept); the running Coolify image is kept as coolify:pre-update
  4. Containers - docker compose up --wait, so database and Redis are healthy before Coolify starts and runs its migrations
  5. Migrations - doctor.sh fix: applies outstanding migrations explicitly, rebuilds the caches, restarts the queue workers, verifies
  6. Verification - all containers healthy, no pending migrations

If step 4-6 fails, the update rolls back: the database is restored from the pre-update backup (one transaction - all or nothing) and the previous Coolify version is started again - for a version before 4.4 in its previous layout, with the coolify-realtime container. Containers this stack no longer uses (coolify-realtime, coolify-watchtower) are only removed after a successful update. The run is reported as failed; a timer that was not enabled before is not switched on by a failed run.

A stopped stack is not updated (the run is skipped). Started from a terminal, coolify.sh update runs as a transient systemd unit and shows its log, so a dropped SSH connection or Ctrl+C does not interrupt it (journalctl -u coolify-update-manual-*).

sudo ./coolify.sh autoupdate             # status, next run (+ daily health check)
sudo ./coolify.sh autoupdate disable     # manual updates only
sudo ./coolify.sh autoupdate enable
journalctl -u coolify-update.service -n 200   # log of the last run

The timer is installed by coolify.sh start and coolify.sh update and is not re-enabled once you disabled it.

Why not Watchtower? Watchtower swaps images container by container, ignores depends_on/healthchecks and runs no migrations. Coolify migrates on container start but ignores a failure there, so a run that restarted PostgreSQL or Redis at the same time left the schema behind ("Undefined column"). Compose changes, such as the move of realtime into the coolify container in 4.4, never reached the host either.

Coolify's own updater (Settings → Update, AUTOUPDATE) is switched off in docker-compose.yml: it runs the upstream upgrade.sh against /data/coolify/source, a different stack layout. Do not use the update button in the dashboard.

Services

Container Image Purpose
coolify ghcr.io/coollabsio/coolify Main application, realtime (Reverb) and web terminal
coolify-db postgres:18 PostgreSQL database
coolify-redis redis:8 Cache and queue

Optional: Hardened Traefik Proxy

Coolify auto-generates and manages its own Traefik reverse proxy. The proxy/ folder ships an optional hardened drop-in replacement — tuned timeouts, Linux capability drop, log rotation, and a reusable middleware + TLS-options toolbox for your apps — that preserves Coolify's routing contract (container name, coolify network, http/https entrypoints, letsencrypt resolver) byte-for-byte.

It is entirely opt-in and does not affect the control-plane stack above. It already contains Coolify 4.4's traffic-analytics block (access log + log rotation sidecar), so enabling analytics in the dashboard keeps the hardening. Because Coolify treats the proxy compose as a generated artifact, part of the hardening reverts on a proxy regeneration — see proxy/README.md for what survives which action, the analytics and privacy notes, install steps, and rollback.

Troubleshooting

First stop: run the doctor

sudo ./doctor.sh check

Covers containers and their health, the application health endpoint, PostgreSQL, Redis, pending database migrations, failed jobs, Horizon, recent log errors and disk usage. See Diagnostics & Repair.

"Undefined column", blank pages or 500 errors after an update

The database migrations of the new image have not been applied. Coolify migrates on container start but ignores a failure there. coolify.sh update therefore applies and verifies them explicitly; an image updated by other means (e.g. a manual docker pull + restart) can still end up here.

sudo ./doctor.sh fix --dry-run   # shows the SQL that is missing
sudo ./doctor.sh fix             # backup, migrate, caches, workers, verify

If it still fails afterwards, the running image is older than the database expects — pull the current images first:

sudo ./coolify.sh update && sudo ./doctor.sh fix

Stack won't start

# Check Docker is running
sudo systemctl status docker

# Check for port conflicts
sudo netstat -tlnp | grep -E '8000|6001|6002'

# View detailed logs
sudo ./coolify.sh logs

Database connection issues

# Check database health
docker exec coolify-db pg_isready -U coolify -d coolify

# View database logs
sudo ./coolify.sh logs database-server

Reset everything

# Stop and remove containers/volumes
sudo ./coolify.sh destroy

# Remove all data (DESTRUCTIVE!)
sudo rm -rf /data/coolify /data/system /opt/coolify/.env

# Start fresh
sudo ./setup.sh
sudo ./coolify.sh start

Server Setup Scripts

The server-setup/ folder contains modular scripts for preparing a fresh Ubuntu 24.04 server.

Interactive Installation

cd server-setup
sudo ./install.sh

The installer will:

  1. Display a banner and check for root permissions
  2. Look for an existing server.conf configuration file
  3. If no config found, offer three options:
    • Interactive setup: Answer questions for hostname, locale, network
    • Create config file: Copy example and edit manually
    • Use defaults: Proceed with default settings
  4. Run all setup scripts in sequence (system, network, Docker)
  5. Offer to reboot when complete

Configuration File

Create server-setup/server.conf from the example:

cp server.conf.example server.conf
nano server.conf

Configuration options:

Variable Default Description
HOSTNAME coolify-server Server hostname
LOCALE de_DE.UTF-8 System locale
TIMEZONE Europe/Berlin Timezone
NETWORK_MAC (empty) NIC MAC address for netplan
NETWORK_IPV4 (empty) IPv4 address (e.g., 159.195.67.101)
NETWORK_IPV4_NETMASK (empty) IPv4 netmask CIDR (e.g., 22)
NETWORK_IPV4_GATEWAY (empty) IPv4 gateway
NETWORK_IPV6 (empty) IPv6 addresses, space-separated with prefix
NETWORK_IPV6_GATEWAY fe80::1 IPv6 gateway

Network examples:

# Single IPv6 address
NETWORK_IPV6="2a0a:4cc0:c2:17d6::1/64"

# Multiple IPv6 addresses (space-separated)
NETWORK_IPV6="2a0a:4cc0:c2:17d6::1/64 2a0a:4cc0:c2:17d6::2/64 2a0a:4cc0:c2:17d6::3/64"

Setup Scripts

Script Description
install.sh Main interactive installer
01-system.sh Disables AppArmor, installs packages, configures fail2ban, NTP, locale
02-network.sh Creates netplan config (if network vars set), configures file limits
03-docker.sh Installs Docker CE with IPv6 support, creates docker-support service

Cloud-Init (Automated)

Cloud-init pulls scripts from a Git repository and executes them automatically.

Setup:

  1. Push this repository to your own Git hosting (GitHub, GitLab, etc.)
  2. Edit server-setup/cloud-init.yaml:
    • Set GIT_REPO_URL to your repository URL in the runcmd section
    • Customize server.conf in the write_files section with your network settings
    • Add your SSH public key to the users section
  3. Copy the cloud-init.yaml content to your cloud provider's user-data field
  4. Server boots, clones repo, runs setup scripts, and reboots

What happens:

  1. Cloud-init installs git, curl, ca-certificates
  2. Writes server.conf with your configuration
  3. Clones your repository to /opt/coolify
  4. Runs 01-system.sh, 02-network.sh, 03-docker.sh
  5. Reboots to apply changes

After reboot:

cd /opt/coolify
sudo ./setup.sh
sudo ./coolify.sh start

Updating the Stack

Update Scripts from Repository

To update the scripts to the latest version (overwrites local changes):

cd /opt/coolify

# Stop the stack first
sudo ./coolify.sh stop

# Fetch and reset to latest version (discards local changes!)
git fetch origin
git reset --hard origin/main

# Restart the stack
sudo ./coolify.sh start

Keep local changes (merge instead of overwrite):

cd /opt/coolify
git stash                    # Save local changes
git pull origin main         # Pull latest
git stash pop                # Reapply local changes (may need manual merge)

Update Container Images

Updates run automatically every Saturday at 03:00, see Auto-Updates. To update right away (repository, images, migrations):

sudo ./coolify.sh update

Migrating to a New Host

migrate.sh moves a complete Coolify instance to a fresh server over SSH. It runs on the source server (push model) and orchestrates the destination. The source is never stopped — the migration uses an online backup, so it stays fully reversible: if anything fails, the old instance keeps running untouched.

What gets migrated

Layer How
Control plane (PostgreSQL, Redis, SSH keys, .env) Online backup via coolify.sh backup (logical pg_dump, version-safe)
Deployed app volumes Docker named volumes, interactively selected; affected containers are briefly stopped for a consistent export
Repository (compose + scripts) Streamed to /opt/coolify on the destination

Prerequisites

  • Source: running Coolify stack, docker, an SSH private key that authenticates to the destination as root.
  • Destination: Ubuntu host with Docker already installed (run server-setup/ there first if needed) and root SSH access.
# On the source: create a key and authorize it on the destination
ssh-keygen -t ed25519 -f ~/.ssh/coolify_migration_key
ssh-copy-id -i ~/.ssh/coolify_migration_key.pub root@<destination>

Usage

# Recommended first: dry run — shows the full plan, changes nothing
sudo ./migrate.sh --dest <destination> --key ~/.ssh/coolify_migration_key --dry-run

# Interactive volume selection, no hostname change
sudo ./migrate.sh --dest <destination> --key ~/.ssh/coolify_migration_key

# Fully automated, all volumes, with hostname + domain change
sudo ./migrate.sh \
  --dest new.example.com --key ~/.ssh/coolify_migration_key \
  --all-volumes --yes \
  --new-hostname coolify-prod \
  --old-domain old.example.com --new-domain new.example.com
Option Description
--dest <host> Destination host or IP (root SSH) — required
--key <path> SSH private key for the destination — required
--dry-run Show the full plan and run read-only preflight checks; make no changes
--all-volumes / --no-volumes Migrate all / no app volumes (default: interactive select)
--new-hostname <name> Set the OS hostname on the destination (hostnamectl)
--old-domain / --new-domain Rewrite the domain in PUSHER_HOST and in Coolify's database (instance + app FQDNs). Must be given together
--live-volumes Export volumes without stopping app containers (faster, risks inconsistent data)
--yes Assume "yes" for all prompts (full automation)

How it works

  1. Preflight — validates SSH, source stack, and that Docker is installed and running on the destination (fails early with a hint otherwise); warns if the destination already has Coolify.
  2. Backup — runs coolify.sh backup (online, no downtime).
  3. Volumes — discovers Docker named volumes, lets you pick, stops the affected app containers only for the duration of each export, then restarts them.
  4. Transfer — streams the repo (without .env/.git) plus the backup and volume archives, with a SHA-256 manifest.
  5. Import (on destination) — verifies checksums, runs setup.sh, restores volumes, runs coolify.sh restore, re-authorizes Coolify's SSH key, applies the optional hostname/domain change, starts the stack, and waits for the health check.

After migration: the new instance is running but the source is left untouched. Verify the destination, repoint DNS / your reverse proxy, then decommission the source with sudo ./coolify.sh stop.

Domain rewrite caveat: rewriting FQDNs in Coolify's database is a direct edit of Coolify's data model. Only the fqdn columns of instance_settings, applications, and service_applications are touched, inside a single transaction. Verify your applications' domains in the Coolify UI afterwards.

Security Considerations

  • All passwords are randomly generated during setup
  • SSH keys use Ed25519 (modern, secure)
  • .env file is mounted read-only into containers
  • Database and Redis are not exposed to host network
  • File permissions follow principle of least privilege

License

This deployment configuration is provided as-is. Coolify itself is licensed under the Apache 2.0 License.

Links

About

A production-ready, self-hosted deployment of Coolify with automated setup, backup/restore functionality, and weekly auto-updates.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages