Install Kivo

Google Cloud

Compute Engine with Cloud SQL for PostgreSQL.

Run Kivo on a Compute Engine VM with Docker Compose. PostgreSQL runs either on the VM or in Cloud SQL for PostgreSQL. DNS can be in Cloud DNS, and HTTPS comes from Caddy or nginx with Let's Encrypt.

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

What you'll create

ResourceExample
Static external IPkivo-ip
Ubuntu 24.04 VM, e2-medium suggestedkivo-vm
Firewall rule for HTTP and HTTPSkivo-allow-web
Optional: Cloud SQL for PostgreSQL 16kivo-db

You'll need the gcloud CLI with a project selected (gcloud config set project <project-id>), a domain, and SMTP credentials.

Create the VM

bash
gcloud compute addresses create kivo-ip --region=<region>
gcloud compute addresses describe kivo-ip --region=<region> --format='value(address)'   # <vm-ip>

gcloud compute instances create kivo-vm --zone=<zone> \
  --machine-type=e2-medium \
  --image-family=ubuntu-2404-lts-amd64 --image-project=ubuntu-os-cloud \
  --boot-disk-size=30GB --boot-disk-type=pd-balanced \
  --address=kivo-ip --tags=kivo-web

Firewall rules

bash
gcloud compute firewall-rules create kivo-allow-web --network=default \
  --direction=INGRESS --allow=tcp:80,tcp:443 --target-tags=kivo-web --source-ranges=0.0.0.0/0

The default network already allows SSH (default-allow-ssh). Narrow it to your address, or use gcloud compute ssh --tunnel-through-iap. Never open 3000 or 5432.

DNS

Add an A record for <your-domain> pointing at <vm-ip>. With Cloud DNS:

bash
gcloud dns record-sets create <your-domain>. --zone=<dns-zone-name> --type=A --ttl=300 --rrdatas=<vm-ip>

Install Docker and Docker Compose

bash
gcloud compute ssh kivo-vm --zone=<zone>

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 && exit

Get and configure Kivo

bash
gcloud compute ssh kivo-vm --zone=<zone>

Then download the two files:

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

Edit .env (nano .env):

bash
COMPOSE_PROFILES=db,https              # see PostgreSQL below
KIVO_DOMAIN=<your-domain>
AUTH_URL=https://<your-domain>
AUTH_SECRET=change-me                 # openssl rand -base64 32
SMTP_HOST=<smtp-host>
SMTP_PORT=465
SMTP_SECURE=true
SMTP_USERNAME=<smtp-user>
SMTP_PASSWORD=change-me
SMTP_FROM_EMAIL=kivo@<your-domain>
SMTP_FROM_NAME=Kivo
KIVO_INSTANCE_NAME=Kivo on Google Cloud
KIVO_CONTROL_URL=https://kivo-control.invicly.com
KIVO_LICENSE_PUBLIC_KEYS="lic-2026-09:MCowBQYDK2VwAyEAzWdTL0qB3C7ZDkfbdcn0u4MADyzGFR9suPCuNkf8mbQ="

Compute Engine blocks outbound port 25; ports 465 and 587 work.

PostgreSQL

Option A: on the VM

bash
POSTGRES_USER=kivo
POSTGRES_PASSWORD=change-me           # openssl rand -hex 24
POSTGRES_DB=kivo

Keep COMPOSE_PROFILES=db,https. The compose file publishes the app on 127.0.0.1:3000 only.

Option B: Cloud SQL for PostgreSQL

bash
gcloud sql instances create kivo-db --database-version=POSTGRES_16 \
  --edition=ENTERPRISE --tier=db-custom-1-3840 --region=<region> \
  --storage-auto-increase --backup-start-time=02:00 --enable-point-in-time-recovery \
  --authorized-networks=<vm-ip>/32 --ssl-mode=ENCRYPTED_ONLY

gcloud sql databases create kivo --instance=kivo-db
gcloud sql users create kivo --instance=kivo-db --password='change-me'
gcloud sql instances describe kivo-db --format='value(ipAddresses[0].ipAddress)'   # <cloud-sql-ip>

For traffic that never leaves Google's network, give the instance a private IP in the VM's VPC (--network with private services access) instead of authorized networks.

Add to .env:

bash
DATABASE_URL=postgresql://kivo:change-me@<cloud-sql-ip>:5432/kivo?sslmode=require

And set COMPOSE_PROFILES=https, so the bundled PostgreSQL doesn't start (details).

Start Kivo

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

HTTPS

With https in COMPOSE_PROFILES, the bundled Caddy serves https://<your-domain> with a Let's Encrypt certificate and renews it by itself, as soon as the DNS record points at the server and ports 80 and 443 are open. Check with docker compose logs caddy and curl -I https://<your-domain>.

To use nginx and Certbot or your own proxy instead, remove https from COMPOSE_PROFILES: Your own proxy.

With an external HTTPS load balancer in front instead, remove https from the profiles, set APP_BIND=0.0.0.0 (and allow port 3000 only from Google's load balancer ranges), keep TRUSTED_PROXY_HOPS=1 if only the load balancer appends to X-Forwarded-For, and use /api/health/ready as its health check.

Open https://<your-domain>/register and create the first workspace.

Backup

  • Option A: a nightly pg_dump (Backup) copied to Cloud Storage. Give the VM's service account write access to the bucket, then:

    bash
    gcloud storage cp /var/backups/kivo/kivo-$(date +%F).dump gs://<backup-bucket>/kivo/

    A snapshot schedule on the boot disk adds disk-level copies (gcloud compute resource-policies create snapshot-schedule).

  • Option B: Cloud SQL keeps daily backups and point-in-time recovery (turned on above). Take an on-demand backup before updates: gcloud sql backups create --instance=kivo-db.

  • Keep .env (with AUTH_SECRET) in Secret Manager or another safe place.

Updates

bash
cd /opt/kivo
sed -i 's/^KIVO_VERSION=.*/KIVO_VERSION=<new-version>/' .env
docker compose pull
docker compose up -d

Back up first. Compose runs the new invicly/kivo-migrate before the new app starts.

Connect to Kivo Control and activate

The server needs outbound HTTPS to https://kivo-control.invicly.com (allowed by default). Make sure .env has:

bash
KIVO_CONTROL_URL=https://kivo-control.invicly.com
KIVO_LICENSE_PUBLIC_KEYS="lic-2026-09:MCowBQYDK2VwAyEAzWdTL0qB3C7ZDkfbdcn0u4MADyzGFR9suPCuNkf8mbQ="

Then sign in as the owner, open Settings → License, paste your key and press Activate workspace. The workspace appears under Installations in your Kivo Control portal. More: Connect & activate.


Next