AWS Builder Center
Deploying n8n on AWS EC2: My Setup for a Self-Hosted Automation Server

Deploying n8n on AWS EC2: My Setup for a Self-Hosted Automation Server

I wanted a reliable place to host my n8n workflows without relying on the cloud version. This article walks through the AWS setup I use, the services involved, and a few lessons I learned along the way.

Series: n8n (1 article)

  1. 1
    Deploying n8n on AWS EC2: My Setup for a Self-Hosted Automation Server This article
Automation Builder

Why I decided to self-host n8n

I've been using n8n for automation projects, and eventually I wanted more control over my workflows. Self-hosting also lets me manage updates, customize the environment, and avoid the limitations of a managed instance.
Since I was already learning AWS, deploying n8n on an EC2 instance felt like a good project to understand both cloud infrastructure and automation at the same time.



The AWS services I used

For this setup, I kept everything simple.
  • Amazon EC2 to run the n8n server
  • Security Groups to control inbound traffic
  • Elastic IP so the server has a fixed public address
  • Amazon EBS for persistent storage
  • IAM for secure access and permissions
If you're planning to use a custom domain, you can also use Route 53. For HTTPS, Nginx with Let's Encrypt is a common and reliable choice.



My deployment approach

Instead of installing everything directly on Ubuntu, I chose Docker.
Using Docker made it much easier to:
  • update n8n
  • move the deployment to another server
  • back up data
  • keep the environment consistent
A simple Docker Compose file was enough to get everything running.



A few things I learned

There were a few small details that made a big difference.

Keep your data outside the container

Always mount a persistent volume so your workflows and credentials survive updates.

Don't expose everything

Only open the ports you actually need. Security Groups make this easy.

Use HTTPS

Even for personal projects, enabling SSL is worth it. It protects your login page and API endpoints.

Create backups

Backing up the n8n data folder regularly can save a lot of time if something goes wrong.



Why AWS worked well

One thing I like about AWS is that I can start small and scale later.
A small EC2 instance is enough for learning and personal automations. As workflows grow, it's easy to move to a larger instance or improve the architecture with additional AWS services.
This project also gave me practical experience with Linux, Docker, networking, and cloud deployment—all while building something I actually use.



What's next?

I'm planning to connect this n8n instance with more AWS services like Amazon Bedrock for AI workflows, Amazon S3 for file storage, and Amazon SES for email automation.
If you're learning AWS and want a project that's both practical and fun, I think self-hosting n8n is a great place to start.
Thanks for reading! If you've deployed n8n differently or have tips to improve this setup, I'd love to hear about your experience.

Series: n8n (1 article)

  1. 1
    Deploying n8n on AWS EC2: My Setup for a Self-Hosted Automation Server This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article