Skip to main content
RapidDev - Software Development Agency
n8n-tutorial

How to Install n8n on macOS

Install n8n on macOS using Homebrew with brew install n8n, or using npm with npm install n8n -g after installing Node.js 18 or newer. Start n8n with n8n start and open http://localhost:5678 in your browser. Homebrew is the easiest method as it handles Node.js dependencies automatically.

What you'll learn

  • How to install n8n using Homebrew on macOS
  • How to install n8n using npm with Node.js
  • How to start n8n and create your first owner account
  • How to run n8n as a background service on macOS
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner7 min read10 minutesmacOS 12 Monterey or newer, Homebrew or Node.js 18+March 2026RapidDev Engineering Team
TL;DR

Install n8n on macOS using Homebrew with brew install n8n, or using npm with npm install n8n -g after installing Node.js 18 or newer. Start n8n with n8n start and open http://localhost:5678 in your browser. Homebrew is the easiest method as it handles Node.js dependencies automatically.

Installing n8n on macOS

n8n can be installed on macOS in two ways: Homebrew (the easiest) or npm (more control). Homebrew installs n8n as a formula and manages the Node.js dependency for you. The npm method requires you to install Node.js first, then install n8n as a global package. Both methods give you the full n8n editor and all community nodes. This tutorial walks through both approaches, plus how to keep n8n running in the background using launchd or Docker.

Prerequisites

  • macOS 12 Monterey or newer
  • Terminal access (Applications > Utilities > Terminal, or iTerm2)
  • Homebrew installed (for the Homebrew method) — install from brew.sh
  • A web browser (Safari, Chrome, Firefox)

Step-by-step guide

1

Install n8n with Homebrew (recommended)

Homebrew is the simplest way to install n8n on macOS. If you do not have Homebrew installed, visit brew.sh and follow the one-line install command. Once Homebrew is ready, run brew install n8n to install n8n and its dependencies. Homebrew handles the Node.js requirement automatically. After installation, the n8n command is available in your terminal.

typescript
1# Install Homebrew (if not already installed)
2/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3
4# Install n8n
5brew install n8n
6
7# Verify installation
8n8n --version

Expected result: n8n is installed via Homebrew. Running n8n --version shows the installed version number.

2

Alternative: Install with npm

If you prefer more control over the Node.js version or already have Node.js installed, use npm. First, install Node.js 18 or newer — either from nodejs.org or via Homebrew with brew install node. Then install n8n globally with npm. The -g flag makes the n8n command available system-wide.

typescript
1# Install Node.js via Homebrew (if needed)
2brew install node
3
4# Verify Node.js version (must be 18+)
5node --version
6
7# Install n8n globally
8npm install n8n -g
9
10# Verify installation
11n8n --version

Expected result: Node.js and n8n are installed. Both node --version and n8n --version return version numbers.

3

Start n8n and create your account

Run n8n start in your terminal. n8n starts a web server on port 5678. Open http://localhost:5678 in your browser. On the first run, n8n presents a setup screen where you create an owner account with your name, email, and password. After setup, you land in the n8n editor where you can create workflows. The terminal must stay open while n8n is running.

typescript
1# Start n8n
2n8n start
3
4# Output:
5# n8n ready on 0.0.0.0, port 5678
6# Editor is now accessible via http://localhost:5678

Expected result: n8n is running and accessible at http://localhost:5678. The browser shows the setup screen on first visit.

4

Run n8n in the background

To keep n8n running without keeping a terminal window open, use one of these approaches. For quick background execution, use nohup or the Homebrew services command. For a persistent service that starts on login, create a launchd plist. Docker is another option that keeps n8n isolated from your system.

typescript
1# Option 1: Homebrew services (if installed via brew)
2brew services start n8n
3
4# Option 2: nohup (quick background execution)
5nohup n8n start &
6
7# Option 3: Docker
8docker run -d \
9 --name n8n \
10 -p 5678:5678 \
11 -v n8n_data:/home/node/.n8n \
12 docker.n8n.io/n8nio/n8n
13
14# To stop:
15brew services stop n8n # Option 1
16kill $(pgrep -f 'n8n start') # Option 2
17docker stop n8n # Option 3

Expected result: n8n runs in the background. You can close the terminal and n8n continues running. Access it at http://localhost:5678.

5

Update n8n

Keep n8n updated to get the latest features, bug fixes, and new nodes. The update command depends on your installation method. After updating, restart n8n to apply the changes. Back up your workflows before updating — export them via the UI or CLI as a precaution.

typescript
1# Update via Homebrew
2brew upgrade n8n
3
4# Update via npm
5npm update n8n -g
6
7# Update Docker
8docker pull docker.n8n.io/n8nio/n8n
9docker stop n8n
10docker rm n8n
11docker run -d \
12 --name n8n \
13 -p 5678:5678 \
14 -v n8n_data:/home/node/.n8n \
15 docker.n8n.io/n8nio/n8n

