Linux VPS for n8n: Self-Hosting Automation Workflows Without Overspending
Setting up a Linux VPS for n8n gives you complete control over your workflow automations without paying high monthly fees. By hosting it yourself, you can build unlimited workflows and process data securely on your own server.
Choosing a Linux VPS for n8n helps you avoid execution limits and keeps your data completely private; this method is ideal if you need custom integrations or strict control over your network security.
Table of Contents
What Is n8n and Why Self-Host It?
n8n is an open-source workflow automation tool that lets you connect apps, APIs, webhooks, and services without writing much code. Think of it as a self-hosted alternative to Zapier or Make, except you own the entire platform.
When you run n8n on your own Linux VPS, you skip the per-workflow pricing, keep your data private, and can customize everything from environment variables to database settings.
The open-source community edition of n8n is free, and the only real cost is your server.
How Much CPU and RAM Does n8n Need?
The CPU and RAM requirements for n8n depend on how many workflows you run and how complex they are. Here’s a quick sizing guide based on real-world use:
| Use Case | CPU | RAM | Storage |
|---|---|---|---|
| Personal / hobby use | 1 vCPU | 1 to 2 GB | 20 GB SSD |
| Small team / internal automations | 2 vCPU | 4 GB | 40 to 50 GB NVMe |
| Busy production with parallel flows | 4 vCPU | 8 GB | 80 GB NVMe |
The minimum specs for Linux VPS for n8n are 1 vCPU and 1 GB of RAM, which is enough for light testing. For any real production use, start with 2 vCPU and 4 GB RAM, which handles most internal automations, scheduled jobs, and webhook receivers.
Is Docker Enough for n8n Workflows?
For most users, a single Docker container is all you need. If you run fewer than about 1,000 executions per day and your workflows don’t run in parallel, the standard Docker setup works perfectly.
The default n8n Docker image uses SQLite as its database, which is fine for personal projects or low-traffic setups.
Here’s a minimal docker-compose.yml to get started on your Linux VPS:
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "5678:5678"
volumes:
- n8n_data:/home/node/.n8n
environment:
- N8N_HOST=your-domain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://your-domain.com/
volumes:
n8n_data:
This method keeps things simple, cheap to run, and easy to back up. You just need Docker and Docker Compose installed on your server.
When to Switch to PostgreSQL for n8n?
Not everyone needs PostgreSQL. For light personal use, SQLite works without any issues. But as soon as your automations get more serious, including more workflows, more executions, and more data, you’ll want a proper database behind n8n. That’s where PostgreSQL comes in, and switching is easier than most people think.
The key signs you need PostgreSQL for n8n:
- You’re running more than 5 to 10 concurrent executions.
- Your execution history is growing into the gigabytes.
- You’re experiencing slow UI or database lock errors.
- You plan to enable queue mode in the future.
For switching to PostgreSQL, you can add a postgres service to your stack, point n8n at it with DB_TYPE=postgresdb, and your Linux VPS for n8n becomes production-ready.
PostgreSQL handles concurrent writes without blocking, which makes a real difference once traffic picks up.
When to Enable Queue Mode in n8n?
Queue mode is n8n’s way of separating the web interface from the actual workflow execution. Instead of one process doing everything, you have a main instance handling triggers and a set of workers processing jobs from a Redis queue.
You need queue mode in n8n when:
- You process more than 1,000 executions per day.
- You have spikey webhook traffic that needs to stay responsive.
- You run long-running jobs like file processing or heavy API polling.
- You want the n8n UI to stay fast while workers do the heavy lifting.
Queue mode requires three extra components:
- Redis as the job queue
- Multiple n8n worker containers
- PostgreSQL
This means you’ll need at least a 4 vCPU and 8 GB RAM plan before going down this route.
Remember that you don’t need queue mode in n8n when you’re running internal automations for a small team, simple scheduled tasks, or a handful of webhook flows. In these cases, a standard Docker setup with PostgreSQL is more than enough and far easier to maintain.
Common n8n Use Cases and Matching VPS Plans
One of the most common mistakes people make when self-hosting n8n is picking the wrong server. You must start with your use case and work backward to the plan that fits.
Here’s how to match your use case to the right plan size on a Linux VPS for n8n:
1. Internal automations: Things like syncing a CRM, sending Slack alerts, or updating a spreadsheet on a schedule are the lightest workload. For this, a 2 vCPU and 4 GB plan works perfectly.
2. Lead routing and CRM workflows: n8n gets a lead from a form or ad platform, adds extra data to it, and sends it to the right tool. This is a medium workload, and 2 to 4 vCPUs with 4 GB of RAM work well in these situations.
3. Webhook flows: High-frequency inbound webhooks from payment processors, e-commerce platforms, or chat apps need a faster response time. For these situations, you want PostgreSQL from the start and queue mode if the rate exceeds a few hundred webhooks per hour.
4. Long-running jobs: Jobs like scraping, PDF processing, or AI model calls that take minutes per execution are the most resource-hungry. You must use queue mode and a dedicated worker with extra CPU. A 4 vCPU and 8 GB plan with multiple workers keeps these jobs from blocking your UI.
Step-by-Step Set Up n8n on a Linux VPS
Setting up n8n on a Linux VPS is simpler than it sounds. With Docker and a few configuration steps, you can have a fully working n8n instance live in under 30 minutes.
Here’s the full n8n process from a fresh Ubuntu 24.04 server:
1. Update your server:
sudo apt update && sudo apt upgrade -y
2. Install Docker and Docker Compose with the official Docker install script:
curl -fsSL https://get.docker.com | sh
3. Create your project folder:
mkdir ~/n8n && cd ~/n8n
4. Write your docker-compose.yml with the n8n service and PostgreSQL if needed.
5. Set environment variables by using a .env file for your domain, timezone, and database credentials.
6. Point your domain by adding an A record in your DNS pointing to your VPS IP. A registered domain makes this easy to manage.
7. Set up a reverse proxy by using Nginx or Caddy to handle HTTPS with a free Let’s Encrypt SSL cert.
8. Then, start the stack by running:
docker compose up -d
9. To access your n8n dashboard, navigate to the URL below and create your admin account:
https://your-domain.com
10. Finally, enable your free license. In Settings, navigate to License, and activate the Community Edition to unlock all base features.
You can follow the steps below based on the official n8n self-hosting documentation for the most up-to-date configuration options.
Secure n8n on Linux VPS
A default n8n setup is not secure enough for production use. Before you connect your tools and start processing real data, take a few minutes to secure your instance. Here’s what to do:
- Set a strong N8N_ENCRYPTION_KEY in your environment variables, which encrypts stored credentials.
- Enable basic auth or set up n8n’s built-in user management.
- Block port 5678 at the firewall level and only expose n8n through your reverse proxy on port 443.
- Keep Docker images updated regularly; new n8n releases often include security patches.
- Take daily snapshots of your VPS and back up your n8n_data and postgres_data Docker volumes.
How to Choose the Right Linux VPS for n8n
When picking a VPS plan for n8n, you must focus on three things: RAM first, then CPU, then storage type. NVMe SSD is strongly preferred over regular SSD for database I/O, especially when running PostgreSQL.
Here’s a practical sizing reference:
- Starter: 1 to 2 vCPU, 2 to 4 GB RAM, 20 to 50 GB NVMe. For personal projects, small internal automations, and testing.
- Growth: 2 to 4 vCPU, 4 to 8 GB RAM, 50 to 80 GB NVMe. For active teams, lead routing, and webhook-heavy flows.
- Scale: 4+ vCPU, 8+ GB RAM, 80+ GB NVMe. For queue mode, long-running jobs, and high-volume pipelines.
The Growth tier is a solid starting point for most teams. It covers your needs without overpaying, and you can always upgrade as your workflows grow. That flexibility is one of the biggest reasons for running your own Linux VPS for n8n.
Stop Overpaying for n8n Hosting
You don’t need a big server to run n8n well. Most teams overspend simply because they don’t know what to watch. With a few small adjustments, you can run a reliable n8n instance and only pay for what you actually need.
Here’s what actually helps:
- Set an execution history retention limit, like 30 days, so your database doesn’t grow too much.
- Use scheduled workflows instead of polling loops where possible; polling keeps your CPU busy for no reason.
- Monitor RAM usage weekly; if you’re below 50% usage after a month, downgrade to a smaller plan.
- Use one VPS for multiple n8n environments with separate Docker stacks on different ports.
A Linux VPS for n8n can cost just a few dollars a month and still handle serious work. Start small, match your plan to your actual load, and upgrade only when you need to.
Final Words
Self-hosting n8n on a Linux VPS is one of the smartest decisions you can make for your automation setup. Start small, pick the right plan for your use case, and scale only when you actually need to.
If you are ready to get started, you can host n8n on a cost-efficient PerLod Linux VPS and take full control of your workflows.
We hope you enjoy this guide.
FAQs
What are the minimum VPS requirements to run n8n?
You need at least 1 vCPU and 1 GB of RAM. For real production use, 2 vCPU and 4 GB RAM are the recommended starting point.
Is n8n free to self-host?
Yes, the Community Edition is completely free. You only pay for your VPS, which can be as little as a few dollars per month.
Should I use SQLite or PostgreSQL for n8n?
SQLite is fine for personal use and testing. Switch to PostgreSQL once you have more than 5 to 10 concurrent workflows or your execution history starts growing large.
What is queue mode in n8n, and do I need it?
Queue mode separates the n8n interface from workflow execution using Redis and worker processes. Most users don’t need it; it’s only necessary when handling high volumes of parallel or long-running jobs.