Workflow automation is becoming a critical component of modern infrastructure. While cloud-hosted options exist, running n8n on your own AWS EC2 instance gives you complete data privacy, unlimited executions, and the ability to integrate securely with your internal VPC resources.
Prerequisites
- An active AWS account
- Basic knowledge of the terminal and SSH
- A registered domain name (optional, but recommended for SSL)
Step 1: Launch an EC2 Instance
Head over to the AWS Management Console, navigate to EC2, and click Launch Instance. We recommend an t3.micro or t3.small instance running Ubuntu 22.04 LTS.

Step 2: Install Docker and Docker Compose
SSH into your new instance and update your packages. Then, install Docker:
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo systemctl start dockerStep 3: Setup the n8n Docker Compose File
Create a new directory for n8n, and inside it, create a docker-compose.yml file:
version: '3.8'
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=your-domain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://your-domain.com/
- GENERIC_TIMEZONE=UTC
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:Step 4: Start n8n
With your configuration ready, start the n8n container in the background:
sudo docker-compose up -dOnce started, you can verify it's running with sudo docker ps. Ensure that your AWS Security Group allows inbound traffic on port 5678 (or 80/443 if using a reverse proxy like Nginx or Traefik).
Step 5: Access the Dashboard
Navigate to http://your-ec2-ip:5678 in your browser. You will be greeted by the n8n setup screen where you can create your owner account and start building out your automated workflows!
Need help scaling your automation?
At Armor Tech, we specialize in building robust, high-availability architecture for Agentic AI and complex workflows. If you need help architecting your automation layer, we are a message away.
Contact Our Engineering Team