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
Install n8n with Homebrew (recommended)
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.
1# Install Homebrew (if not already installed)2/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"34# Install n8n5brew install n8n67# Verify installation8n8n --versionExpected result: n8n is installed via Homebrew. Running n8n --version shows the installed version number.
Alternative: Install with npm
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.
1# Install Node.js via Homebrew (if needed)2brew install node34# Verify Node.js version (must be 18+)5node --version67# Install n8n globally8npm install n8n -g910# Verify installation11n8n --versionExpected result: Node.js and n8n are installed. Both node --version and n8n --version return version numbers.
Start n8n and create your account
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.
1# Start n8n2n8n start34# Output:5# n8n ready on 0.0.0.0, port 56786# Editor is now accessible via http://localhost:5678Expected result: n8n is running and accessible at http://localhost:5678. The browser shows the setup screen on first visit.
Run n8n in the background
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.
1# Option 1: Homebrew services (if installed via brew)2brew services start n8n34# Option 2: nohup (quick background execution)5nohup n8n start &67# Option 3: Docker8docker run -d \9 --name n8n \10 -p 5678:5678 \11 -v n8n_data:/home/node/.n8n \12 docker.n8n.io/n8nio/n8n1314# To stop:15brew services stop n8n # Option 116kill $(pgrep -f 'n8n start') # Option 217docker stop n8n # Option 3Expected result: n8n runs in the background. You can close the terminal and n8n continues running. Access it at http://localhost:5678.
Update n8n
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.
1# Update via Homebrew2brew upgrade n8n34# Update via npm5npm update n8n -g67# Update Docker8docker pull docker.n8n.io/n8nio/n8n9docker stop n8n10docker rm n8n11docker run -d \12 --name n8n \13 -p 5678:5678 \14 -v n8n_data:/home/node/.n8n \15 docker.n8n.io/n8nio/n8nExpected result: n8n is updated to the latest version. Run n8n --version to confirm. Restart n8n to use the new version.
Complete working example
1#!/bin/bash2# setup-n8n-macos.sh3# Install and configure n8n on macOS45set -euo pipefail67echo "=========================================="8echo " n8n Installation Script for macOS"9echo "=========================================="10echo ""1112# Check if Homebrew is installed13if command -v brew &> /dev/null; then14 echo "Homebrew found: $(brew --version | head -1)"15else16 echo "Installing Homebrew..."17 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"18fi1920# Check if n8n is already installed21if command -v n8n &> /dev/null; then22 echo "n8n is already installed: $(n8n --version)"23 echo "Updating to the latest version..."24 brew upgrade n8n 2>/dev/null || npm update n8n -g25else26 echo "Installing n8n via Homebrew..."27 brew install n8n28fi2930echo ""31echo "n8n version: $(n8n --version)"32echo ""3334# Ask user how to run n8n35echo "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]: " choice4142case $choice in43 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 start48 ;;49 2)50 echo "Starting n8n as a background service..."51 brew services start n8n52 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 ;;65esacCommon 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.
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.
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.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation