Before you begin
- Install the Upsun CLI.
-
Run the following commands to log in and connect the current Git repository to the correct Upsun project. Replace
<PROJECT_ID>with your project ID (runupsun projectsto list them).
1. Configure n8n as an app
Add the following configuration to.upsun/config.yaml.
- This configuration uses the startup command defined by the image. The official n8n image already starts n8n and listens on
0.0.0.0:5678, so this example does not setweb.commands.startto override it. - The
/home/nodemount contains n8n’s SQLite database, configuration, credentials, and cache. Mounting the full home directory ensures both.n8nand.cacheare writable and persistent. HIGH_MEMORYis a container profile — a preset ratio of memory to CPU. Choose the profile that matches n8n’s actual resource needs.
2. Set or update the n8n encryption key
SetN8N_ENCRYPTION_KEY as a sensitive runtime environment variable instead of committing it to .upsun/config.yaml.
-
Generate a long random value for the encryption key:
-
Use the generated value in place of
<LONG_RANDOM_ENCRYPTION_KEY>:
N8N_ENCRYPTION_KEY variable already exists, update it:
3. Deploy the app
Commit the changes to.upsun/config.yaml and push them to Upsun:
4. Allocate n8n resources
The first deployment defaults to a minimal resource allocation regardless of app type (0.5 CPU, 512 MB disk, and 1408 MB memory). That’s enough to boot n8n and run small workflows, but workflow concurrency, execution history, and binary data can require more resources. Set a baseline for the app:container_profile: HIGH_MEMORY, the n8n app gets 1 CPU, about 2 GB RAM, 2 GB disk, and one instance. Increase CPU and memory for concurrent or memory-intensive workflows, and increase the disk size as execution history and binary data grow.
If you changed resources after the app was already deployed, redeploy the environment:
5. Set the public URLs
List the routes and copy the HTTPS hostname mapped to then8n app:
<N8N_HOSTNAME> with that hostname, without a path:
Preview environment URLs are ephemeral by default, so
<N8N_HOSTNAME> changes with every new preview environment. If external services need a stable webhook URL, set up a custom domain for the environment.6. Validate the deployment
List the routes and confirm that the HTTPS route mapped to then8n app appears. You’ll use its hostname in place of <N8N_HOSTNAME> in the next step.
<N8N_HOSTNAME> with the hostname for the n8n app:
https://<N8N_HOSTNAME>/ to create the n8n owner account.
If the health check doesn’t return this, or you run into other issues deploying the app, debug the app over SSH to check /var/log/app.log and the container’s process state.
Updating the image version
To use a different n8n version, update the version inimage.name:
Limitations
-
This configuration uses SQLite and one n8n instance, so it can’t handle high workflow volume and provides no redundancy during restarts, deployments, or instance failures.
Don’t fix this by increasing instance count alone:
storagemounts are shared between instances of the same app, so multiple instances would write to the same SQLite file concurrently — something SQLite can’t handle safely. To scale horizontally and gain high availability, switch to queue mode: PostgreSQL for shared state, Valkey (Upsun’s Redis-compatible service) for the job queue, and separate worker instances. Until then, schedule redeploys during low-traffic windows and design workflows to tolerate an interrupted execution being retried.
Operational considerations
- Backups: Production environments back up automatically with only 2 days of retention by default, and non-production environments aren’t backed up at all. Since this configuration has no external database, that backup is the only copy of your workflows, credentials, and execution history — consider a longer retention policy and n8n’s own execution-data pruning settings to limit how much there is to back up.
- Monitoring/alerts: Upsun has no built-in alerting. Forward n8n’s logs to an external tool via log forwarding, or use Blackfire for performance profiling, then alert from whatever tool receives that data.
- SMTP: n8n needs an SMTP provider for workflow notification emails. You can optionally use Upsun’s built-in SMTP proxy instead of a third-party provider — preview environments are limited to 12,000 email credits per calendar month.
Related
- n8n is commonly used to orchestrate AI agent workflows. If those workflows need to manage Upsun infrastructure itself (for example, triggering deploys or querying environment status from an agent), see the Upsun MCP Server.