Skip to content
flexcal Documentation

Google Cloud

Two reasonable shapes: Cloud Run with Cloud SQL, or a single Compute Engine VM running Docker Compose.

  1. Create a Cloud SQL for PostgreSQL instance.
  2. Deploy docker.io/flexcal/flexcal:dev to Cloud Run, container port 3000.
  3. Attach the Cloud SQL instance to the service and set DATABASE_URL accordingly.
  4. Set NEXT_PUBLIC_WEBAPP_URL, NEXTAUTH_SECRET and CALENDSO_ENCRYPTION_KEY.
  5. Map a custom domain to the service.

Cloud Run scales to multiple instances, so set SKIP_DB_MIGRATIONS=1 and SKIP_APP_STORE_SEED=1 and run migrations as a Cloud Run Job on each release.

In the GCP console, create a project, then a Compute Engine VM instance. Two vCPUs with 2–4 GB of RAM is enough to serve flexcal. Note the public IP.

Add a firewall rule allowing ingress on the ports your reverse proxy listens on (80 and 443).

Connect to the instance:

Terminal window
gcloud compute ssh --project=<PROJECT_ID> --zone=<ZONE> <INSTANCE_NAME>

Install and start Docker:

Terminal window
sudo apt-get update
sudo apt-get install docker.io docker-compose-plugin
sudo systemctl enable --now docker

Follow the Docker guide: clone the repository for its docker-compose.yml, fill in .env, and start the stack. Put a TLS-terminating reverse proxy (Caddy, nginx, or a Google load balancer) in front of port 3000.