How to Self-Host n8n on a VPS in 2026

betterornotss5 pts0 comments

How to Self-Host n8n on a VPS (2026 Guide) | VeerHost

If you’re running more than a handful of automations, you’ve probably felt it: the “API tax.” Every execution on a cloud automation platform has a price tag, and in 2026 – with AI agents chaining together dozens of steps per run, calling LLMs, querying vector databases, and looping until a task is done – that tax adds up fast. n8n Cloud pricing scales with usage, which is fine for light workloads, but painful once you’re running autonomous agents around the clock.<br>Self-hosting n8n on your own VPS removes that ceiling entirely. You get unlimited workflow executions, full control over your data (important if you’re in healthcare, finance, or anywhere with compliance requirements), and the ability to connect n8n directly to self-hosted AI models, private databases, and internal tools that would never touch a public cloud.<br>This guide walks through the entire process of self-hosting n8n on a VPS in 2026: server setup, Docker and Docker Compose, PostgreSQL, a Nginx reverse proxy, free SSL, security hardening, backups, and how to get your first AI agent workflow running. By the end, you’ll have a production-ready n8n instance that costs a fraction of n8n Cloud and that you fully own.<br>What Is n8n?<br>n8n is an open-source workflow automation platform built around a visual, node-based editor. It connects apps, APIs, databases, and – increasingly in 2026 – AI models and autonomous agents, letting you build multi-step automations without writing glue code for every integration. Unlike Zapier or Make, n8n is source-available, meaning you can run the Community edition on your own infrastructure for free, with no cap on how many workflows you run.<br>The project has grown well past its original “Zapier alternative” reputation. n8n’s core codebase now ships with a native AI Agent node that supports structured tool calling, multiple memory backends, and a ReAct-style reasoning mode – meaning you can build agents that search the web, query your own data, and take multi-step actions, all from a visual canvas instead of hand-written orchestration code.<br>Why Self-Host n8n Instead of Using n8n Cloud?<br>n8n Cloud is a fine starting point, but self-hosting makes sense the moment your automations become part of how your business actually runs. Here’s why:<br>No per-execution costs. Self-hosted n8n Community edition has unlimited workflow executions. As your AI agents run more steps and loops, this is the difference between a predictable hosting bill and a runaway invoice.<br>Full data sovereignty. Your workflow data, credentials, and execution history never leave your own server – a requirement for teams in regulated industries.<br>Deep customization. Self-hosted instances can install community nodes, connect to internal-only databases and APIs, and run alongside other self-hosted tools on the same VPS.<br>Connect to self-hosted AI. You can point n8n’s AI Agent node at a local model running through Ollama instead of paying per-token for a hosted LLM, keeping sensitive prompts entirely on your own infrastructure.<br>Predictable pricing. A VPS costs the same whether you run 500 or 500,000 executions a month.<br>The trade-off is that you’re responsible for the server: updates, backups, and security. That’s exactly what the rest of this guide covers.<br>What You’ll Need Before You Start<br>A VPS running Ubuntu 22.04 or 24.04, with at least 2 vCPUs and 4GB of RAM. n8n itself is lightweight, but AI agent workflows that call local models or process large payloads benefit from extra headroom – VeerHost’s n8n Hosting plans are pre-sized for exactly this.<br>SSH access to your server and basic comfort with the command line.<br>A domain or subdomain you can point at the server (for example, n8n.yourdomain.com), which you’ll need for webhooks and SSL.<br>Roughly 30-45 minutes for the initial setup.<br>Step 1: Set Up and Connect to Your VPS<br>If you’re starting from a brand-new server, walk through our Getting Started with Your VeerHost VPS guide first – it covers your first SSH login, changing the root password, and updating system packages, all of which this guide assumes are already done.<br>Connect over SSH:<br>ssh root@YOUR_VPS_IPThen make sure your packages are current:<br>apt update && apt upgrade -yStep 2: Point Your Domain to the VPS<br>n8n relies on a real domain for webhooks (the URLs external services call to trigger your workflows) and for SSL. Create an A record for a subdomain such as n8n.yourdomain.com pointing at your server’s IP address. Our guide on pointing a domain to your VeerHost VPS walks through this step by step, including how to verify propagation before moving on.<br>Step 3: Secure the Server Before Installing Anything<br>It’s tempting to install n8n first and lock things down later. Don’t. A freshly provisioned VPS is scanned by bots within minutes of going live, and n8n workflows often hold API keys and credentials that you really don’t want exposed. Before continuing, follow our full VPS security guide to create a non-root...

self server guide cloud hosted step

Related Articles