Deploying n8n on 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.
- In the Scaleway console side menu, go to Databases > PostgreSQL and MySQL.
- Click Create Database Instance.
- Select the region for your Database Instance.
- Select PostgreSQL.
- Select a node type suitable for your needs (DB-PLAY2-PICO is sufficient for testing).
- Enter a default username and password for the database. You will use these credentials to connect n8n to the database.
- Enter the name
n8nfor the Database Instance.
- Click Create Database Instance. The database instance overview appears. It is ready to use after a few minutes.
- Go to the Private Networks tab and click Attach to Private Network.
- 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.
-
In the Scaleway console side menu, go to Serverless Compute > Containers
-
Click Create namespace:
- Enter a name for the namespace (for example,
ns-automation-tools). - Select the same region as your Database Instance.
- Enter a name for the namespace (for example,
-
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)
-
In Advanced options > Data > Environment Variables, add the following variables. Replace the placeholders with the appropriate values.
Variable Value Description 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" } -
In Advanced options > Data > Secrets, add the following secrets. Replace the placeholders with the appropriate values.
Secret Value Description 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>" } -
In Advanced options > Private Networks, select the same Private Network you attached to your PostgreSQL Managed Database so the container can reach the database.
-
Click Deploy container. The container is deployed and starts running.
Access n8n
After the container is deployed and running:
- Navigate to the Endpoints tab of your container.
- Copy the endpoint URL and open it in your web browser.
- 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
Visit our Help Center and find the answers to your most frequent questions.
Visit Help Center