Mac users often want a seamless way to harness the power of automation without needing to wrestle with complex setup processes. If you're looking to install n8n on macOS, you're in the right place. Whether you're a beginner exploring no-code workflows or an automation enthusiast expanding your toolset, this step-by-step guide will walk you through the easiest way to get n8n running smoothly on your Mac. We'll cover everything from prerequisites to running your first workflow locally.
What is n8n and Why Use It on macOS?
n8n (pronounced “n-eight-n”) is an open-source workflow automation tool that connects apps and automates tasks through customizable workflows. Think Zapier, but self-hosted and with powerful developer control. Installing it on your Mac allows you to build and test workflows locally before deploying to production or the cloud.
Key Benefits of Using n8n on macOS
- Local testing and debugging: Perfect for development workflows.
- No monthly fees: Run the open-source version free on your computer.
- Full control: Customize integrations and plugins as needed.
- Secure: Keep your data local instead of sending it to third-party clouds.
Let’s get started with the installation.
Step 1: Prerequisites Before Installing n8n
Before you install n8n on macOS, make sure you have the following software set up on your system:
Install Homebrew (if not already installed)
Homebrew makes it easier to install and manage package dependencies on macOS.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Node.js and npm
n8n is built with Node.js, so you'll need it installed.
brew install node
After installing, check the versions:
node -v
npm -v
Recommended:
- Node.js: v16.x or newer
Step 2: Install n8n on macOS Locally
Now that Node.js is installed, it's time to install n8n globally via npm.
npm install n8n -g
This command installs n8n globally so you can run it from anywhere in your terminal. Once installed, run:
n8n
This should start the n8n UI and make it available in your browser at:
http://localhost:5678
🎉 Congratulations! You now have n8n running natively on your Mac.
Step 3: Optional — Create a Convenient Launcher Script
To avoid running n8n
manually each time, create a simple bash script or use macOS's Automator for a more user-friendly experience.
Using Terminal Alias
Add this to your .zshrc
or .bash_profile
:
alias startn8n="n8n"
Now you can just type startn8n
anytime in your terminal to launch.
Using macOS Automator to Create a Desktop App
- Open Automator
- Select New Document → Application
- Add Run Shell Script
- Paste:
n8n
- Save the app (e.g., name it
Launch n8n
) - Double-click to launch like any other Mac app
Step 4: Persist Workflows and Data Locally
One downside of running n8n using the basic method above is that workflows and credentials are not saved persistently between restarts by default. You can improve this with a few extra setup steps.
Use Environment Variables
Create an environment file .env
in your project directory:
export N8N_BASIC_AUTH_ACTIVE=true
export N8N_BASIC_AUTH_USER=admin
export N8N_BASIC_AUTH_PASSWORD=securepassword
export DB_TYPE=sqlite
export DB_SQLITE_LOCATION=~/.n8n/database.sqlite
export N8N_HOST=localhost
export N8N_PORT=5678
export N8N_EDITOR_BASE_URL=http://localhost:5678
Then run n8n with:
source .env && n8n
This will enforce password authentication and store your workflows in SQLite, which keeps your data even after reboots.
Step 5: Try Your First Automation
Now that you’re up and running, try building your first simple workflow.
Example: Email Yourself When a New GitHub Issue is Created
- Open n8n in your browser at
http://localhost:5678
- Add a trigger node: GitHub → Trigger on New Issue
- Add an action node: Gmail → Send Email
- Connect the two nodes, configure credentials, and click “Execute Workflow”
- Save and activate
This basic workflow notifies you via email each time a new issue is created in your GitHub repo — great for dev teams and solo coders.
Troubleshooting Common Issues
Here’s a quick table outlining common errors and solutions:
Problem | Possible Cause | Solution |
---|---|---|
n8n: command not found |
n8n not installed globally | Run npm install n8n -g again |
Port 5678 in use | Another app is running on that port | Change port with export N8N_PORT=XXXX |
Workflow not saving | No DB configured for persistence | Set DB_TYPE and DB_SQLITE_LOCATION |
Can’t access via browser | App not running, port blocked, or crash | Circle back and confirm install steps |
Pro Tip: Docker Installation (Alternative Method)
Advanced users or teams wanting more complex setups may prefer using Docker for installation.
docker run -it --rm \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
This method ensures persistent storage and easy transfer across environments.
Best Practices for Running n8n on macOS
- Use environment files for configuration and secrets management
- Back up your
.n8n
folder regularly if using local storage - Consider workflow versioning with Git integration
- Avoid hardcoding secrets in workflows
These steps ensure you use n8n safely and reliably in a development environment.
FAQ
Is it safe to run n8n locally on macOS?
Yes. Running n8n locally is secure, especially if you're using authentication and not exposing it to the public internet. For extra protection, enable SSL and use strong passwords.
Can I run n8n without Docker?
Absolutely. Installing via Node.js and npm is a supported and popular method, particularly for local development on macOS.
What database does n8n use by default?
By default, n8n uses SQLite for lightweight local workflows. You can switch to PostgreSQL or MySQL for larger-scale or production setups.
Where does n8n store workflows?
If not configured otherwise, workflows are stored in memory and lost upon restart. For persistence, configure an SQLite or external database path using environment variables.
How do I update n8n once installed?
To update, run:
npm install n8n -g
This will download and install the latest version available.
With n8n installed on your macOS machine, you've unlocked a powerful new way to automate your digital workflow. Whether you’re building complex CRM integrations or simple “if-this-then-that” automations, n8n gives you the power to design any process your work demands — right from your Mac.