In this post, you will install and configure your own n8n instance using AWS cloud services. This gives you more control over infrastructure, costs, and workflow customization.
Using n8n in your own infrastructure (self-hosted) is an alternative to automate workflows without paying a monthly subscription to n8n.io cloud services.
What Will You Learn?
In this post, you will learn how to:
- Install and configure n8n as self-hosted
- Estimate basic operation costs
Step-by-Step Implementation
1. Prerequisites ✅
Before you start, you need:
- An active Amazon Web Services (AWS) account
- A domain to publish n8n with HTTPS
- Download the whatsapp-chatbot repository for installation and configuration of n8n
2. Deploy n8n on AWS 🚀
The installation is automated using a CloudFormation template that creates:
- AWS Lightsail instance
- Network and communication permissions
- Static public IP address
- Startup script to install docker, n8n, database (postgres), web server (nginx), and certbot
Template Parameters:
- InstanceName: instance name
-
BlueprintId: base image, for example
amazon_linux_2023 - BundleId: instance size
- AvailabilityZone: AWS region and zone
- StaticIPName: static IP name
- DBUser: database user
- DBPassword: database password
- Domain: public domain for n8n
- Email: email for HTTPS certificate
You can run the CloudFormation template using AWS CLI or AWS Console.
Option A: Deploy from Command Line 💻
Configure access keys to connect AWS CLI with your AWS account. Check details here.
Go to the path where you downloaded the whatsapp-chatbot project, inside the
awsfolderRun this command. Replace
DomainandEmailwith your values:
aws cloudformation deploy \
--stack-name n8n \
--template-file template.yaml \
--region us-east-1 \
--parameter-overrides \
InstanceName=n8n-instance \
AvailabilityZone=us-east-1a \
BlueprintId=amazon_linux_2023 \
BundleId=small_3_0 \
Domain={Domain} \
DBUser=admin \
DBPassword=admin \
Email={email} \
StaticIpName=n8n-ip-address
Option B: Deploy from AWS Console 🌐
Log in to AWS Console
Go to CloudFormation and create a new stack
Import the template (
template.yaml) and follow the steps to set parameters likeDomainandEmail
3. Validate the installation 📝✅
After CloudFormation finishes, check:
- The Lightsail instance exists
- Security rules allow SSH, HTTP, and HTTPS
- The static IP is assigned
- You can connect using SSH
- The n8n and postgres containers are running
It is recommended to restrict SSH access only to your IP.
4. Configure HTTPS 🔐
This step is required so n8n can connect with platforms like WhatsApp, Google, etc., that require SSL/TLS.
Steps:
- Create the DNS zone
- Point the domain to the Lightsail static IP
- Generate the certificate with Certbot
- Verify that n8n works with HTTPS
- Register in the n8n interface
Connect to your Lightsail instance using SSH and run:
sudo certbot --nginx -d n8n.tu-dominio.com \
--email tu-correo@dominio.com \
--agree-tos \
--no-eff-email \
--redirect
Licensing 📄
n8n uses the Fair Code license (Sustainable Use License). You can use it for free, modify it, and run it in your own infrastructure (self-hosted) for personal or business use.
You can use it inside internal products or services in a company, as long as n8n is not the main product.
You cannot resell n8n as a hosted automation platform or create a business where the main product is a managed n8n service.
Costs 💰
AWS Lightsail (Self Hosting) ☁️
In AWS Lightsail, the minimum recommended instance to run n8n is:
- 2 GB RAM
- 2 vCPU
- 60 GB SSD
This setup supports basic workflows with good stability. This instance has a monthly cost.
Conclusions
⚖️ You can use n8n in internal or business projects, but you cannot resell it as the main service.
💰 n8n is free if you use your own infrastructure (self-hosted), but AWS infrastructure has monthly costs.
🚀 Infrastructure and n8n installation are automated using AWS CloudFormation (Infrastructure as Code). You can deploy n8n in a few steps.

Top comments (0)