Self-hosting n8n on AWS with EKS or ECS Fargate: when the platform choice matters
A team that must run n8n inside its own AWS accounts should choose the compute model based on how much Kubernetes operations it can staff, then place managed databases and caches beside it. In most cases the decision is between Amazon EKS for a team already running Kubernetes, and ECS on Fargate for a team that wants containers without cluster administration. EC2 remains an option when the team needs host-level control, but it moves patching and capacity work back onto the team. Whichever model is chosen, the database and queue sit outside the compute layer as managed services: Amazon RDS for PostgreSQL for workflow and execution data, and ElastiCache for Redis if queue mode is used.
n8n needs four pieces of infrastructure. A main instance serves the editor, runs triggers and receives webhooks. Optional worker processes execute workflows when queue mode is enabled. PostgreSQL stores workflows, credentials and execution records, and the default SQLite option is not a production choice. Storage for binary data, such as files that workflows pass between nodes, is the fourth piece. Queue mode is only needed when a single main instance cannot keep up with execution volume or when workers must scale separately from the editor. Before committing to Redis and a worker pool, teams should measure their expected concurrency and confirm that a single instance cannot meet it.
Queue mode adds more than a cache. The main instance passes executions through Redis to workers, and the encryption key must be shared with every worker and webhook processor so they can read stored credentials. Teams should plan how that key is injected into each compute task and who can read it. Multi-main high availability is restricted to Enterprise self-hosted deployments, so a Business or Community plan should not assume it. n8n is licensed under the Sustainable Use License, which permits internal business use but restricts distribution and some .ee files need an Enterprise License. Confirm these terms against the license file before the architecture is approved.
EKS, ECS Fargate or EC2: which compute model fits n8n
Amazon EKS suits teams that already run Kubernetes and want n8n managed like their other workloads. The n8n main instance, webhook processors and workers can each be deployed as separate workloads, which lets you scale the worker pool independently of the webhook path. Installing n8n with the official Helm chart is covered on the Kubernetes sibling page, so this tab focuses on the AWS decisions around it.
- Skills assumed: Kubernetes administration, Helm, IAM roles for service accounts, ingress controllers and certificate management.
- Process layout: The main instance handles triggers and webhooks, and workers pull executions from Redis in queue mode, so each role can be a separate Deployment with its own replica count.
- Scaling: Horizontal autoscaling can follow worker load, but you must confirm how your chosen autoscaler reads queue depth and set the minimum so scheduled triggers are not missed.
- Patching: Cluster version upgrades, node group rotation and n8n image updates each need a planned sequence, and n8n's own upgrade notes apply to every image change.
- Operational load: The control plane, add-ons and node groups add recurring work on top of n8n, so the platform team must own them.
Before choosing EKS, confirm that your team can operate the cluster after the first deployment, not only build it.
Amazon ECS on Fargate runs containers without you managing servers or cluster nodes. Each n8n role can be a separate ECS service built from the same image, with the main instance, workers and webhook processors defined as task definitions. This model fits teams that want container isolation and AWS-native deployment without Kubernetes expertise.
- Skills assumed: AWS networking (VPC subnets, security groups, load balancers), IAM task roles and ECS task definitions, with CloudFormation or Terraform for repeatable setup.
- Process layout: Each service gets its own task count, so workers and webhook processors can scale apart from the main instance, provided they share the encryption key and database settings.
- Scaling: Service auto scaling can use CloudWatch metrics, but you must choose metrics that reflect queue backlog and confirm the behavior in your own test.
- Patching: Image updates are rolled out by changing the task definition, and Fargate removes host patching from your scope, though n8n version changes still need review.
- Operational load: Lower than EKS for node management, but task definitions, secrets wiring and load balancer rules still need ownership and documentation.
Check whether the n8n CloudFormation example published by n8n matches the version you plan to run before you adopt it as a base.
Running n8n on EC2 gives the most direct control over the host, the operating system and the Docker runtime. It suits teams with strong Linux administration skills, a preference for fixed capacity, or a need to install host-level agents that Fargate does not allow. The operational work moves toward the team, because every host, patch cycle and scaling rule is yours to build.
- Skills assumed: Linux administration, Docker or systemd service management, Auto Scaling groups, AMI management and host hardening.
- Process layout: Main, worker and webhook processes run as separate containers or services on one or more instances, with the load balancer routing webhook traffic to the right target group.
- Scaling: Auto Scaling groups add instances, but the team must confirm how workers join and leave the pool without losing executions.
- Patching: Operating system patches, AMI rebuilds and n8n image updates all fall to your team and need a maintenance window.
- Operational load: The highest of the three options, because host security, backups of local state and capacity planning remain with you.
Ask your team to estimate the monthly hours it would spend on host patching and incident response before choosing EC2 over a managed container service.
The three options differ mainly in who operates the layer below n8n. On EKS, your team runs the cluster. On ECS Fargate, AWS runs the hosts and your team runs task definitions. On EC2, your team runs the hosts and the container runtime. n8n behaves the same on each model, so the choice depends on skills and on existing platform standards.
- Existing standards: Pick the option your organization already runs, unless a clear requirement points elsewhere.
- Team size and skills: A small team without Kubernetes experience usually carries less risk on ECS Fargate than on EKS.
- Scaling needs: Confirm how each option scales workers in response to queue backlog, using your own test workload rather than any published figure.
- Compliance evidence: Each model produces different records for change management and access, so plan the evidence before the build.
- Ongoing cost: Ask each option's proposal to list the recurring work by role, not only the infrastructure fees.
The next step is to run the same n8n workload on your shortlisted option in a test account and measure its behavior before deciding.
Which AWS component to use for each n8n role
This table compares the AWS options for each part of an n8n deployment: compute, PostgreSQL, Redis for queue mode and binary data storage. Read each row for the condition under which the option fits and the items your team must confirm before choosing it. The main takeaway is that the managed services reduce operational work, but the Redis license, PostgreSQL version support dates and your own backup and failover obligations still need to be checked before you commit.
| Role | Option | When it fits | What to confirm |
|---|---|---|---|
| Compute | EKS | Your platform team already runs Kubernetes and wants the official Helm chart, queue mode workers and standard ingress patterns. | Cluster upgrade ownership, ingress and TLS design, and whether your team can run worker scaling and secrets handling. |
| Compute | ECS Fargate | You want n8n containers without managing cluster nodes and your team does not operate Kubernetes. | Task sizing for main, webhook and worker roles, load balancer health checks, and how the encryption key is injected as a secret. |
| Compute | EC2 with Docker Compose | A small or single-instance deployment where one host is sufficient and the team wants direct control of the host. | Patching, backup of the host and volumes, and whether the setup will need queue mode later. |
| PostgreSQL | Amazon RDS for PostgreSQL | You want managed backups, patching and standby options without running the database engine yourself. | The PostgreSQL major version is still within its support window, the backup retention and point-in-time recovery settings, and the SSL requirement to the database. |
| PostgreSQL | Self-managed PostgreSQL on EC2 | Your team already operates PostgreSQL and needs control over extensions, replication topology or host configuration. | Failover tooling (PostgreSQL does not detect primary failure itself), tested restores, and who owns major upgrades. |
| Redis for queue mode | ElastiCache for Redis | Queue mode needs Redis for executions passed to workers, and the team prefers a managed cache service on AWS. | The Redis version and license terms in effect at deployment, since Redis 8 offers a choice among RSALv2, SSPLv1 and AGPLv3, and confirm any AWS-managed support terms. |
| Redis for queue mode | Self-managed Redis | The team needs a specific Redis build or configuration, or runs Redis on its own hosts for consistency with other workloads. | Sentinel or replica design for failover (Sentinel docs call for at least three Sentinel instances), persistence and patching ownership. |
| Binary data | Amazon S3 | Workflows handle files, and you want binary data kept outside the container filesystem so that workers and restarts do not lose it. | Bucket encryption, access policy from the n8n task role, lifecycle rules, and the n8n binary data configuration for your version. |
| Binary data | Local volumes | A single instance with modest file volume, where a persistent volume is simpler to operate than object storage. | Volume backup, sharing across workers if queue mode is used, and what happens to files when a task is replaced. |
| Deployment template | CloudFormation example published by n8n | You want a starting template for the AWS resources and want to review every resource before deployment. | Which resources the template creates, IAM and network scope, and changes needed to match your VPC, certificate and retention standards. |
Setup sequence for n8n on AWS with queue mode
This sequence takes an empty AWS account to a queue-mode n8n deployment where a webhook reaches the main instance, a worker runs the execution, and the result is stored in PostgreSQL. Each step ends with a check you can run before moving on.
Lay out the account and private network
Your cloud team creates the AWS account structure, a VPC with public subnets for the load balancer and private subnets for n8n, PostgreSQL, Redis and workers, and NAT egress for outbound calls. Decide early which AWS region and availability zones will hold the data, since that choice drives where credentials, execution data and backups live. Done means a route table check confirms the private subnets have no direct route to an internet gateway, and the planned security groups allow only the ports each tier needs.
Provision RDS PostgreSQL on a supported major version
Create an Amazon RDS for PostgreSQL instance in the private subnets, choosing a major version that is still supported by the PostgreSQL community at the time of deployment (the supported versions are listed in the PostgreSQL versioning policy). Enable encryption at rest, Multi-AZ if your availability target requires it, and automated backups with a retention period your recovery plan sets. Confirm the version with
SELECT version();from a bastion or ECS task, and confirm n8n can connect with SSL enforced. Note that n8n stores workflows, credentials and execution records here, so this instance is the first recovery priority.Provision ElastiCache Redis for queue mode
Create an ElastiCache for Redis replication group in the private subnets with in-transit encryption and auth enabled, so the main instance and workers can exchange execution messages without exposing Redis to the network. Confirm the Redis version and its license terms before you pin it, because Redis changed its licensing with the 8.0 line. Check that the main instance and worker security groups can reach the Redis port and nothing else can. Test connectivity from a worker task with a simple
redis-cli pingbefore any n8n configuration is applied.Store the encryption key and share it with every process
Generate the n8n encryption key once and store it in AWS Secrets Manager or Systems Manager Parameter Store, encrypted with a KMS key that your security team controls. Grant read access only to the IAM roles for the main instance, the workers and any webhook processors, because n8n needs the same key on every process to decrypt stored credentials. Record where the key lives and who can rotate it, since losing or changing it makes stored credentials unreadable. The check is that a test task launched under the worker role can read the secret, and that a role without the grant cannot.
Deploy the main instance and workers on EKS or ECS Fargate
Deploy the n8n main instance, the worker pool and any separate webhook processors as separate services, using the compute platform your team already operates. Set the database, Redis and encryption key settings through the task or pod definition and pin the n8n image to an exact version rather than a floating tag. Start with the main instance and confirm it reaches the database and writes its migrations, then scale the workers. The check is that each service reports healthy and the logs show the workers connected to Redis.
Attach the load balancer, DNS and TLS certificate
Place an Application Load Balancer in the public subnets, issue a certificate for the n8n hostname through AWS Certificate Manager or your internal CA, and route traffic to the main instance and webhook processors on their target groups. Set the public URL and forwarded-header settings so webhook URLs n8n generates match the hostname users call. Confirm the certificate chain with
openssl s_clientand check that the editor loads over HTTPS only. Keep the load balancer's listener rules narrow so administrative paths are not exposed to the internet by default.Configure S3 for binary data
Create an S3 bucket in the same region with public access blocked, default encryption, and versioning or lifecycle rules that your retention policy requires. Give the n8n task role only the object permissions it needs on that bucket, then configure n8n to store binary data in S3 instead of the local disk of each container. Without this, files produced by one worker may not be visible to another. The check is to run a workflow that writes a binary file on a worker, then open it from a different execution to confirm it was read from the bucket.
Smoke test a webhook and a worker execution
Publish a small test workflow that starts with a webhook trigger and passes its data to a node that writes a value to a log or response, then call the production URL from outside your network. Confirm in the execution list that the run completed on a worker rather than on the main instance, and that the execution record appears in PostgreSQL. Repeat with a credential-based node to confirm a worker can decrypt the stored credential. Record the test results and the image tags tested, so the same checks can be repeated after every upgrade.
How the n8n components connect inside your VPC
The flow starts at the load balancer, which sends editor and API traffic to the n8n main instance and webhook calls to the webhook processors. The main instance handles triggers and passes executions through a Redis queue to the worker pool, and workers and webhook processors read and write workflow data in RDS PostgreSQL. Binary data goes to S3. Every hand-off to the N8N_ENCRYPTION_KEY holder is shared with workers and webhook processors, so check that all of them receive the same key before you go live.
Components and data paths for queue mode inside a single VPC boundary.
Securing n8n credentials, network paths and data on AWS
An n8n deployment on AWS holds stored credentials, workflow data and binary files across several managed services. The cards below cover the controls that connect those pieces, and the checks to run before any workflow touches production systems.
Encryption key handling and rotation
Every n8n instance encrypts stored credentials with a key, and in queue mode every worker and webhook processor needs that same key to read them. Store the key in AWS Secrets Manager or SSM Parameter Store and inject it into each task definition or pod, never in an image or plain environment file. Before go-live, write down who can read the secret, how a rotation would be planned, and what happens to existing credentials if the key is lost. Losing the key makes stored credentials unreadable.
Queue mode docsIAM roles and least privilege
Give the ECS task role or the EKS service account its own IAM role, scoped to the exact secrets, S3 prefix and log groups n8n uses. Keep the execution role, which pulls images and reads secrets at startup, separate from the task role that the running process uses. Review these roles with the security team, because a workflow with code execution can use whatever the task role permits. Confirm the permissions against your own account, since the minimum set depends on which AWS features you enable.
Private networking for RDS and ElastiCache
Place the RDS PostgreSQL instance and the ElastiCache Redis cluster in private subnets with security groups that accept traffic only from the n8n main, worker and webhook components. Do not attach public IP addresses to these resources. Confirm that the n8n services can reach the database and Redis endpoints through the VPC, and that any outbound path for workflow HTTP calls goes through a controlled egress point you can log and restrict.
TLS to the database and Redis
Require encrypted connections from n8n to PostgreSQL and from the queue to Redis, and confirm which certificate authority chain your client trusts. ElastiCache supports encryption in transit, but the client configuration must match it, so test the connection with the exact settings you will run in production. Record which TLS settings are enforced at the database and at Redis, because a misconfigured client often falls back to a plaintext connection without an obvious error.
S3 bucket policies for binary data
When n8n stores binary data in S3 instead of the local filesystem, files from workflows such as invoices or scanned documents land in your bucket. Block public access at the account and bucket level, enforce encryption at rest, and grant the n8n role access only to its prefix. Add a lifecycle rule that matches your retention decision for execution data. Ask your data protection owner to confirm which file types may be stored and for how long.
Logging and audit trails
Send container logs to CloudWatch Logs or your central log platform, and keep audit events from AWS CloudTrail for the IAM, secrets and S3 actions that touch n8n. Set a retention period on each log group that your compliance team has approved, and restrict who can read or delete them. Confirm which n8n events are captured at the application level, because cloud logs alone will not show which workflow used which credential.
Keeping PostgreSQL and Redis supported while n8n upgrades
Plan the PostgreSQL and Redis upgrade path before you choose an AWS compute model, because both managed services set their own version windows and n8n upgrades can make the old versions harder to keep. PostgreSQL 14 support runs until November 12, 2026, while PostgreSQL 18 is the newest version listed in the supported set, with final release scheduled for November 14, 2030. Confirm which major version your RDS for PostgreSQL instance runs, check the end-of-support date in the AWS console and in the PostgreSQL versioning policy, and record the date in your upgrade calendar. Treat RDS extended support charges and the window for a planned major version upgrade as items to confirm with AWS, not as figures this page supplies.
Minor and major PostgreSQL upgrades differ in risk. Minor releases do not change the internal storage format, so you replace executables and restart, which is routine maintenance you can schedule through RDS maintenance windows. Major upgrades need a deliberate method: a dump and restore, pg_upgrade, or logical replication, which can work between major versions with only several seconds of downtime according to the PostgreSQL upgrade documentation. Before you pick a method, confirm with your n8n version that the database schema migrations you expect have been tested against the target PostgreSQL major version, and run a restore test on a copy of the database.
The Redis license needs a separate check. Redis 8.0 and later can be used under a license of your choice among RSALv2, SSPLv1 and AGPLv3, while Redis 7.4.x to 7.8.x remain under the dual RSALv2 or SSPLv1 license and Redis 7.2.x and earlier remain under BSD-3-Clause, according to the Redis licenses page. If your n8n queue mode uses ElastiCache for Redis, confirm the engine version your cluster runs, the license terms that apply to that version and whether your use, including any modified code offered as a network service, fits those terms. Have legal review this decision and record the Redis version and license in your change log before each n8n upgrade.
Limits to confirm before you commit to AWS
Several n8n and AWS-side limits decide which architecture is possible before any build starts. Confirm each one against your license, your chosen engine versions and your own load tests, because a gap found after the stack is running is far more expensive to fix.
Multi-main high availability needs Enterprise
Running several main instances for high availability is restricted to Enterprise self-hosted deployments. It is not available in the Community edition or n8n Cloud. If your design depends on losing one main instance without an outage, confirm your license covers multi-main before you choose the ECS or EKS topology, because a single main instance with queue-mode workers is the path open to lower-tier plans.
Queue mode docsCloudFormation example version and status
Check the version, release date and maintenance status of the CloudFormation example n8n publishes before you use it as a starting point. Confirm which n8n release it targets, whether its PostgreSQL and Redis settings match your engine versions, and who owns fixes for it. Treat it as a reference template to review and adapt, not a supported production artifact, until your own review says otherwise.
RDS and ElastiCache feature support
Confirm that the RDS PostgreSQL major version you pick is still supported, and that your ElastiCache Redis engine version supports the features queue mode uses. Check the PostgreSQL support end dates against your upgrade window, and confirm TLS, parameter group and failover options on the exact engine versions you plan to run. Support status varies by version, so verify it in the AWS console and vendor documentation at build time.
Redis Sentinel needs three instances
If you run Redis yourself on EC2 or in containers rather than using managed Redis, plan for Redis Sentinel to provide automatic failover. The Sentinel documentation says a robust deployment needs at least three Sentinel instances. Add that quorum to your sizing, your network rules and your failover tests. Managed ElastiCache has its own failover model, so do not copy the Sentinel layout onto it.
Redis Sentinel docsAutoscaling worker behavior under load
Autoscaling n8n workers on ECS or EKS is not proven by the platform alone. Test how queued executions drain when new workers start, how long a worker takes to stop without losing running jobs, and whether scale-in interrupts long executions. Confirm that every worker has the same encryption key and can reach PostgreSQL and Redis, since new tasks may land on workers you have not tested yet.
Encryption key and secrets on AWS
Queue mode requires the main instance's encryption key on every worker and webhook processor, so the key must be injected into ECS task definitions or Kubernetes secrets consistently. Decide who can read it in AWS Secrets Manager or Parameter Store, how rotation would work, and how a lost key would be recovered. Confirm these steps in a test environment before any production credentials are stored.
Questions buyers ask about self-hosting n8n on AWS
What drives the cost and effort difference between EKS and ECS Fargate for n8n?
EKS usually costs more to build and run because your team or partner owns a Kubernetes control plane, node or pod configuration, ingress, certificate management and cluster upgrades in addition to n8n itself. ECS Fargate removes node management, so the effort centers on task definitions, service configuration, load balancing, secrets and networking. The main cost drivers are the skills your team already has, how many components you run (main instance, webhook processors, workers, Redis, a task runner), and how often you expect to change the setup. Ask any quote to itemize the AWS services in scope, the number of environments, and whether the cluster or task layout will be handed over with runbooks. Recurring costs include AWS infrastructure, n8n licensing if you use paid features, and any retainer for upgrades and monitoring.
Can a small team run n8n on AWS without outside help?
A small team can run n8n on AWS without a partner if it already operates containers on AWS, can manage a managed PostgreSQL database and understands how n8n stores credentials and executions. The harder parts are rarely the first deployment. They are the encryption key handling, database backups and restore tests, upgrades across n8n releases, and keeping queue mode workers healthy under load. Teams with one or two people who carry the platform on top of other duties often bring in outside help for the initial build, handover and the first upgrade cycle. Confirm the team's on-call coverage, cloud skills and change process before deciding, and ask a partner to write the scope for any part you want to hand over.
What does the work need from our AWS and identity teams?
The AWS team provides the account structure, VPC and subnet layout, IAM roles, KMS keys, load balancer and DNS setup, and approval for the managed services in scope. The identity team provides the identity provider, SAML or OIDC application details, and the group mappings that decide who can sign in. Single sign-on in n8n is a paid feature: SAML is listed on the Business and Enterprise plans, and the n8n documentation includes setup guides for Okta Workforce Identity and Azure AD. Plan these requests early, because network paths, certificate issuance and identity configuration usually determine the schedule more than the n8n install itself. Your engagement should name each dependency and its owner in writing.
How long does a build take, and what changes the timeline?
No duration is fixed for this work, so ask for a timeline in the written scope rather than a generic estimate. The main factors are the number of environments, whether EKS or ECS Fargate is chosen, how many n8n processes run in queue mode, the state of your VPC, identity and certificate processes, and whether the build includes backup restore tests, monitoring and a documented upgrade procedure. Work that depends on approvals from other teams tends to extend calendar time even when the technical effort is modest. DeployOpen sets timelines for most engagements as fixed scope, agreed in writing before work starts, so the quote is the right place to confirm them.
Does n8n Cloud or the Business plan change whether we should self-host on AWS?
Yes, the plan you choose changes both the options and the effort. n8n Cloud removes the infrastructure work, but it means n8n hosts the service, so your data residency and control requirements must fit its offering. Self-hosting on AWS keeps the instance in your accounts, which is why regulated teams usually choose it. Among self-hosted options, the Business plan is listed as self-hosted only and includes SSO and LDAP, environments with Git, and log streaming. Multi-main high availability is restricted to Enterprise self-hosted deployments. Review the current pricing page with your procurement team, because plan contents and prices change, and ask a partner to map which features your build depends on before you commit to an architecture.
Do we need queue mode on AWS, or is a single instance enough?
A single n8n instance can be enough for light or moderate execution volume and for teams that do not need to separate webhook handling from workflow execution. Queue mode becomes relevant when you need to scale workers independently, keep webhooks responsive during heavy runs, or spread execution load. In queue mode, the main instance hands executions through Redis to workers that read and write PostgreSQL, so on AWS you would add ElastiCache for Redis and must share the encryption key with every worker and webhook processor. That adds services to run, monitor and upgrade. Measure your expected workload and failure tolerance first, then ask for a quote that prices queue mode and a single-instance option separately so you can compare the recurring cost of each.
What should we ask for in a quote for this AWS build?
Ask for a written scope that lists each AWS service, the n8n edition and plan assumptions, the number of environments, the database and Redis configuration, the storage approach for binary data, identity integration, backup and restore testing, monitoring, documentation and handover, and upgrade support after go-live. Ask which items are one-time work and which recur, such as retainers for upgrades, patching and continuous testing. Confirm who pays for AWS consumption and third-party licenses, since those costs sit outside the DeployOpen engagement. DeployOpen does not publish a price list, so the quote follows from the written scope.
How DeployOpen scopes and delivers n8n on AWS
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own AWS accounts. For n8n on AWS, we start from a written scope that settles the compute model, the database, queue mode, binary data storage and the license position before any infrastructure is built.
How we scope
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- The written scope names the compute option, whether EKS or ECS Fargate, and the reasons for choosing it.
- Scope covers RDS PostgreSQL, ElastiCache Redis for queue mode, S3 for binary data and the encryption key handling.
How we build
- We build the stack in the client's AWS accounts, starting from the CloudFormation example n8n publishes and adapting it to the agreed design.
- Queue mode is configured so the main instance and workers share the encryption key and reach the same PostgreSQL database.
- We test workflow execution, webhook reachability, credential access and restart behavior before the environment is accepted.
How we hand over
- The client receives infrastructure definitions, configuration records and a runbook covering scaling, backups and key rotation.
- Documentation states which n8n edition and license terms apply, including which features need a Business or Enterprise plan.
- Handover includes a walkthrough with the team that will operate the stack, so they can change it without us.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Upgrade plans cover n8n releases, RDS PostgreSQL version changes and Redis version decisions, each tested in a non-production account first.
- Confirm with DeployOpen during scoping which support level, response terms and service commitments apply to your environment.

