Skip to main content

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:

  1. Ask you to pick or create a GCP project
  2. Ask you to pick a region
  3. Ask whether to attach external Postgres
  4. Ask whether to set a stable N8N_ENCRYPTION_KEY
  5. Deploy n8n to Cloud Run with safe defaults
  6. 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"
Keep your encryption key

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:

VariableValuePurpose
N8N_ENDPOINT_HEALTH/healthzCloud Run health check
N8N_LISTEN_ADDRESS0.0.0.0Required for containers
N8N_PUSH_BACKENDsseStable editor connectivity
N8N_PROXY_HOPS1Correct IP behind Cloud Run proxy
N8N_EDITOR_BASE_URLservice URLCorrect link generation
WEBHOOK_URLservice URLWebhook delivery

CPU throttling is disabled by default (--no-cpu-throttling=true) — this prevents n8n workflows from stalling between requests.


Default resources

SettingDefault
Imagen8nio/n8n:1.86.0
Memory2Gi
Min instances1
Port5678
CPU throttlingdisabled

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