How to Install n8n: A Complete Setup Guide for Every Environment

n8n is an open-source workflow automation tool that lets you connect apps, automate repetitive tasks, and build complex integrations — without needing to write much code. Whether you're a developer, a small business owner, or a power user tired of manual processes, knowing how to install n8n correctly is the first step to getting real value from it.

The installation process isn't one-size-fits-all. Where you run n8n, what operating system you're on, and how much traffic or complexity you expect all shape which setup path makes the most sense.

What Is n8n and Why Installation Method Matters

n8n (pronounced "n-eight-n") runs as a Node.js application and can be deployed in several different environments. Unlike purely cloud-based tools, n8n gives you the option to self-host — meaning your data and workflows stay on your own machine or server.

This flexibility is a strength, but it also means there's no single install button. Your setup will depend on:

  • Whether you want a local, cloud, or server-based installation
  • Your operating system (Windows, macOS, or Linux)
  • Whether you're comfortable with the command line
  • Whether you're testing privately or running workflows in production

Installation Method 1: Using npm (Node Package Manager)

The most direct way to install n8n on any desktop or server is via npm, which comes bundled with Node.js.

Prerequisites:

  • Node.js version 18 or higher installed on your machine
  • npm (included with Node.js)
  • A terminal or command prompt

Steps:

  1. Open your terminal
  2. Install n8n globally by running:
    npm install -g n8n 
  3. Once installed, start n8n with:
    n8n start 
  4. Open your browser and go to http://localhost:5678

That's the core flow. On first launch, n8n will prompt you to create an owner account. From there, you're inside the visual workflow editor.

⚙️ Keep in mind: Global npm installs can sometimes conflict with other Node.js projects on your machine, especially if you're managing multiple Node versions. Tools like nvm (Node Version Manager) can help isolate environments.

Installation Method 2: Docker (Recommended for Most Server Setups)

Docker is the most popular way to run n8n in production or on a remote server. It packages n8n with all its dependencies in an isolated container, which reduces compatibility issues and makes updates cleaner.

Prerequisites:

  • Docker installed on your system
  • Basic familiarity with Docker commands

Basic Docker command:

docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n docker.n8n.io/n8nio/n8n 

This pulls the official n8n image, exposes port 5678, and mounts a local volume so your workflows and credentials persist between restarts.

For more robust setups — especially those requiring a persistent database, environment variables, or multiple services — Docker Compose is the better approach. A docker-compose.yml file lets you define n8n alongside a PostgreSQL or MySQL database in a single configuration.

🐳 Docker on Windows works through Docker Desktop and WSL 2 (Windows Subsystem for Linux). It's fully functional but adds a layer of setup compared to native Linux environments.

Installation Method 3: n8n Cloud (No Installation Required)

If self-hosting isn't a priority, n8n Cloud is the managed option. You create an account on n8n's website, and the platform handles hosting, updates, and infrastructure entirely.

This approach is best suited for:

  • Users who want to get started quickly without server management
  • Teams who prefer not to maintain infrastructure
  • Workflows that don't involve sensitive data requiring on-premise storage

The tradeoff is that you're on a subscription model rather than running free open-source software on your own hardware.

Comparing Installation Options

MethodBest ForTechnical Skill RequiredData Control
npmLocal testing, developmentLow–MediumFull (local)
DockerProduction, servers, teamsMediumFull (self-hosted)
Docker ComposeScalable, database-backed setupsMedium–HighFull (self-hosted)
n8n CloudQuick start, no infrastructureLowShared (managed)

Key Variables That Affect Your Setup

Even within each method, several factors will change what your specific installation looks like:

  • Database choice: By default, n8n uses SQLite, which works fine for personal use. For team environments or high-volume workflows, switching to PostgreSQL is strongly recommended.
  • Reverse proxy setup: If you're running n8n on a server and want it accessible via a domain name (rather than an IP and port), you'll need to configure a reverse proxy like Nginx or Caddy and handle SSL certificates.
  • Environment variables: n8n uses environment variables to configure encryption keys, webhook URLs, authentication, timezone settings, and more. These matter more in production than in local testing.
  • Operating system: Linux (particularly Ubuntu or Debian) is the most documented and stable environment for self-hosted n8n. macOS works well for development. Windows users often find Docker to be the smoother path.
  • Memory and CPU: n8n is relatively lightweight for simple workflows, but complex automations running simultaneously — especially with many integrations — will benefit from a server with at least 2 GB of RAM and a modern CPU.

After Installation: First Steps

Once n8n is running and you've accessed the editor at localhost:5678 (or your server's address), the setup process continues:

  1. Create your owner account
  2. Configure encryption keys via environment variables (critical for credential security)
  3. Set your webhook URL if you plan to trigger workflows from external services
  4. Connect your first integration and build a test workflow

n8n's interface is node-based — each "node" represents an app, action, or logic step. The learning curve is manageable, but the depth of what you can automate expands significantly once you understand how data flows between nodes.

The Part That Depends on You

The technical steps for installing n8n are well-documented and consistent. What varies is everything around them: your server environment, whether you need a database, how you'll handle authentication, and whether you're building something personal or running it for a team.

Someone testing n8n on a laptop for personal automations has a very different setup path than someone deploying it on a VPS with a domain, SSL, and PostgreSQL backing. Both start with the same software — but the decisions along the way are shaped entirely by what you're trying to build and the environment you're building it in.