Securing a Coolify server comes down to six things. Keep databases private unless you really need public access. Make sure the Traefik dashboard is not exposed. Harden SSH on the host. Keep both Coolify and the OS updated. Filter Docker-published ports in the DOCKER-USER chain, because ufw does not see them. Then turn on access logs so you can see who is knocking.

Coolify makes deploying easy, and that is exactly why it is worth a careful look. One toggle can put a database on the internet, and the firewall you set up may not be doing what you think. This guide walks through the parts that matter.

1. Public databases and the -proxy containers

Each database in Coolify has an option to make it publicly available on a port you choose. When you turn it on, Coolify starts an extra container whose name is the database’s identifier followed by -proxy. That container publishes the public port on the host and forwards it to the database.

Two consequences:

  • The database is reachable from the whole internet on that port, protected only by its password.
  • Because Docker publishes the port itself, ufw does not filter it (more on this below).

List what is published:

docker ps --format 'table {{.Names}}\t{{.Ports}}' | grep -E -- '-proxy|0\.0\.0\.0'

If you only need the database from your own machine, turn public access off and use an SSH tunnel to the container’s internal address instead. The host can reach containers on its Docker networks directly:

# On the server: find the database container's IP
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}' <db-container>
# On your laptop: tunnel to it (replace 10.0.1.5 with that IP)
ssh -L 5432:10.0.1.5:5432 user@your-server

If an external service really needs access, keep the port public but allow only that service’s IP in DOCKER-USER (section 5). Use a long, random password, and never reuse the default user without one.

2. The Traefik dashboard

Coolify’s reverse proxy runs as the coolify-proxy container, using Traefik by default. Traefik has a dashboard that shows every router, service and middleware. That is useful to you, and to an attacker mapping your setup.

In Coolify, open Servers → your server → Proxy and read the configuration. Look for:

  • --api.insecure=true, which serves the dashboard on port 8080 with no authentication
  • a published port 8080:8080

Check from outside:

curl -s -o /dev/null -w '%{http_code}\n' http://203.0.113.20:8080/dashboard/

A 200 means anyone can view it. Either remove the insecure API flag and the 8080 mapping, or serve the dashboard through a router protected by an authentication middleware. The Traefik documentation explains both. Restart the proxy from the Coolify UI after you change anything.

3. Harden SSH on the host

Coolify manages servers over SSH, including the server it runs on, usually as root with a key. So don’t set PermitRootLogin no unless you have configured Coolify to use a non-root user. Disable passwords instead:

sudo tee /etc/ssh/sshd_config.d/00-hardening.conf >/dev/null <<'EOF'
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password
EOF
sudo sshd -t && sudo systemctl reload ssh   # RHEL family: sshd

Add fail2ban with an [sshd] jail. Put the Docker network Coolify uses in ignoreip so its own connections are never banned. Find the subnet with:

docker network inspect coolify --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'

4. Keep Coolify and the OS updated

Coolify can update itself. Check Settings for auto-update and its schedule, or update by hand when a release fixes a security problem. Also keep the host OS patched:

# Debian / Ubuntu
sudo apt install unattended-upgrades && sudo dpkg-reconfigure -plow unattended-upgrades
# RHEL family
sudo dnf install dnf-automatic && sudo systemctl enable --now dnf-automatic.timer

On the RHEL family, set apply_updates = yes in /etc/dnf/automatic.conf, or the timer only downloads updates. Update the images of the apps you deploy, too. A redeploy with an old pinned tag keeps old vulnerabilities.

In Settings, also turn off registration once your team has accounts, and enable two-factor authentication on your Coolify user.

5. Firewall: ufw alone is not enough

Set a default-deny policy on the host and allow SSH, HTTP and HTTPS. Coolify’s dashboard and real-time features also use their own ports (such as 8000, 6001 and 6002). Check the Coolify firewall documentation for the current list and for which ones you can close once the dashboard is on a domain.

sudo ufw default deny incoming
sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enable

Here is the problem: every port that a Coolify container publishes skips these rules. Docker forwards published ports through its own iptables chains, never through INPUT, where ufw works. Filter them in DOCKER-USER, which Docker evaluates first. Match on the original destination port, because DNAT has already rewritten it:

# Block the Traefik dashboard port and a public Postgres port from the internet
sudo iptables -I DOCKER-USER -i eth0 -p tcp -m conntrack --ctorigdstport 8080 --ctdir ORIGINAL -j DROP
sudo iptables -I DOCKER-USER -i eth0 -p tcp -m conntrack --ctorigdstport 5432 --ctdir ORIGINAL -j DROP
# Allow one trusted IP to reach Postgres (inserted above the DROP)
sudo iptables -I DOCKER-USER -i eth0 -s 198.51.100.10 -p tcp -m conntrack --ctorigdstport 5432 --ctdir ORIGINAL -j RETURN

These rules don’t survive a reboot on their own. Make them persistent (for example through /etc/ufw/after.rules or a systemd unit that runs after Docker), then confirm from another machine with nmap -Pn -p 5432,8080 <your-ip>.

6. Turn on Traefik access logs

Without access logs you can’t see scanners, brute force attempts on your apps or requests for /.env. Add these flags to the proxy configuration in Servers → Proxy:

      - '--accesslog=true'
      - '--accesslog.format=json'
      - '--accesslog.filepath=/traefik/access.log'

In Coolify’s default setup, /traefik inside the container is mounted from /data/coolify/proxy on the host, so the log appears at /data/coolify/proxy/access.log. Check the volume in your proxy configuration. Restart the proxy, then:

sudo tail -f /data/coolify/proxy/access.log

Rotate the file with logrotate. Traefik reopens its log file when it receives USR1:

sudo tee /etc/logrotate.d/coolify-traefik >/dev/null <<'EOF'
/data/coolify/proxy/access.log {
    daily
    rotate 14
    compress
    delaycompress
    missingok
    notifempty
    postrotate
        docker kill --signal=USR1 coolify-proxy >/dev/null 2>&1 || true
    endscript
}
EOF

The available options are listed in the Traefik access logs documentation.

7. Backups

Set up scheduled backups for each database in Coolify, sent to S3-compatible storage off the server. Also back up /data/coolify, in particular the .env file in /data/coolify/source/. It holds the key Coolify needs to decrypt its stored secrets, so without it a restore of the dashboard will not work. Test a restore at least once.

How Avanguard helps

  • Avanguard reports Docker-published database ports, including a Coolify public database exposed through a -proxy container, even when a firewall is active, and explains the DOCKER-USER fix.
  • It flags a Traefik dashboard without authentication.
  • It reads access logs from Traefik and Coolify and alerts on sensitive files that answer 200 (such as /.env or /.git/config), scans of sensitive paths, login brute force and known security scanners.
  • It checks SSH configuration, pending updates, and new open ports and users on the host.

See Docker and Coolify security or the pricing.

Summary

  • Public access is off for every database that doesn’t need it, and -proxy containers are reviewed
  • Traefik dashboard is not reachable without authentication (no --api.insecure=true on a public port)
  • SSH uses keys only, root with prohibit-password for Coolify, and fail2ban ignores the Coolify network
  • Coolify auto-update, OS security updates, 2FA on, registration off
  • ufw default deny, plus DOCKER-USER rules for published ports, made persistent
  • Traefik access logs enabled and rotated
  • Off-server database backups, plus /data/coolify/source/.env, with a tested restore