This guide installs Coolify 4.7 on an Ubuntu 24.04 VPS without exposing the dashboard at any point. The dashboard ports are bound to localhost before the install, the installer itself creates the admin account, and the first visit goes through an SSH tunnel. Then the dashboard moves to a domain with HTTPS, and the guide ends with updates and backups.
What you need
- A VPS running 64-bit Ubuntu 24.04, with SSH key access.
- A domain where you can create DNS records. The examples use
coolify.example.com. - An email address on a real domain for the admin account. Coolify checks the DNS of the email's domain.
The Coolify docs ask for at least 2 cores, 2 GB of RAM and 10 GB of free disk, but the installer warns when there are fewer than 20 GB free. That minimum covers Coolify alone: at rest, its six containers use about 750 MB of RAM, and every application, database or build you deploy adds to that. With 4 vCPUs and 8 GB you have room for a few projects and for builds that don't freeze the dashboard.
If you just want to try it, Nuvits can also deliver the VPS with Coolify preinstalled when you order it. In that option, the dashboard ports come blocked from the internet and the first visit goes through an SSH tunnel, as in this guide.
Why install it carefully
The default one-command install leaves three gaps:
- The first visitor becomes the admin. After each start, Coolify accepts the first user's sign-up for 10 minutes, and its own docs warn that whoever reaches the registration page first gets root access to the server.
-
The dashboard opens over HTTP. Until you set up a domain, the login at
http://IP:8000travels unencrypted. - ufw doesn't close Docker's ports. The dashboard runs in a container, and a port published by Docker is reachable from outside even without a ufw rule. The Coolify firewall page warns not to rely on ufw alone.
The steps below close all three.
Prepare the server
If your provider hands you the VPS with root access, create a user with sudo and copy your SSH key over:
adduser deploy
usermod -aG sudo deploy
install -d -m 700 -o deploy -g deploy /home/deploy/.ssh
install -m 600 -o deploy -g deploy ~/.ssh/authorized_keys /home/deploy/.ssh/
Open another session as deploy and check that the login works before you go on. From here on, the commands run as deploy.
Key-only SSH
Coolify manages its own VPS by logging in over SSH as root, with a key it generates during the install. The docs ask for PermitRootLogin prohibit-password, which only lets root in with a key. You can go a bit further: block root logins from the internet and allow them only from Docker's internal networks, which is where Coolify connects from. Create the file:
sudo nano /etc/ssh/sshd_config.d/10-coolify.conf
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
Match Address 10.0.0.0/8,172.16.0.0/12
PermitRootLogin prohibit-password
The name starts with 10- on purpose: SSH keeps the first value it reads, and some cloud images ship a 50-cloudimg-settings.conf that turns passwords on. The 10.0.0.0/8 and 172.16.0.0/12 ranges cover the networks Docker creates. Test and apply:
sudo sshd -t
sudo systemctl restart ssh
sshd -t prints nothing when the file is valid. Before you close the current session, open another one as deploy to confirm you can still get in.
Firewall
Allow SSH, HTTP and HTTPS in ufw and turn the firewall on:
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443
sudo ufw enable
sudo ufw status
ufw enable asks for confirmation because it may drop your SSH connection; with the port 22 rule already in place, answer y. The 443 rule without a protocol also opens UDP, which the Coolify proxy uses for HTTP/3. Ports 8000, 6001 and 6002 stay out, but, as noted above, ufw isn't enough for them. The next step takes care of that. If your provider has a network firewall in its dashboard, open the same three ports there.
Close the dashboard before installing
Coolify publishes three ports: 8000 (dashboard), 6001 (real-time updates) and 6002 (web terminal). It also reads an optional docker-compose.custom.yml file that updates never overwrite. The docs use that file to bind the ports to localhost, and nothing stops you from creating it before the install:
sudo mkdir -p /data/coolify/source
sudo nano /data/coolify/source/docker-compose.custom.yml
services:
coolify:
ports: !override
- "127.0.0.1:8000:8080"
- "127.0.0.1:6001:6001"
- "127.0.0.1:6002:6002"
!override replaces the port list from the original file instead of adding to it. With this, the dashboard only answers inside the VPS, and you reach it through an SSH tunnel.
Install Coolify
Download the official installer and read it before you run it:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh -o coolify-install.sh
less coolify-install.sh
The script installs the packages it needs and Docker (through the get.docker.com script), then generates an SSH key for Coolify and adds it to /root/.ssh/authorized_keys. If you'd rather have Docker from the official apt repository, install it first, as in the n8n guide; the installer uses whatever Docker it finds.
Now run the installer with three variables that create the admin account right away. That way, the registration page is never open. read -s keeps the password off the screen and out of your shell history:
read -rp 'Admin email: ' COOLIFY_EMAIL
read -rsp 'Admin password: ' COOLIFY_PASSWORD; echo
sudo env ROOT_USERNAME=admin ROOT_USER_EMAIL="$COOLIFY_EMAIL" ROOT_USER_PASSWORD="$COOLIFY_PASSWORD" AUTOUPDATE=false bash coolify-install.sh 4.7.5
unset COOLIFY_PASSWORD
What each part does:
-
4.7.5pins the version. It was the stable release when this was written. Check the current one in the Coolify releases or in thestablefield of versions.json. - The password needs at least 8 characters, with uppercase and lowercase letters, numbers and symbols, and it can't show up in known breaches. Generate one in your password manager.
-
AUTOUPDATE=falseturns off automatic updates, which are on by default and run every day at midnight. The update section explains why.
The install takes a few minutes. At the end, the script prints addresses like http://IP:8000 that won't open from outside: that's expected. It also warns that PermitRootLogin is disabled, because it only reads the global SSH rule, not the Match block.
Check that the admin account was created:
sudo docker logs coolify 2>&1 | grep -i "root user"
The output should include Root user created successfully. If you see Invalid Root User Environment Variables, the email or the password failed validation. In that case the registration page stays open for 10 minutes, but only through the tunnel in the next section: create the account there, and if time runs out, sudo docker restart coolify opens the window again.
With the account created, delete the password the installer wrote to Coolify's .env, along with the downloaded installer:
sudo sed -i '/^ROOT_USER_PASSWORD=/d' /data/coolify/source/.env
rm coolify-install.sh
The container that is already running keeps the password in its environment variables, readable only by root, until the next update recreates it.
Finally, confirm that the dashboard ports listen only on localhost:
sudo ss -ltn | grep -E ':(8000|6001|6002) '
All three lines should start with 127.0.0.1.
Open the dashboard through an SSH tunnel
On your machine, open a tunnel with the three ports:
ssh -N -L 8000:localhost:8000 -L 6001:localhost:6001 -L 6002:localhost:6002 deploy@YOUR_VPS_IP
The command sits there while the tunnel is open. Go to http://localhost:8000 in your browser and sign in with the admin email and password. The setup wizard offers This machine to use the VPS itself as a server; pick it and Coolify validates its SSH connection to root.
Before you deploy anything, turn on two-factor authentication in Profile > Two-factor Authentication and keep the recovery codes outside Coolify. It's worth the effort: Coolify's web terminal opens a root shell on the VPS.
In Settings > Advanced, check that Registration is set to Registration disabled. The installer leaves it that way when it creates the admin. On the same screen, API access and the MCP server come turned off; only enable them if you need them.
Put the dashboard on a domain with HTTPS
In your domain's DNS panel, create an A record named coolify (or the subdomain you chose) pointing to the VPS's IPv4 address. Check that it already resolves:
dig +short coolify.example.com A
With DNS in place, open Settings > General, set URL to https://coolify.example.com and save. Coolify's proxy, Traefik, which already serves ports 80 and 443, starts answering on that domain and requests the certificate from Let's Encrypt on its own. The HTTP address redirects to HTTPS, and the real-time updates and the web terminal also go through port 443.
Test from outside the VPS:
curl -I https://coolify.example.com/login
The response should be HTTP/2 200. If the certificate doesn't come through, check DNS and whether ports 80 and 443 are also open in your provider's firewall, if it has one.
From now on, use the dashboard through the domain. Leave docker-compose.custom.yml as it is: ports 8000, 6001 and 6002 stay closed to the internet, and the SSH tunnel keeps working as emergency access if the domain or the proxy fails.
Update and back up
Backup
Coolify keeps everything in its own PostgreSQL, the coolify-db container. Passwords and keys saved in the dashboard are encrypted with the APP_KEY from /data/coolify/source/.env, and the database dump doesn't include that file. A backup needs both:
cd ~
(umask 077
sudo docker exec coolify-db pg_dump --format=custom --no-acl --no-owner --username=coolify coolify > coolify-db-$(date +%F).dmp
sudo cat /data/coolify/source/.env > coolify-env-$(date +%F))
ls -l coolify-db-* coolify-env-*
umask 077 makes both files readable only by your user. Then copy them off the VPS, from your machine:
mkdir -p coolify-backups
scp 'deploy@YOUR_VPS_IP:coolify-db-*' 'deploy@YOUR_VPS_IP:coolify-env-*' ./coolify-backups/
Also keep the APP_KEY= line in a password manager. Without it, a restored database opens, but the saved credentials can't be read. For scheduled backups, Coolify has Settings > Backup, which can send the dump to S3 storage. Restoring, including to another VPS, is covered in Restore a Coolify instance.
This backs up Coolify itself. The databases and volumes of the applications you deploy have their own backups, set up on each resource.
Update
Coolify ships several releases a week: 4.7.0 through 4.7.5 were six releases in two days. With automatic updates on, a new version lands overnight without you seeing it, and every update restarts Coolify's containers. That's why this guide turned them off. In exchange, you need to follow the releases and update often, because security fixes arrive in new versions.
The routine:
- Take the backup above.
- Read the release notes for the new version.
- Run the upgrade script with the version:
curl -fsSL https://cdn.coollabs.io/coolify/upgrade.sh | sudo bash -s 4.7.6
Replace 4.7.6 with the version you want. The script pulls the images and restarts Coolify in the background. Wait a minute and check:
sudo docker ps --format '{{.Names}}\t{{.Image}}\t{{.Ports}}' | grep -w coolify
The image should show the new version, and the ports, 127.0.0.1. docker-compose.custom.yml still applies after the update.
Don't use
install.shto update. The docs warn that, on an existing install, it resets owners and permissions under/data/coolify, including service data. To update, always useupgrade.sh.
If you'd rather have automatic updates, drop AUTOUPDATE=false from the install command. With that variable in .env, the option is locked in Settings > Updates.
Next steps
- Set up a notification channel under Notifications so you hear about failed deployments and backups.
- Point a
*.example.comrecord at the VPS and fill in Wildcard domain on the server, so each application gets an HTTPS subdomain without touching DNS. - Expose applications through domains, via the proxy, and avoid mapping their ports to the internet: ufw doesn't close those ports either.
- Read Coolify's security model before giving other people access to the dashboard.
Top comments (0)