> For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt.

# Coolify

[Coolify](https://coolify.io) turns your VPS into your own platform for apps, much like
Heroku or Vercel. You point it at a git repository, and Coolify builds the app, starts it
and gives it a domain with HTTPS. Coolify is open source and runs entirely on your own
server.

This guide has been tested on a VPS Medium with Debian 13 and Coolify 4.7, with a
certificate from Let's Encrypt and access over both IPv4 and IPv6.

## What you need \{#det-har-behover-du}

- **A new VPS with Debian 13, at least 2 cores and 2 GB RAM.** VPS Medium is enough
  for a few small apps. Building a simple Node app took 1.5 GB RAM in our test. If you
  build larger apps or run several, choose VPS Bygg själv with 4 GB or more.
- **At least 35 GB disk.** Coolify warns if the file system is smaller than 30 GB, and
  with 30 GB chosen in the portal it becomes 29 GB. Apps and builds also take space.
- **A domain** that you can add DNS records for, for example in
  [GetGeek DNS](/en/dns/index.md).

## Step 1: Install Coolify \{#steg-1-installera}

Log in to the server with the username from the portal, see
[Getting started](/en/vps/kom-igang.md), and become root:

```bash
sudo -i
```

All commands in steps 1–3 run as root. Install with Coolify's script:

```bash
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
```

The script installs Docker and starts Coolify. It takes a couple of minutes. It prints a
link to port `8000` and warns about `PermitRootLogin`. Do not open the link yet; steps 2
and 3 take care of that.

## Step 2: Let Coolify log in to the server \{#steg-2-ssh}

Coolify manages the server by logging in as root over SSH from its own container. Our
servers do not allow root logins, so allow them only from Coolify's own Docker network:

```bash
NET=$(docker network inspect coolify -f '{{range .IPAM.Config}}{{.Subnet}} {{end}}' | tr ' ' '\n' | grep -v : | head -1)
printf 'Match Address %s\n    PermitRootLogin prohibit-password\n' "$NET" \
  > /etc/ssh/sshd_config.d/00-coolify.conf
sshd -t && systemctl reload ssh
cat /etc/ssh/sshd_config.d/00-coolify.conf
```

The file should contain one network, for example `Match Address 10.0.1.0/24`. Root
still cannot log in from the internet or from your private network.

## Step 3: Close the dashboard to the internet \{#steg-3-stang-dashboarden}

Coolify's dashboard listens on port `8000` for everyone, and whoever registers first
becomes the administrator. Make it listen only locally on the server:

```bash
cd /data/coolify/source
cat > docker-compose.custom.yml <<'EOF'
services:
  coolify:
    ports: !override
      - "127.0.0.1:${APP_PORT:-8000}:8080"
      - "127.0.0.1:${SOKETI_PORT:-6001}:6001"
      - "127.0.0.1:6002:6002"
EOF
docker compose --env-file .env -f docker-compose.yml -f docker-compose.prod.yml \
  -f docker-compose.custom.yml up -d --remove-orphans
```

After half a minute, check that the ports are only on `127.0.0.1`:

```bash
ss -ltn | grep -E ':(8000|6001|6002) '
```

The file `docker-compose.custom.yml` is kept when Coolify is updated.

Leave the root shell with `exit`.

## Step 4: Create your account \{#steg-4-skapa-kontot}

Open an SSH tunnel from your computer, with the username and address from the portal:

```bash
ssh -L 8000:localhost:8000 -L 6001:localhost:6001 -L 6002:localhost:6002 \
  itrhndbk@193.180.173.29
```

Keep the connection open and go to `http://localhost:8000` in your browser. Create your
administrator account. The password must contain upper and lower case letters, digits
and special characters.

:::warning Within ten minutes
Coolify only accepts the first account during the first ten minutes after it started.
If the time is up, run `sudo docker restart coolify` on the server and reload the page.
:::

The server Coolify runs on is called `localhost` in Coolify. Check that Coolify can reach
it under **Servers** → **localhost**, see
[Coolify's documentation](https://coolify.io/docs/core/infrastructure/servers/firewall#confirm-the-firewall-works).

Then make a copy of Coolify's keys. Without them Coolify cannot be restored from a
backup. On the server:

```bash
sudo install -m 600 -o $USER /data/coolify/source/.env ~/coolify.env
```

Fetch the file to your computer, store it for example in your password manager, and
remove it from the server:

```bash
scp itrhndbk@193.180.173.29:coolify.env .
ssh itrhndbk@193.180.173.29 rm coolify.env
```

## Step 5: Point the domain at the server \{#steg-5-peka-domanen}

Add an A record and an AAAA record for the app's name, for example
`app.yourcompany.com`, with the server's IPv4 and IPv6 address from the portal. If you
will run several apps you can add a wildcard instead, for example
`*.apps.yourcompany.com`.

## Step 6: Deploy an app \{#steg-6-deploya}

Create a project in Coolify and add your app from a git repository. Coolify explains the
steps in [Deploy your first app](https://coolify.io/docs/deploy-your-first-app).

Enter the domain with `https://`, for example `https://app.yourcompany.com`. Coolify then
gets a certificate from Let's Encrypt. This requires the DNS record from step 5 to
already point at the server.

In our test, Coolify's Node.js example app was running three minutes after we added it.
The app came back up by itself after a restart of the server.

## Good to know \{#bra-att-veta}

- **Private network:** Docker hands out networks from `10.0.0.0/8`, from the bottom:
  `10.0.0.0/24`, `10.0.1.0/24` and so on. Do not use `10.0.x.x` for your
  [private network](/en/vps/privat-natverk.md). The examples there, `10.10.0.0/24` and VPS
  Cloud's `10.240.x.0/24`, do not collide.
- **Backups:** the nightly backup of the server contains everything Coolify has, see
  [Backups and snapshots](/en/vps/hantera-servern.md#sakerhetskopior). Still keep the copy of
  `.env` somewhere else.
- **Rebuild** in the portal deletes Coolify and all apps.
- **Help with Coolify** is in [Coolify's documentation](https://coolify.io/docs).
