Skip to navigationSkip to main contentSkip to footerScaleway Docs HomepageAsk our AI
Ask our AI

Deploying n8n on Serverless Containers

n8n
workflow
serverless
containers

This tutorial provides a step-by-step guide for deploying n8n, an open-source workflow automation platform, on the Scaleway cloud platform. It covers the process of setting up the required infrastructure, including Serverless Containers and a Managed Database, to configure and run n8n for workflow automation.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization

Create a PostgreSQL Managed Database

n8n requires a database for persistent storage of workflows, executions, and configuration data.

  1. In the Scaleway console side menu, go to Databases > PostgreSQL and MySQL.
  2. Click Create Database Instance.
    1. Select the region for your Database Instance.
    2. Select PostgreSQL.
    3. Select a node type suitable for your needs (DB-PLAY2-PICO is sufficient for testing).
    4. Enter a default username and password for the database. You will use these credentials to connect n8n to the database.
    5. Enter the name n8n for the Database Instance.
  3. Click Create Database Instance. The database instance overview appears. It is ready to use after a few minutes.
  4. Go to the Private Networks tab and click Attach to Private Network.
  5. Select an existing Private Network or create a new one, then click Attach to Private Network.

Store the database private host IP, username, and password securely. You will need these credentials to configure n8n environment variables.

Deploy n8n on Serverless Containers

You can deploy n8n using either the Scaleway Console or the scw CLI. This guide uses the Console.

  1. In the Scaleway console side menu, go to Serverless Compute > Containers

  2. Click Create namespace:

    1. Enter a name for the namespace (for example, ns-automation-tools).
    2. Select the same region as your Database Instance.
  3. Click Create namespace and add container.

    • Select External image
    • Image: docker.io/n8nio/n8n:latest
    • Port: 5678
    • CPU: At least 500 mVCPU
    • Memory: At least 1024 MB (n8n requires more resources than a simple API)
    • Minimum instances: 1 (to avoid cold starts)
  4. In Advanced options > Data > Environment Variables, add the following variables. Replace the placeholders with the appropriate values.

    VariableValueDescription
    DB_TYPEpostgresdbSpecifies PostgreSQL engine
    DB_POSTGRESDB_HOST<your-database-private-ip>Private Network IP of PostgreSQL
    DB_POSTGRESDB_PORT5432PostgreSQL port
    DB_POSTGRESDB_DATABASEn8nDatabase name
    DB_POSTGRESDB_USER<your-database-username>Database username
    N8N_WEBHOOK_URLhttps://<your-container-endpoint>/Public URL for webhooks and OAuth redirects
    N8N_PROXY_HOPS1Informs n8n it runs behind Scaleway's proxy

    Or click JSON and copy these values:

    {
      "DB_TYPE": "postgresdb",
      "DB_POSTGRESDB_HOST": "<your-database-private-ip>",
      "DB_POSTGRESDB_PORT": "5432",
      "DB_POSTGRESDB_DATABASE": "n8n",
      "DB_POSTGRESDB_USER": "<your-database-username>",
      "N8N_WEBHOOK_URL": "https://<your-container-endpoint>/",
      "N8N_PROXY_HOPS": "1"
    }
  5. In Advanced options > Data > Secrets, add the following secrets. Replace the placeholders with the appropriate values.

    SecretValueDescription
    DB_POSTGRESDB_PASSWORD<your-database-password>PostgreSQL user password
    N8N_ENCRYPTION_KEY<random-32-char-string>Key used to encrypt stored credentials

    Or click JSON and copy these values:

    {
      "DB_POSTGRESDB_PASSWORD": "<your-database-password>",
      "N8N_ENCRYPTION_KEY": "<random-32-char-string>"
    }
    Tip

    For advanced configuration options and additional environment variables, refer to the n8n official documentation.

    Important

    Store sensitive values like database passwords, encryption keys, and API secrets as secrets rather than plain environment variables. Secrets are encrypted and never exposed in logs.

  6. In Advanced options > Private Networks, select the same Private Network you attached to your PostgreSQL Managed Database so the container can reach the database.

  7. Click Deploy container. The container is deployed and starts running.

Access n8n

After the container is deployed and running:

  1. Navigate to the Endpoints tab of your container.
  2. Copy the endpoint URL and open it in your web browser.
  3. You will be prompted to create an admin account for n8n on first access.

Next steps

After successfully deploying n8n, you can:

  • Create your first workflow using the n8n editor
  • Explore the n8n template library for pre-built automations
  • Configure webhooks to trigger workflows from external services
  • Set up credentials for secure API integrations
  • Monitor execution history and logs in the n8n dashboard
Questions?

Visit our Help Center and find the answers to your most frequent questions.

Visit Help Center
No Results