Expected result: n8n is updated to the latest version. Run n8n --version to confirm. Restart n8n to use the new version.

Complete working example

setup-n8n-macos.sh
1#!/bin/bash
2# setup-n8n-macos.sh
3# Install and configure n8n on macOS
4
5set -euo pipefail
6
7echo "=========================================="
8echo " n8n Installation Script for macOS"
9echo "=========================================="
10echo ""
11
12# Check if Homebrew is installed
13if command -v brew &> /dev/null; then
14 echo "Homebrew found: $(brew --version | head -1)"
15else
16 echo "Installing Homebrew..."
17 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
18fi
19
20# Check if n8n is already installed
21if command -v n8n &> /dev/null; then
22 echo "n8n is already installed: $(n8n --version)"
23 echo "Updating to the latest version..."
24 brew upgrade n8n 2>/dev/null || npm update n8n -g
25else
26 echo "Installing n8n via Homebrew..."
27 brew install n8n
28fi
29
30echo ""
31echo "n8n version: $(n8n --version)"
32echo ""
33
34# Ask user how to run n8n
35echo "How would you like to run n8n?"
36echo " 1) Foreground (terminal stays open)"
37echo " 2) Background service (starts on login)"
38echo " 3) Just install, I will start it later"
39echo ""
40read -p "Choose [1/2/3]: " choice
41
42case $choice in
43 1)
44 echo "Starting n8n in foreground..."
45 echo "Open http://localhost:5678 in your browser"
46 echo "Press Ctrl+C to stop"
47 n8n start
48 ;;
49 2)
50 echo "Starting n8n as a background service..."
51 brew services start n8n
52 echo "n8n is running in the background"
53 echo "Open http://localhost:5678 in your browser"
54 echo "To stop: brew services stop n8n"
55 ;;
56 3)
57 echo "Installation complete!"
58 echo "To start n8n, run: n8n start"
59 echo "Then open http://localhost:5678"
60 ;;
61 *)
62 echo "Installation complete!"
63 echo "To start n8n, run: n8n start"
64 ;;
65esac

Common mistakes when installing n8n on macOS

Why it's a problem: Using a Node.js version older than 18

How to avoid: n8n requires Node.js 18 or newer. Run node --version to check. If it is older, update with brew upgrade node or install the latest LTS from nodejs.org.

Why it's a problem: Closing the terminal window and n8n stops running

How to avoid: Use brew services start n8n to run n8n as a background service that persists after closing the terminal and starts automatically on login.

Why it's a problem: Installing n8n with npm without the -g flag

How to avoid: Without -g, n8n is installed locally in the current directory only. Use npm install n8n -g to install globally so the n8n command works from anywhere.

Why it's a problem: Port 5678 is already in use by another application

How to avoid: Either stop the other application using port 5678, or start n8n on a different port: N8N_PORT=5679 n8n start.

Best practices

  • Use Homebrew for the simplest installation and updates — it handles dependencies automatically
  • Run n8n as a background service with brew services start n8n for persistent operation
  • Back up your workflows before updating n8n to a new version
  • The .n8n directory at ~/.n8n contains your database and settings — include it in your backups
  • Use Docker if you want to isolate n8n from your system Node.js installation
  • If using nvm, pin a specific Node.js version for n8n to avoid compatibility issues after switching versions
  • Check n8n's release notes before updating to understand breaking changes

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I want to install n8n on my Mac. What is the easiest method? Show me how to install it, start it, and set it up to run in the background so it starts automatically when I log in.

n8n Prompt

How do I install n8n on macOS? I prefer using Homebrew. Show me the install command, how to start n8n, and how to run it as a background service.

Frequently asked questions

Is Homebrew or npm better for installing n8n on macOS?

Homebrew is easier because it handles the Node.js dependency automatically and provides simple service management with brew services. Use npm if you need a specific Node.js version or already manage Node.js with nvm.

Where does n8n store its data on macOS?

n8n stores its SQLite database, credentials, and settings in the ~/.n8n directory (i.e., /Users/YourUsername/.n8n). Back up this directory regularly.

How do I stop n8n on macOS?

If running in the foreground, press Ctrl+C. If running as a Homebrew service, use brew services stop n8n. If running in Docker, use docker stop n8n.

Can I run n8n on an M1/M2/M3 Mac (Apple Silicon)?

Yes. n8n runs natively on Apple Silicon Macs. Both the Homebrew and npm installation methods work on ARM-based Macs without any special configuration.

How do I change the port n8n runs on?

Set the N8N_PORT environment variable before starting n8n. For example: N8N_PORT=5679 n8n start. This starts n8n on port 5679 instead of the default 5678.

Can RapidDev help set up n8n for production use on macOS or a cloud server?

Yes. RapidDev can install, configure, and maintain production n8n deployments on macOS, Linux, or cloud infrastructure. Contact RapidDev for a free consultation.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.