Note: This repository is only for deploying n8n on AWS EKS Fargate. All manifests and scripts are AWS specific and will not work on other Kubernetes environments or cloud providers.
This project contains automation scripts and Kubernetes manifests to run n8n on serverless EKS Fargate. It relies on AWS managed services such as EFS, Aurora PostgreSQL, and CloudFront. n8n runs in queue mode with scaling worker pods, and all logs stream to CloudWatch.
Install and configure the following tools and ensure your AWS credentials are available:
- AWS CLI
- eksctl
- kubectl
- helm
- curl
- openssl (for generating encryption keys)
- jq (required by the cleanup script)
- kustomize (used with
kubectl apply -k)
deploy-eks-fargate.sh and destroy-eks-fargate.sh check that your user or role has these permissions before running.
elasticfilesystem:CreateFileSystemelasticfilesystem:CreateMountTargetec2:DescribeSubnetsec2:CreateSecurityGroupec2:ModifyVpcAttributeec2:AuthorizeSecurityGroupIngressec2:DescribeSecurityGroupsec2:DescribeManagedPrefixListsrds:CreateDBClusterrds:CreateDBInstancerds:CreateDBSubnetGroupsecretsmanager:CreateSecretsecretsmanager:UpdateSecretsecretsmanager:DescribeSecretsecretsmanager:ListSecretssecretsmanager:GetSecretValuerds-data:ExecuteStatementiam:CreatePolicyiam:GetPolicyiam:GetPolicyVersioniam:ListPolicyVersionsiam:DeletePolicyVersioniam:CreatePolicyVersioniam:SimulatePrincipalPolicycloudfront:CreateDistributioncloudfront:GetDistributioncloudfront:GetDistributionConfigcloudfront:UpdateDistributioncloudfront:ListCachePoliciescloudfront:DeleteDistribution
elasticfilesystem:DeleteFileSystemelasticfilesystem:DeleteMountTargetelasticfilesystem:DescribeFileSystemselasticfilesystem:DescribeMountTargetselasticloadbalancing:DescribeLoadBalancersrds:DeleteDBClusterrds:DeleteDBInstancerds:DeleteDBSubnetGroupsecretsmanager:DeleteSecretsecretsmanager:ListSecretsec2:DeleteSecurityGroupec2:DescribeSecurityGroupsiam:SimulatePrincipalPolicycloudfront:ListDistributionscloudfront:GetDistributioncloudfront:GetDistributionConfigcloudfront:UpdateDistributioncloudfront:DeleteDistribution
If a permission is missing, the script prints which actions are required and exits.
-
Optionally configure environment variables
AURORA_MIN_CAPACITY/AURORA_MAX_CAPACITYN8N_BASIC_AUTH_ACTIVE,N8N_BASIC_AUTH_USER,N8N_BASIC_AUTH_PASSWORDN8N_HOST- Update credentials in
postgres-secret.yamlfor your RDS cluster if needed
-
Deploy
./deploy-eks-fargate.sh --region <aws-region> --k8sname <cluster-name> --domain <n8n-domain>
The arguments are optional and have sensible defaults. When complete, the script prints the CloudFront URL to access n8n. Run
./deploy-eks-fargate.sh --helpfor all options. -
Access n8n
- Use the CloudFront DNS name (HTTPS enforced)
- Data persists on EFS and logs stream to CloudWatch
- Worker pods scale via HPA
-
Clean up
./destroy-eks-fargate.sh
This removes all resources using state files from the deployment.
This solution deploys n8n, an open source workflow automation platform, on serverless Kubernetes (EKS Fargate) using AWS managed services. n8n runs in queue mode with worker pods connected through Redis, and all logs stream to CloudWatch.
- AWS only – all resources, IAM policies and security groups are AWS specific
- Automated lifecycle – single commands to deploy and destroy the entire stack
- Queue mode enabled – workers scale automatically via HPA
- Security best practices – secrets stored in Kubernetes Secrets and AWS Secrets Manager
- Persistent and highly available – data stored on EFS for horizontal scaling
- Ingress via CloudFront – public access is served through CloudFront
deploy-eks-fargate.sh– deployment scriptdestroy-eks-fargate.sh– teardown scripteks-fargate-cluster.yaml– EKS cluster configurationcloudwatch-logging.yaml– CloudWatch logging configurationn8n-deployment.yaml,n8n-worker-deployment.yaml– n8n and worker deploymentsredis.yaml– Redis deploymentefs-storageclass.yaml,n8n-pv.yaml,n8n-claim0-persistentvolumeclaim.yaml– EFS volumes- Other manifests and scripts are AWS specific
This repository uses GitHub Actions to lint all YAML manifests and shell scripts on every push and pull request targeting the main or dev branches. The workflow can also be triggered manually. It installs yamllint and shellcheck to verify configuration files and shell scripts. YAML files are checked using the rules in .yamllint, which extend the relaxed preset but still enforce indentation, trailing spaces, and a newline at the end of files. Shell scripts are scanned with shellcheck.
- Kubernetes Secrets and database credentials are generated automatically but can be customised before deploying
- Troubleshooting steps are documented in the scripts if resource creation fails
- The deploy script ensures the region offers at least three Availability Zones and requires the RDS subnet group to span three or more of them.
- Supported only on AWS EKS Fargate
- Do not attempt to use these manifests on other Kubernetes environments
- Manage infrastructure at your own risk
Parts of this repository come from n8n-hosting. This project is released under the MIT License (see LICENSE).
-
Ask questions on the n8n Community Forums
-
Upstream origin: n8n-hosting/kubernetes