
Choosing to host n8n on a VPS is one of the smartest moves you can make for your automation workflows. You get complete control over your environment, predictable costs, and the freedom to scale on your terms.
But getting it right takes more than just spinning up a server. This n8n VPS setup guide walks you through everything: VPS requirements, Docker vs bare-metal installation, SSL certificates, memory optimization, and production readiness, so your workflows stay stable, secure, and built to last.
Running n8n on a VPS requires stable resources and reliable network connectivity. The comparison table below highlights VPS hosting providers that support automation tools and container based deployments. These providers offer the flexibility needed to run workflow automation securely and at scale. Explore our recommended VPS hosting options.
VPS Hosting Providers Ideal for Running n8n Automation Workflows
| Provider | User Rating | Recommended For | |
|---|---|---|---|
![]() | 4.8 | Scalability | Visit Kamatera |
![]() | 4.6 | Affordability | Visit Hostinger |
![]() | 4.7 | Developers | Visit IONOS |
Why Hosting n8n on a VPS Makes Sense

Self-hosting n8n on a VPS gives you complete control over your automation infrastructure. Unlike SaaS platforms, you’re not subject to usage caps, price hikes, or someone else’s uptime schedule. Your workflows run on your terms.
Data privacy is another major advantage. When you self host, sensitive business data never passes through third-party servers. For teams handling customer data or operating in regulated industries, that’s not just a preference, it’s a necessity.
Workflow automation hosting on a VPS also offers better long-term cost predictability. SaaS automation platforms charge per task or workflow execution, and those costs add up fast. A well-configured self-hosted automation server gives you dedicated resources at a fixed monthly rate.
Here’s what makes a VPS automation stack particularly well-suited for n8n:
- Full control over your runtime environment and configuration
- Freedom to install custom nodes and custom community nodes
- Access to pre-built integrations alongside fully highly customizable workflows
- Scalability without being locked into a vendor’s pricing tiers
- Better data privacy and ownership compared to cloud-based platforms
Different VPS models suit different needs. Shared VPS plans work fine for light or test workloads, but for serious production n8n hosting, a premium plan with guaranteed dedicated resources is worth considering. You can check these best n8n hosting providers to compare options before committing to a server plan.
Minimum VPS Requirements for Running n8n
Before you install n8n on a Linux VPS, you need to make sure your server can actually handle the load. N8n hardware requirements vary depending on how you plan to use it. A personal test environment has very different needs than a production n8n hosting setup handling real traffic.
Here’s a baseline comparison to help with VPS sizing for automation:
| Resource | Testing/Dev | Production |
| CPU | 1 vCPU | 2+ vCPUs |
| RAM | 1GB | 2GB to 4GB+ |
| Storage | 20GB SSD | 40GB+ SSD |
| Bandwidth | 500GB/month | 1TB+/month |
RAM allocation for workflows is where most users get caught off guard. n8n runs on Node.js, and each active workflow execution consumes memory. See here how much RAM does n8n really need before choosing your plan.
CPU cores for Node.js apps matter most when you’re running complex workflows simultaneously. A single CPU core can handle light workloads, but concurrent executions and webhook traffic will quickly saturate it. Two or more vCPUs are strongly recommended for anything beyond basic testing.
Storage needs depend on how much execution history and log data you retain. SSDs are non-negotiable for performance. Spinning disk storage will create noticeable bottlenecks as your workflows scale.
Webhook-heavy setups add another layer of resource demand. High-frequency webhooks can spike both CPU and memory usage unpredictably. Check these VPS requirements for production n8n if you’re planning to run time-sensitive or high-volume automations.
Knowing when to upgrade is just as important as the initial configuration. If you notice slow execution times, memory warnings, or dropped webhook events, it’s time to scale up your resources. Detailed VPS specs for running n8n workflows efficiently can help you plan ahead before performance becomes a problem.
Installing n8n: Docker vs Bare-Metal Setup

There are two main ways to approach your n8n VPS setup: installing directly on the server (bare-metal) or using a containerized automation setup via Docker. Both work, but they suit different skill levels and use cases. Understanding the tradeoffs upfront will save you a lot of headaches later.
Docker and Docker Compose (Recommended for Most Users)
N8n Docker deployment is the most popular approach for good reason. It isolates n8n from the rest of your system, making updates, rollbacks, and migrations significantly easier to manage.
With an n8n Docker Compose stack, you define your entire environment in a single file, including databases, networking, and environment variables. Spinning up or tearing down your instance is a single command. This makes it ideal for beginners and anyone who wants a repeatable, portable setup.
Common pitfalls include misconfigured volume mounts causing data loss on container restart, and forgetting to persist environment variables across rebuilds. These are easy to avoid with a solid Compose file from the start.
Bare-Metal Installation
Linux VPS installation without Docker gives you more direct access to the underlying system. Some advanced users prefer this for performance tuning or when running n8n alongside other processes that need tight resource control.
The tradeoff is complexity. Dependency management, Node.js versioning, and manual updates all fall on you. A single misconfigured environment can break your entire setup.
For most users, Docker is the safer, more maintainable path. Check the Docker Compose vs bare-metal VPS comparison here if you want a deeper breakdown before deciding.
Securing n8n on a VPS (SSL, Auth & Hardening)
Exposing n8n without proper security settings is one of the most common and costly mistakes in secure n8n deployment. By default, n8n listens on a local port with no encryption. Any production instance needs multiple layers of protection before it touches real data or live workflows.
HTTPS and Reverse Proxy Configuration
N8n HTTPS setup starts with a reverse proxy sitting in front of your n8n instance. Nginx and Caddy are the most common choices. They handle incoming traffic, terminate SSL, and forward requests to n8n internally.
Reverse proxy configuration also means n8n never needs to be directly accessible via your VPS’s IP address. Pair this with SSL certificates from Let’s Encrypt for free, automatically renewable HTTPS. This is the foundation of securing n8n on VPS with proper SSL.
Authentication and Access Control
Never run a production instance without authentication. n8n includes built-in user management, but you should also consider adding an additional layer such as basic auth at the reverse proxy level.
Use a strong password for all credentials and restrict access to trusted users only. Secure access to the n8n browser interface should require login at every session.
Firewall Rules and Port Hardening
Firewall rules for VPS should block all ports except 80, 443, and your SSH port. n8n’s internal port should never be publicly accessible. Automation security hardening also means disabling root SSH login and keeping your system packages updated.
Webhook protection deserves special attention. Validate webhook sources where possible and use secret tokens to prevent unauthorized triggers. This closes one of the most commonly overlooked attack surfaces in any n8n VPS deployment.
Memory Optimization and Performance Stability

