n8n is a workflow automation tool you can run in your own AWS account. Before any server is built, though, there is a question many guides skip: the licence. n8n is not released under a standard open-source licence, and what you may do with it depends on how you plan to use it. This guide starts there, then covers n8n’s official ways to run on AWS, the database, TLS, backups and updates. It follows n8n’s documentation and its official hosting repository, read on 4 December 2026.
n8n releases a new minor version most weeks and its guides change, so the linked pages are the source of truth. Where this article goes beyond n8n’s documentation, we say so.
The short version
- The licence is the Sustainable Use License. It is fine for running n8n for your own business. Selling n8n to others as a hosted service needs an agreement with n8n.
- n8n recommends Docker-based installs. From n8n 3.0 it is distributed only through Docker, and npm installs are no longer supported for new installs.
- For production, use PostgreSQL and put a reverse proxy with HTTPS in front. n8n says not to expose the n8n process directly to the internet.
- Queue mode is included in the free Community edition, but it needs Redis and PostgreSQL, and multi-main mode needs a paid plan.
- Back up the database and the encryption key. Without the key, stored credentials cannot be decrypted.
1. The licence comes first
n8n’s code is available under the Sustainable Use License, and it limits what you may do with it. It is not an OSI-approved open-source licence. These are the parts that matter, taken from the licence text:
What you may do. You may use or modify the software only for your own internal business purposes or for non-commercial or personal use. You may distribute it or provide it to others only if you do so free of charge for non-commercial purposes.
What that means in practice. Running n8n on your own AWS account to automate your own company’s work is within the licence. Offering n8n to other businesses as a paid hosted service is not, and needs a commercial agreement with n8n. The same goes for building a product that shows n8n’s interface to your users: n8n’s documentation says an OEM deployment requires a separate agreement with n8n, and gives license@n8n.io as the contact.
Enterprise files. Source files with “.ee.” in the file name or “.ee” in a folder name are not under the Sustainable Use License and need a valid n8n Enterprise licence.
n8n’s documentation also describes four self-hosted editions: Community (free, with almost the complete feature set), Registered Community (free, adds folders, debug in editor and custom execution data when you register your email), and the paid Business and Enterprise editions, which unlock a licence key. n8n lists features that need a paid plan, including SSO (SAML and LDAP), environments, projects, external secrets, Git-based version control, workflow and credential sharing, and multi-main mode. See Choose how to use n8n for the current list, and the n8n pricing page for the definitive one.
This is a plain-language summary and not legal advice. If your plan is anything other than running n8n for your own business, ask n8n and a lawyer before you build.
2. Cloud or self-hosted?
n8n offers its own hosted product, n8n Cloud, and is open about when each fits. Its documentation recommends Cloud if you want to start right away, do not have technical expertise, or do not want to manage infrastructure. It recommends self-hosting if you need full control over deployment, have customised use cases, or have infrastructure and technical resources to manage it. Its self-hosting pages also say that self-hosting requires technical knowledge, including setting up and configuring servers and containers, managing resources and scaling, securing servers and applications, and configuring n8n, and that mistakes can lead to data loss, security issues and downtime.
If you have the skills, or someone to help, self-hosting on AWS gives you control over where workflow data and credentials are stored. For the wider picture, see our guide to self-hosting open-source business apps on AWS.
3. n8n’s official ways to run on AWS
n8n documents several paths. Which one fits depends on how much you need to scale and what your licence includes.
- One-line setup.
curl -fsSL https://get.n8n.io | shcreates ann8nfolder, writes the configuration, generates unique secrets, and starts n8n with Docker. It uses SQLite by default and also starts n8n Assistant support services. n8n’s guide says the bundled sandbox is for development and testing, runs a privileged Docker-in-Docker container, and should run on a dedicated machine and never be exposed to the internet. Treat it as a quick start or evaluation, not a production design. - Docker Compose with PostgreSQL. n8n’s n8n-hosting repository holds official Compose files: n8n with PostgreSQL, n8n with PostgreSQL plus Redis and a worker (queue mode), and n8n behind Caddy. This is the closest official match to a single EC2 server.
- Kubernetes on Amazon EKS. n8n’s Deploy to AWS guide uses EKS with PostgreSQL. n8n says Kubernetes adds complexity but is the best method for scaling n8n as demand changes.
- High availability. n8n’s Deploy to AWS with Terraform guide describes a multi-main deployment with managed PostgreSQL, Redis and autoscaling workers. The hosting repository also has AWS CloudFormation templates for ECS Fargate with RDS PostgreSQL, ElastiCache Redis, S3 and an Application Load Balancer. Its README notes these templates use Enterprise-licensed features (multi-main and S3 external storage), so the stack will not start without a valid licence key.
n8n also publishes a video on the one-line setup from its own channel. It shows a local install, with n8n Assistant, not an AWS server, so use it to see what the script does.
The rest of this guide follows the single-server Docker Compose path, with the points that apply when you move to queue mode or larger setups.
4. Requirements and sizing
n8n’s production requirements page says:
- Use a 64-bit Linux host for production.
- Docker installations include the right Node.js version. Docker Engine and the Docker Compose v2 plugin are needed for the Compose setups.
- Keep a persistent volume for n8n’s data directory, which holds the encryption key, and for PostgreSQL data if you run it yourself.
- Don’t expose the n8n process directly to the internet. Put a reverse proxy or load balancer in front.
About memory and CPU. n8n’s Docker Compose guide asks for at least 4 GB of RAM and 2 vCPUs. That guide builds the n8n Assistant sandbox stack, whose Docker-in-Docker runner needs more headroom than a typical container, so it is not a minimum for n8n alone. We could not find a broader minimum for plain n8n with PostgreSQL in n8n’s documentation. Our suggestion, not n8n’s: start with an EC2 instance that meets that 2 vCPU, 4 GB figure so you have headroom, and watch real usage. Compare options on the AWS instance types page, and use an EBS volume for Docker data.
5. Install on a single EC2 server
These steps follow the README of n8n’s official withPostgres Compose example. Our AWS additions are marked.
- Launch the server. (Our addition.) Launch a Linux EC2 instance and set its security group so that only your proxy, or your own addresses, can reach port 5678. Then install Docker Engine with the Compose plugin.
- Get n8n’s hosting files.
git clone https://github.com/n8n-io/n8n-hosting.git, then change ton8n-hosting/docker-compose/withPostgres. - Change the default secrets. The README says to change the default users and passwords in the
.envfile before you start. The file sets the PostgreSQL user, password and database, a separate non-root PostgreSQL user for n8n, a runners authentication token, andN8N_VERSION. Check n8n’s update page for the current stable version before you start. It showed 3.4.3 on 4 December 2026, and the example file pinned 3.4.2. - Start it.
docker compose up -dstarts PostgreSQL, n8n and an n8n task runner. Stop it withdocker compose stop. - Set your public address. See section 8. The example publishes port 5678 on the host, so the security group matters.
The example uses a non-root PostgreSQL user for n8n. n8n’s AWS guide gives the reason: the root user has full control, while n8n only needs the permissions of a separate user, which helps prevent accidental changes to the database system. The PostgreSQL image’s data directory is pinned in the compose file. The README says not to remove that line, or an existing volume will look like an empty database.
6. PostgreSQL
n8n uses SQLite by default, and supports PostgreSQL, which n8n recommends for production and which its hosting repository calls the recommended database for production. n8n’s database page says:
- Supported versions: the latest two actively maintained PostgreSQL majors (17 and 18, as of July 2026), plus one older major for compatibility (16). n8n says PostgreSQL 16 support ends when PostgreSQL 19.1 is released, expected in February 2027, so plan for 17 or newer.
- Amazon Aurora PostgreSQL is experimental. n8n does not test or certify it. n8n does not support other PostgreSQL-compatible derivatives such as AlloyDB, CockroachDB or YugabyteDB.
- MySQL and MariaDB are not supported as the n8n backend from n8n 2.0.
- Settings:
DB_TYPE=postgresdbplusDB_POSTGRESDB_HOST,_PORT,_DATABASE,_USERand_PASSWORD, with optional SSL settings for the connection.
Where PostgreSQL runs is up to you. The Compose example runs it in a container on the same server. On AWS you can instead point n8n at Amazon RDS for PostgreSQL, which n8n’s own CloudFormation templates do. If you do, use a PostgreSQL major version from the supported list above. Even with PostgreSQL, n8n still recommends persisting the .n8n folder, because it holds encryption keys and logs.
7. Queue mode: only when you need it
n8n’s queue mode lets you scale out: a main instance receives triggers and webhooks, Redis holds the queue of pending executions, and worker instances run the workflows and write results to the database. The documentation lists the points that matter:
- Queue mode is included in the Community edition, but multi-main mode is on the list of features that need a paid plan.
- It needs Redis and PostgreSQL. If Redis loses queued jobs, n8n does not rebuild them from PostgreSQL. It marks the affected executions as crashed. Configure Redis persistence to match how much lost work you can accept.
- The main instance, workers and any webhook processors must share the same encryption key and run the same n8n version.
- In queue mode, binary data is stored in the database by default. External S3 storage is a licensed feature. If you use filesystem storage, every process that handles binary data needs the same shared volume.
Our view: a single instance with PostgreSQL is a sensible start for many teams. Move to queue mode when one instance cannot keep up with executions, and check your licence before you design around multi-main or S3 storage.
8. Domain, HTTPS and security
n8n’s production requirements and security checklist say:
- Create a DNS record for a hostname such as
n8n.example.comthat points at your load balancer or reverse proxy. - Use that hostname in
N8N_HOST(the hostname), and inN8N_EDITOR_BASE_URLandN8N_WEBHOOK_URL(full URLs such ashttps://n8n.example.com/). - Behind a reverse proxy, also set
N8N_PROXY_HOPSso n8n knows whether to trust forwarded headers for client IP and protocol. - Provision a TLS certificate and terminate TLS at the reverse proxy or load balancer, with HTTP redirected to HTTPS. TLS 1.2 or later with a valid certificate is on the checklist.
- Open only the ports you need. Services that call your webhooks must be able to reach the webhook URLs.
- Set a strong random
N8N_ENCRYPTION_KEY, back it up somewhere other than the instance, and never change it on an existing database, because n8n then stops starting. n8n suggestsopenssl rand -hex 32to generate one. - Don’t use the instance owner account for regular work, remove inactive users, and disable the public REST API if nobody uses it.
On AWS (our suggestions): the cleanest setup is an Application Load Balancer with a certificate from AWS Certificate Manager, forwarding to port 5678, with the instance’s security group accepting that port only from the load balancer. Alternatively, run a reverse proxy such as Caddy on the instance; n8n’s hosting repository includes a Caddy example.
9. Backups and restores
n8n’s backup guide says a complete backup has two parts: the .n8n user folder, which holds the config file with the credential encryption key, and your PostgreSQL database, backed up with PostgreSQL’s own tools. In Docker the folder lives in the n8n_data volume at /home/node/.n8n. If you use external storage for binary data, or custom node folders, include those as well.
You can also export workflows and credentials with the n8n CLI:
n8n export:workflow --backup --output=backups/workflows/
n8n export:credentials --backup --output=backups/credentials/
Use a different output folder for each command. The guide notes that, if n8n runs in Docker, the backup folder is not persisted unless you bind-mount a host directory or copy the files out. Exports contain only workflows and credentials, so they are not a full backup. To restore credentials, the new instance needs the same encryption key, or you must export with --decrypted, which writes credentials in plain text and needs very careful handling.
A full restore, per the guide: stop n8n, restore the .n8n folder, restore the PostgreSQL database, then restore your deployment configuration, including the database connection settings and a custom N8N_ENCRYPTION_KEY if you use one.
On AWS (our suggestions): copy database dumps and the exported files to a private Amazon S3 bucket with encryption and versioning, take regular EBS snapshots, and keep the encryption key in a separate secure place. Test a restore before you rely on it.
10. Updates
n8n’s update guide recommends this routine:
- Take a full backup first, including the database and the encryption key. If n8n cannot revert a database migration that an update applies, you need the backup to go back.
- Read the release notes for every version between your current one and the target.
- Pin a specific image tag rather than using
latest, and run the same version on every main process, worker and webhook processor. - Use the
stableversion for production.betais the newest release and may be unstable. On 4 December 2026 n8n’s docs showed stable 3.4.3 and beta 3.5.2.
If you installed with the one-line script, n8n’s guide gives curl -fsSL https://get.n8n.io | sh -s -- --upgrade for upgrades. If you are moving from n8n 2.x to 3.x, n8n’s hosting repository notes that you should read the 3.0 breaking changes, open the Migration Report under Settings, and take a backup first.
11. An alternative to know about: Activepieces
If the Sustainable Use License does not suit your plans, Activepieces is a workflow automation tool in the same space. Its repository had 25,861 stars on 4 December 2026. The core is under the MIT licence, with the packages/ee/ folder and some server code under a separate enterprise licence, so read its licence file for the exact split. Activepieces’ self-hosting guide recommends Docker Compose with PostgreSQL and Redis, says it needs at least 2 vCPU and 4 GB of RAM, and offers a one-command install. It is a different product, so check that it covers the integrations and workflows you need before you commit. We will cover it in its own guide.
12. How IHA Cloud can help
IHA Cloud can set up and manage n8n in your AWS account. You keep your workflows, data and AWS bill, and we handle the routine work. Our help is set-up and operations work in your own account for your own business use. It does not involve reselling n8n. That can include:
- Setup. A server, storage, domain and HTTPS built from n8n’s official Docker setup. See application and web hosting.
- PostgreSQL and backups. A supported PostgreSQL setup, dumps to S3 and restore checks. See database management and migration.
- Updates and operations. Backup before each update, version pinning and monitoring. See DevOps as a service.
- Security review. Network exposure, encryption keys, user access and webhook paths. See security audit.
Not sure which path fits, or whether your licence plan is covered? Ask for a free consultation.
13. Checklist before you go live
- You have read the licence and your use is within it, or you have an agreement with n8n.
- PostgreSQL runs on a supported version, with a non-root user for n8n.
N8N_ENCRYPTION_KEYis set, backed up elsewhere and not going to change.- n8n sits behind HTTPS, with the host, editor URL, webhook URL and proxy settings correct.
- Only the ports and addresses you intend can reach it.
- A backup runs, is copied off the server, and you have restored from it once.
- The n8n version is pinned and someone owns updates.
Related reading: Self-Host Open-Source Business Apps on AWS, How to Self-Host Twenty CRM on AWS and Best Open Source Applications.
IHA Cloud is a brand of Team IHA INC. This guide summarises n8n’s official documentation, licence text and hosting repository as read on 4 December 2026. It is not legal advice and not a substitute for n8n’s documentation. Versions, requirements and licence terms change, so check the linked pages before you run anything. n8n is a trademark of its owner.