Install Kivo

Your own server

Production on a Linux VPS, office server or data centre.

Run Kivo in production on a Linux server you control — a VPS, a machine in your office, or a server in your data centre. This is the reference setup; the cloud guides follow the same steps. Kivo runs from the published images invicly/kivo and invicly/kivo-migrate, so there's nothing to build.

Replace everything in <angle brackets>, and every change-me, with your own values.

Requirements

  • Ubuntu 24.04 LTS or Debian 12 on x86_64 (amd64) (other distributions work with Docker installed their way)
  • 2 vCPU, 2–4 GB RAM, 20 GB+ disk, a static IP
  • A domain with an A record pointing at the server
  • Ports 80 and 443 reachable from the internet (for HTTPS); 22 from your address only
  • An SMTP account

On-premises with no inbound internet? That's fine: Kivo only needs outbound HTTPS to Docker Hub (to pull the images), https://kivo-control.invicly.com and your SMTP provider. Use your own proxy with an internal certificate instead of the bundled Caddy (Your own proxy).

1. Install Docker

bash
sudo apt-get update && sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
  | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker $USER    # sign out and back in afterwards

On Debian, replace ubuntu with debian in both URLs.

2. Firewall

bash
sudo ufw allow from <your-ip> to any port 22 proto tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

Never open 3000 or 5432. Docker's published ports bypass ufw, so the compose file publishes the app on 127.0.0.1:3000 only, and PostgreSQL not at all.

3. Get Kivo

bash
sudo mkdir -p /opt/kivo && sudo chown $USER /opt/kivo && cd /opt/kivo
curl -fsSL https://kivo-control.invicly.com/install/files/docker-compose.yml -o docker-compose.yml
curl -fsSL https://kivo-control.invicly.com/install/files/kivo.env -o .env && chmod 600 .env

4. Configure .env

Open .env (nano .env) and set at least these. Everything else has a sensible default and a comment.

bash
# What runs here: PostgreSQL in Docker, and Caddy for HTTPS
COMPOSE_PROFILES=db,https

# Address
KIVO_DOMAIN=<your-domain>
AUTH_URL=https://<your-domain>

# Secrets
AUTH_SECRET=change-me                    # openssl rand -base64 32 — keep it stable and backed up

# Database (the bundled PostgreSQL)
POSTGRES_PASSWORD=change-me              # openssl rand -hex 24

# Email
SMTP_HOST=<smtp-host>
SMTP_PORT=465
SMTP_SECURE=true                         # 465 = true; 587 = false (STARTTLS)
SMTP_USERNAME=<smtp-user>
SMTP_PASSWORD=change-me
SMTP_FROM_EMAIL=kivo@<your-domain>
SMTP_FROM_NAME=Kivo

# Kivo Control (already filled in)
KIVO_CONTROL_URL=https://kivo-control.invicly.com
KIVO_LICENSE_PUBLIC_KEYS="lic-2026-09:MCowBQYDK2VwAyEAzWdTL0qB3C7ZDkfbdcn0u4MADyzGFR9suPCuNkf8mbQ="
KIVO_INSTANCE_NAME=Production

KIVO_VERSION=1.0.0 picks the image version. In production Kivo refuses to start (exit code 78, each problem logged) if the database URL, AUTH_SECRET, the https:// address or email isn't set properly.

5. Start Kivo

bash
cd /opt/kivo
docker compose pull                                 # invicly/kivo, invicly/kivo-migrate, postgres, caddy
docker compose up -d
docker compose ps                                   # migrate: Exited (0); app: healthy; postgres, caddy: running
curl -fsS http://127.0.0.1:3000/api/health/ready    # {"status":"UP",...}

6. HTTPS

With https in COMPOSE_PROFILES, Caddy already serves https://<your-domain> with a Let's Encrypt certificate and renews it by itself. It needs the DNS record in place and ports 80 and 443 open. Check:

bash
docker compose logs caddy | grep -i certificate
curl -I https://<your-domain>

Your own proxy instead of Caddy

Set COMPOSE_PROFILES=db (without https), run docker compose up -d --remove-orphans, and point your proxy at 127.0.0.1:3000. With nginx and Certbot:

bash
sudo apt-get install -y nginx certbot python3-certbot-nginx
sudo tee /etc/nginx/sites-available/kivo > /dev/null <<'EOF'
server {
  listen 80;
  server_name <your-domain>;
  client_max_body_size 10m;

  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Request-ID $request_id;
  }
}
EOF
sudo ln -s /etc/nginx/sites-available/kivo /etc/nginx/sites-enabled/kivo
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d <your-domain> --redirect -m <admin-email> --agree-tos

Check renewal with sudo certbot renew --dry-run.

7. Create the first workspace and activate

Open https://<your-domain>/register, choose Create workspace, and enter the 6-digit code emailed to you — you're the owner. Then open Settings → License, paste your key and press Activate workspace (details).

Use a managed database

To use an external PostgreSQL 16 (Amazon RDS, Azure Database, Cloud SQL, DigitalOcean, a database server in your network…):

  1. Create a database kivo and a user that owns it; allow only this server's address.

  2. In .env, set the connection string (URL-encode special characters in the password) and drop db from the profiles:

    bash
    DATABASE_URL=postgresql://kivo:change-me@<db-host>:5432/kivo?sslmode=require
    COMPOSE_PROFILES=https
  3. docker compose up -d --remove-orphans. The migration job and the app both use DATABASE_URL, and the bundled PostgreSQL doesn't start.

Start on boot

Every service uses restart: unless-stopped, and Docker starts on boot, so Kivo comes back after a reboot on its own. Check with sudo systemctl is-enabled docker.

Next


Next