Host n8n on Cloud Run
Deploy a production-ready n8n instance to Google Cloud Run in one command.
Prerequisites
- advncd installed and authenticated (
advncd login) - A GCP project (advncd can create one for you)
Quick deploy
advncd n8n --set-default
advncd will:
- Ask you to pick or create a GCP project
- Ask you to pick a region
- Ask whether to attach external Postgres
- Ask whether to set a stable
N8N_ENCRYPTION_KEY - Deploy n8n to Cloud Run with safe defaults
- Enable public access and print the URL
--set-default saves the project/region as your default — future advncd n8n --redeploy calls use it.
Redeploy
After the first deploy, update or restart with:
advncd n8n --redeploy
To upgrade to a newer n8n image:
advncd n8n --redeploy --image n8nio/n8n:latest
Production setup (with Postgres)
For production use, attach external Postgres so workflows and credentials survive redeployments.
Recommended providers: Supabase, Neon, Cloud SQL.
advncd n8n \
--project my-n8n-project \
--region europe-west3 \
--set-default \
--db-url "postgresql://USER:PASSWORD@HOST:5432/postgres?sslmode=require" \
--db-schema public \
--db-ssl-reject-unauthorized=false \
--encryption-key "your-stable-32-char-secret-here"
The N8N_ENCRYPTION_KEY encrypts stored credentials in n8n. If you lose it, all saved credentials in n8n become unreadable. Store it somewhere safe (password manager, secret manager).
If you don't provide one, advncd will offer to auto-generate one — copy it before proceeding.
Non-interactive deploy
Skip all prompts with explicit flags:
advncd n8n \
--project my-n8n-prod \
--region europe-west3 \
--set-default
Create a new GCP project in the same command:
advncd n8n \
--project my-n8n-prod \
--project-name "My n8n Production" \
--create-project \
--region europe-west3 \
--set-default
What advncd configures
advncd sets these environment variables automatically for Cloud Run compatibility:
| Variable | Value | Purpose |
|---|---|---|
N8N_ENDPOINT_HEALTH | /healthz | Cloud Run health check |
N8N_LISTEN_ADDRESS | 0.0.0.0 | Required for containers |
N8N_PUSH_BACKEND | sse | Stable editor connectivity |
N8N_PROXY_HOPS | 1 | Correct IP behind Cloud Run proxy |
N8N_EDITOR_BASE_URL | service URL | Correct link generation |
WEBHOOK_URL | service URL | Webhook delivery |
CPU throttling is disabled by default (--no-cpu-throttling=true) — this prevents n8n workflows from stalling between requests.
Default resources
| Setting | Default |
|---|---|
| Image | n8nio/n8n:1.86.0 |
| Memory | 2Gi |
| Min instances | 1 |
| Port | 5678 |
| CPU throttling | disabled |
Increase memory for large workflows:
advncd n8n --redeploy --memory 4Gi
Check your deployment
# List services
advncd services
# Open n8n in the browser
advncd services open n8n
# View logs
advncd services logs n8n