Deploy n8n on AWS Free Tier

One click deployment with Cloudformation

I recorded a video, walking you through deploying n8n on AWS using a CloudFormation template.

Here’s the written instructions, commands and scripts that I used.

The stack includes:

✅ n8n (Docker)
✅ External PostgreSQL (Supabase or RDS)
✅ HTTPS via Nginx + Certbot
✅ Persistent credentials
✅ Free-tier compatibility

🧩 What’s Included in the Setup

  • ✅ EC2 instance (t2.micro)

  • ✅ Dockerized n8n

  • ✅ External PostgreSQL (Supabase pooler or RDS)

  • ✅ Nginx reverse proxy

  • ✅ Certbot-managed HTTPS

  • ✅ CloudFormation for one-click provisioning

📥 CloudFormation Template

🔑 Parameters You’ll Be Asked For:

Parameter

Description

KeyName

Your EC2 SSH Key Pair

DomainName

Your subdomain (e.g. n8n.yourdomain.com)

Email

Email for Let's Encrypt SSL

DbHost

PostgreSQL host (e.g. Supabase pooler)

DbUser

PostgreSQL username

DbPassword

PostgreSQL password (hidden)

EncryptionKey

Long random string to encrypt credentials

Generate your encryption key with:

openssl rand -hex 32

🧠 After Stack Is Created

🔧 1. Point Your DNS to the EC2 Instance

Add an A record in Cloudflare or your DNS provider:

Type: A
Name: n8n
Value: <Elastic IP from stack output>
Proxy: DNS Only

🔐 2. SSH into EC2

ssh -i your-key.pem ubuntu@<Elastic-IP>

🔐 3. Run Certbot for SSL

sudo certbot --nginx -d sub.yourdomain.com -m [email protected] --agree-tos --non-interactive --redirect

Then restart Nginx

sudo systemctl restart nginx

This issues your HTTPS certificate via Let’s Encrypt.

🧪 4. Test n8n

Visit:

https://n8n.yourdomain.com

You’ll see the n8n login screen.

🧹 Helpful Commands

🐳 Docker

docker-compose up -d
docker-compose logs n8n

🔗 Watch the Full Video Tutorial

Where do you host n8n for personal use?