There’s a moment when you first log into a freshly installed n8n instance that feels a bit like opening a new workshop before you’ve filled it with tools. The canvas is clean, the possibilities feel endless, and you’re not entirely sure where to start. I remember that moment vividly — and I remember how quickly it turned into genuine excitement as I started connecting my first nodes. This guide is going to take you from zero to a fully functional n8n installation, either locally for learning or on a VPS for production use. By the end, you’ll have an automation platform that can grow with you for years.
Why n8n Is Worth Learning Deeply
Before we get into the installation, let me make the case for why n8n specifically is worth your time over alternatives like Zapier or Make.com. The primary reason is economics at scale. When you run n8n on your own VPS, there are no per-task or per-operation limits. You can execute 500,000 workflow runs per month for the same $5-10 server cost as 50 runs. As your automation portfolio grows, this difference becomes enormous — I’ve seen businesses save $2,000-3,000 per month by migrating from Zapier to self-hosted n8n.
The second reason is flexibility. n8n’s Code node lets you write JavaScript or Python directly within your workflow, which means you can do anything programmable rather than being limited to what the visual nodes support. Its AI Agent nodes are among the most powerful in any automation platform, supporting LangChain-based agents with memory, tool calling, and RAG capabilities. And its sub-workflow feature allows you to build genuinely complex, modular automation systems that would be impossible to manage in Zapier. Once you’ve worked with n8n deeply, going back to simpler tools feels genuinely limiting.
Option 1: Local Installation for Learning and Development
If you’re just getting started and want to learn n8n before committing to a server, a local installation is the perfect approach. You can run n8n directly on your laptop using Node.js and npm. The prerequisites are simple: Node.js version 18 or higher (download from nodejs.org) and npm, which comes bundled with Node.js. On Windows, you might also want to install Git Bash for a better command-line experience. On Mac, you can use the built-in Terminal with Homebrew for package management.
With Node.js installed, open your terminal and run: npm install n8n -g. This installs n8n globally on your system. Once complete, start it with n8n start. You’ll see logs as n8n initializes its database and starts the web server, and within about 30 seconds you’ll see a message indicating n8n is running at http://localhost:5678. Open that URL in your browser, create your account, and you’re in. The local installation uses SQLite as its database by default, which is perfectly fine for learning but not recommended for production where you’d want PostgreSQL for reliability and performance.
Option 2: Docker Installation (Recommended for Production)
For production use — or even for local development if you want a setup that mirrors production — Docker is the way to go. Docker containerizes n8n so it runs consistently across any environment and makes upgrades, backups, and migrations much simpler. First, install Docker Desktop from docker.com if you’re on a local machine, or install Docker Engine on your VPS using your distribution’s package manager.
The simplest Docker command to run n8n is: docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n docker.n8n.io/n8nio/n8n. This mounts a local directory to persist your workflow data, maps port 5678 so you can access the UI in your browser, and runs n8n interactively. For a more production-ready setup, you’ll want to use Docker Compose with environment variables for configuration and a named volume for persistent storage. We cover the full Docker Compose setup with PostgreSQL and proper configuration in Part 2 of this series.
Setting Up n8n on a VPS for Production
For real automation work — workflows running on schedules, receiving webhooks from external services, handling customer data — you need n8n accessible 24/7 from the internet, not just from your laptop. A VPS (Virtual Private Server) is the most cost-effective solution. I use and recommend DigitalOcean, Hetzner, or Vultr depending on your location and budget. A $6/month Hetzner instance handles thousands of workflow executions per day without breaking a sweat.
Once you’ve provisioned your VPS with Ubuntu 22.04 LTS, connect via SSH and run the following sequence: update your packages with apt update && apt upgrade -y, install Docker with the official install script (curl -fsSL https://get.docker.com | sh), install Docker Compose (apt install docker-compose -y), create a dedicated directory for n8n (mkdir /opt/n8n && cd /opt/n8n), and then create your docker-compose.yml file with your configuration. We’ll cover the exact configuration file in detail in Part 2, but the essentials are: PostgreSQL as your database, an n8n service with proper environment variables, and Nginx as a reverse proxy with SSL termination so n8n is accessible via your domain with HTTPS.
First Steps After Installation
Once you’re logged into your n8n instance, take a few minutes to explore before building your first workflow. The Credentials section (accessible from the left menu) is where you’ll store all your API keys and authentication tokens. Best practice is to add your credentials here first — OpenAI API key, Gmail OAuth, Slack webhook URL — before building workflows, so they’re ready to use when you need them. Credentials in n8n are encrypted at rest and never exposed in plain text, which is important from a security perspective.
The Template library (accessible from the top menu or at n8n.io/workflows) is an excellent starting point. There are thousands of community-contributed templates covering everything from simple notifications to complex AI agent pipelines. Browse the AI and Automation categories to get a feel for what’s possible, and don’t hesitate to import and modify templates rather than building everything from scratch. Learning from existing workflows accelerates your understanding enormously.
Your First Workflow: Testing Your Installation
Let’s build something simple to confirm everything is working. Click the “+” button to create a new workflow. Add a Manual Trigger node (this lets you run the workflow by clicking a button). Add an HTTP Request node and configure it to call a public API — try api.github.com/zen for a random inspirational quote from GitHub’s API. Connect the Manual Trigger to the HTTP Request. Click Execute and you should see the API response appear in the node’s output panel. If you see the response, your n8n installation is working correctly and can communicate with external APIs — which is the foundation of everything we’ll build together.
In the next part, we’ll set up a proper production-grade Docker stack with PostgreSQL, Redis for queue management, and Nginx with SSL. That infrastructure will be the foundation for every workflow we build throughout this series. See you there.