Back · Hosting
hyperscaler

Microsoft Azure

Container Apps or VM on Azure.

Difficulty
Monthly cost from: ~$20–100+/mo
Best for: Microsoft-first orgs, MSA / Fabric shops.

Run n8n on Azure Container Instances or App Service for Containers, paired with Azure Database for PostgreSQL Flexible Server for production-grade persistence.

Pros

  • Azure AD SSO integration
  • Container Apps auto-scale
  • Managed Postgres Flexible Server

Cons

  • Portal complexity
  • Region availability varies

Prerequisites

  • An Azure subscription
  • Azure CLI installed
  • A resource group and virtual network plan
  • A domain with DNS you control

Step-by-step guide

  1. Step 1

    Provision PostgreSQL Flexible Server

    Create a Burstable B1ms tier instance to start.

  2. Step 2

    Deploy n8n on App Service for Containers

    Create a Web App for Containers using the n8nio/n8n image, and set the DB_* and N8N_* app settings.

    az webapp create --resource-group n8n-rg --plan n8n-plan --name my-n8n --deployment-container-image-name n8nio/n8n:latest
  3. Step 3

    Enable a custom domain + TLS

    Add a custom domain in App Service and enable the free managed certificate.

  4. Step 4

    Mount persistent storage

    Mount an Azure Files share to /home/node/.n8n so binary data and config survive restarts.

Scaling & queue mode

For queue mode, add Azure Cache for Redis and deploy a second container instance/App Service running `n8n worker`; scale the worker App Service plan out with autoscale rules based on CPU.

Backup & upgrade

Enable automated backups on PostgreSQL Flexible Server (7–35 day retention); upgrade n8n by updating the container image tag in App Service configuration and restarting.

Security checklist

  • Always run behind HTTPS (Caddy/Traefik/Nginx + Let's Encrypt) — never expose port 5678 directly.
  • Set a strong, permanent N8N_ENCRYPTION_KEY and back it up (losing it breaks stored credentials).
  • Use Postgres, not the default SQLite, for anything beyond local testing.
  • Enable N8N_BASIC_AUTH or an SSO/proxy layer if the instance is reachable from the internet.
  • Restrict inbound firewall rules to 80/443 (and SSH from your IP only).
  • Keep the n8n image pinned and update on a schedule instead of always using :latest in production.

Cost breakdown

  • App Service Plan (B1)~$13/mo
  • PostgreSQL Flexible (B1ms)~$25/mo

Troubleshooting & FAQ

+Can I use SQLite instead of Postgres?

n8n defaults to SQLite, which works for testing but isn't recommended for production: no concurrent writers, harder backups, and risk of corruption under load. Use Postgres for anything real.

+My webhooks return 404 / don't trigger — why?

WEBHOOK_URL must match the public HTTPS URL exactly (including trailing slash), and the workflow must be activated (not just saved) for production webhook URLs to work.

+How do I move from Microsoft Azure to another host later?

Export workflows/credentials with the n8n CLI (`n8n export:workflow --all` / `export:credentials --all`) or the REST API, restore the Postgres dump on the new host, then import.

+Do I lose data if the container restarts?

No, as long as n8n_data and the Postgres volume are mounted as named Docker volumes (not ephemeral container storage), your data persists across restarts and image updates.