n8n runs on Node.js, which has a default memory ceiling that wasn’t designed with heavy automation in mind. On a low-to-mid-tier VPS, hitting that ceiling means crashes, dropped executions, and unstable workflows. Understanding Node.js memory limits before they become a problem is essential for any serious deployment.
Preventing n8n crashes starts with explicitly setting the –max-old-space-size flag in your Node.js configuration. This tells the runtime how much memory it’s allowed to use before triggering garbage collection. Without it, n8n will use whatever is available until the system runs out.
Concurrency is the other major factor in workflow execution stability. Running too many complex workflows simultaneously will exhaust both memory and CPU. n8n’s queue mode helps by managing execution order and limiting how many processes run in parallel, which is worth enabling for any production workload.
VPS swap configuration acts as a safety net when physical RAM runs short. Here are the key resource tuning steps to stabilize performance:
- Set –max-old-space-size to 75% of your available RAM
- Enable swap space of at least 1GB to 2GB on your VPS
- Configure n8n’s EXECUTIONS_PROCESS environment variable to control concurrency
- Use queue mode for high-volume or AI services workloads
- Monitor memory usage regularly and adjust limits as your workflows grow
For a deeper dive into optimizing Node.js memory usage for n8n, including specific flag values and Docker memory cap settings, follow the linked guide before your next deployment.
Preparing n8n for Production Workloads
A test environment and a production automation server are not the same thing, even if they run identical configuration files. Production means real users, real data, and real consequences when something breaks. Workflow reliability has to be built in from the start, not bolted on after your first outage.
A production-ready n8n on a VPS deployment should cover all of the following:
- Logging enabled and routed to a persistent location outside the container
- Automated database persistence for n8n using PostgreSQL rather than the default SQLite
- Regular database backups with offsite or cloud storage copies
- Automatic restarts configured via Docker restart policies or a process manager
- Uptime monitoring for n8n using tools like UptimeRobot or Betterstack
- Webhook scaling tested under realistic traffic loads before going live
- Environment variables stored securely and never hardcoded into your configuration
Database persistence for n8n deserves extra attention. SQLite works fine for testing but is not suitable for production workloads. Migrating to PostgreSQL gives you better performance, reliability, and support for concurrent processes.
Uptime monitoring for n8n should alert you before your users notice a problem. Pair monitoring with automatic restarts to minimize downtime from unexpected crashes or system interruptions.
A stable automation infrastructure also means documenting your setup so recovery is fast when things go wrong. Follow running n8n in production with a proper stability checklist to make sure nothing critical gets overlooked before you go live.
Final Thoughts on Hosting n8n on a VPS
This self-hosted n8n setup guide has covered everything from choosing the right VPS to securing and optimizing your deployment. Each step builds on the last, and skipping any one of them creates gaps in performance or security.
VPS automation deployment done right gives you a production-ready automation server that’s reliable, private, and fully yours. But it does require careful planning upfront.
Invest the time in your setup and you’ll have a scalable n8n hosting solution that grows with your needs without the limitations or costs of a SaaS platform.
Next Steps: What Now?
- Pick a VPS plan that meets your minimum hardware requirements and fits your budget.
- Install Docker and deploy your n8n instance using a solid Docker Compose file.
- Lock down your server with a reverse proxy, SSL certificates, and firewall rules before going live.
- Set up uptime monitoring, automated backups, and restart policies to keep your workflows running reliably.
Further Reading & Useful Resources
- What Is A VPS Used For? Top 10 VPS Use Cases: A great starting point if you’re new to VPS hosting and want to understand what’s possible beyond running n8n.
- Managed vs. Unmanaged VPS: A Detailed Comparison: Helps you decide how much server management you want to handle yourself before committing to a plan.
- What Is Windows VPS? A Guide to Windows Virtual Private Servers : Worth reading if you’re considering a Windows-based environment instead of a Linux VPS installation.
- How to Connect to a VPS (Windows & Linux) Steps + Screenshots : A practical walkthrough for first-time users who need help accessing their server via SSH for the first time.



