Skip to Content
DeploymentGoogle Cloud Run

Deploy on Google Cloud Run

This guide walks through deploying auxilia on Google Cloud Run with Cloud SQL (PostgreSQL) and Memorystore (Redis).

Prerequisites

  • A Google Cloud project with billing enabled
  • gcloud CLI  installed and authenticated
  • Docker installed locally (or use Cloud Build as shown below)

1. Set up Cloud SQL

gcloud sql instances create auxilia-db \ --database-version=POSTGRES_17 \ --tier=db-f1-micro \ --region=us-central1 gcloud sql databases create auxilia \ --instance=auxilia-db gcloud sql users set-password postgres \ --instance=auxilia-db \ --password=YOUR_DB_PASSWORD

2. Set up Memorystore (Redis)

gcloud redis instances create auxilia-redis \ --size=1 \ --region=us-central1 \ --redis-version=redis_7_0

Note the IP address from the output — you’ll use it for REDIS_HOST.

3. Build and push images

export PROJECT_ID=your-project-id export REGION=us-central1 gcloud builds submit backend/ \ --tag ${REGION}-docker.pkg.dev/${PROJECT_ID}/auxilia/backend gcloud builds submit web/ \ --tag ${REGION}-docker.pkg.dev/${PROJECT_ID}/auxilia/web

4. Deploy the backend

gcloud run deploy auxilia-backend \ --image ${REGION}-docker.pkg.dev/${PROJECT_ID}/auxilia/backend \ --region ${REGION} \ --platform managed \ --allow-unauthenticated \ --set-env-vars "DATABASE_URL=postgresql+psycopg://postgres:YOUR_DB_PASSWORD@/auxilia?host=/cloudsql/${PROJECT_ID}:${REGION}:auxilia-db" \ --set-env-vars "REDIS_HOST=REDIS_IP" \ --set-env-vars "REDIS_PORT=6379" \ --set-env-vars "JWT_SECRET_KEY=your-jwt-secret" \ --set-env-vars "SALT=your-encryption-salt" \ --set-env-vars "COOKIE_SECURE=true" \ --set-env-vars "FRONTEND_URL=https://auxilia-web-HASH.run.app" \ --set-env-vars "ANTHROPIC_API_KEY=sk-ant-..." \ --add-cloudsql-instances ${PROJECT_ID}:${REGION}:auxilia-db \ --vpc-connector auxilia-connector

Migrations (alembic upgrade head) run automatically when the container starts.

5. Deploy the web

gcloud run deploy auxilia-web \ --image ${REGION}-docker.pkg.dev/${PROJECT_ID}/auxilia/web \ --region ${REGION} \ --platform managed \ --allow-unauthenticated \ --set-env-vars "BACKEND_URL=https://auxilia-backend-HASH.run.app"

6. VPC connector

Both services need network access to Memorystore through a VPC connector:

gcloud compute networks vpc-access connectors create auxilia-connector \ --region ${REGION} \ --range 10.8.0.0/28

Attach --vpc-connector auxilia-connector to both services.

7. Custom domain

Map a custom domain to the web service:

gcloud run domain-mappings create \ --service auxilia-web \ --domain auxilia.example.com \ --region ${REGION}

Update FRONTEND_URL on the backend to the new domain.

Notes on Cloud Run sizing

  • The backend keeps a persistent OAuth token cache in Redis, so you can scale instances to zero safely
  • LangGraph checkpoints live in Postgres, not in process memory, so scaling up horizontally is fine
  • Remember that Cloud Run request timeout caps streaming responses — use at least --timeout=3600 if you expect long agent runs