Want to run n8n on your own machine so you can build AI agents, chatbots and automations safely and offline? Great — this guide walks you through everything: prerequisites, installation, running n8n, updating it, switching versions, and a few tips for production. I’ll also summarize the cheap Google Cloud option I demonstrate in my video.
What you’ll achieve
- Install n8n locally (macOS / Windows / Linux)
- Start and access the n8n UI on your machine
- Update n8n to the latest version or install a specific version
- Quick notes on taking n8n to the cloud (cheap Google Cloud example)
Prerequisites
- A computer (macOS, Windows, or Linux).
- Administrator rights to install software.
- Node.js (LTS) installed. Download & install from nodejs.org and choose the installer for your OS.
1. Install Node.js
- Go to the Node.js website and download the LTS version for your OS.
- Run the installer and follow the prompts.
- Verify installation in a terminal / command prompt:
node --version
npm --version
You should see version numbers for both.
2. Install n8n globally with NPM
Open Terminal (macOS/Linux) or PowerShell / Command Prompt (Windows) and run:
npm install -g n8n
Notes:
- If you get permission errors on macOS/Linux, either use a Node version manager (recommended) or run with
sudo
(less recommended):sudo npm install -g n8n
. - Installing globally makes the
n8n
command available system-wide.
3. Run n8n locally
In the same terminal, start n8n:
n8n
or on some setups:
n8n start
When it starts you’ll see terminal output. The CLI often shows a prompt like Press O to open in browser — press O
or open your browser at:
http://localhost:5678
(If the terminal shows a different port, use that URL.)
4. First-time setup (UI)
- The first time you open n8n in the browser it may ask you to create an account (name, email, username, password).
- After setup you’ll land in the n8n dashboard and can view or create workflows.
5. Quick exploration
- Open Help → About in the UI to see the running version.
- Browse the workflows list — you can import/export workflows from the UI.
- Test a simple workflow (e.g., webhook → function → response) to confirm the instance is working.
6. Update n8n (local installation)
To update your globally installed n8n to the latest release, run one of these:
npm update -g n8n
or
npm install -g n8n@latest
After updating, restart n8n (Ctrl+C
to stop, then n8n
to start). Your workflows should remain saved, but always export or backup important workflows/config before major upgrades.
7. Install a specific / older version
If you need to install a particular version (example: 1.19.0
), run:
npm install -g [email protected]
Then restart n8n. This is useful if a workflow depends on a specific release or if you want to test compatibility.
8. Check n8n version from CLI or UI
- CLI:
n8n --version
- UI: Help → About
9. Stopping and restarting
- Stop:
Ctrl + C
in the terminal where n8n is running. - Restart:
n8n
If you want n8n to run in the background long-term, consider using a process manager (pm2, systemd) or run it on a VM/Cloud server (see next section).
10. Cheap Google Cloud option (summary)
- Running n8n on your own machine is great for learning and development. For 24×7 operation you’ll want a cloud VM or the official n8n Cloud.
- In the video I show a Google Cloud VM where I ran n8n 24×7. Over 23 days that setup cost ~$0.59 (this included an API usage portion like Gemini in my example). That makes Google Cloud a very cheap option for personal/learning use, but not recommended for mission-critical client production without proper hosting practices and backups.
11. Tips, backups & production notes
- Back up workflows before upgrades — export via the UI or back up the underlying database.
- If you move to production:
- Use Docker, a managed VM, or n8n Cloud for reliability.
- Add HTTPS, authentication, and a database that fits your needs (SQLite is common for local/dev; Postgres or MySQL recommended for production).
- If you use API keys (OpenAI/Gemini/etc.), keep them in environment variables — never hardcode into a workflow.
- If you see permission issues during install, prefer using
nvm
(Node Version Manager) to avoidsudo
.
12. Troubleshooting (common)
Permission denied
during npm install → use nvm or run with elevated privileges.- Browser won’t open → check the terminal for port number and open
http://localhost:<port>
. - Workflows missing after update → ensure you exported them or that your database path did not change.
Wrap-up & resources
You now have n8n running locally, know how to update it, and can switch versions. This setup is perfect for experimenting with AI agents, chatbots, and custom automations without exposing data to the internet.
Want the full walkthrough and the Google Cloud cost demo? Check the video and the N8n playlist (link in the video description). If you want, I can also:
- Write a shorter quick-start cheat sheet you can paste in your docs, or
- Create a “n8n local install” one-page printable checklist.