Affiliate/Ads disclaimer: Some links on this blog are affiliate/ads links to support this project going on, meaning I may earn a commission at no extra cost to you.
n8n Local Installation 101: A Beginner’s Blog
Because “locally hosted” should not mean “locally haunted.”
0. Prologue – Why I wrote this
Last weekend a friend DM’d me:
“I want to automate my cat-photo newsletter, but the cloud costs more than kibble. Help?”
If you’ve ever felt the same, welcome. Below are two dead-simple ways to run n8n on your machine—explained like we’re talking over coffee, not at a Linux conference.
1. The two gardening strategies
| Strategy | Analogy | Tech translation |
|---|---|---|
| A. Docker One-Pot | Buy a ready-made succulent | Download a pre-built image, press “play,” |
| B. npm Seed-to-Plant | Sow seeds in your backyard | Install Node.js, then npm install -g n8n |
Pick ONE. Both end with the same blooming interface at http://localhost:5678.
2. Route A – Docker One-Pot Method (5 min)
| Step | What you do | Coffee-shop analogy |
|---|---|---|
| 1 | Install Docker Desktop | Walk into the “flower-shop app”; it’s free for personal use |
| 2 | Pull the n8n image | Point at the prettiest succulent and say, “I’ll take that one.” |
| 3 | Create a data folder | Choose a sunny windowsill (e.g. D:\n8n-data) |
| 4 | Run the container | Place the pot on the sill; water once (the command below) |
| 5 | Open browser → http://localhost:5678 | Smell the flowers. |
Copy-paste command (PowerShell / Terminal):
docker run -d --name n8n -p 5678:5678 ^ -v D:\n8n-data:/home/node/.n8n ^ -e N8N_BASIC_AUTH_ACTIVE=true ^ -e N8N_BASIC_AUTH_USER=admin ^ -e N8N_BASIC_AUTH_PASSWORD=cat123 ^ n8nio/n8n
Flags translated:
-d= run in background (minimize window)-p= open window #5678 so your browser can peek in-v= glue the plant to your windowsill (persistent data)-e= optional sticky notes: “Keep the gate closed, password is cat123”
3. Route B – npm Seed-to-Plant Method (7 min)
| Step | What you do | Backyard analogy |
|---|---|---|
| 1 | Install Node.js LTS | Till the soil (grab the installer at nodejs.org) |
| 2 | npm install -g n8n | Sprinkle seeds |
| 3 | n8n start | Water and wait 10 s |
| 4 | Browse to http://localhost:5678 | First sprout appears |
| 5 | (Optional) n8n export:workflow --all | Save seeds for next season |
Where does n8n store my “tomatoes”?
- Windows:
C:\Users\<you>\.n8n - macOS/Linux:
~/.n8n
Back that folder up before you reinstall the OS.
4. TL;DR – Which route should I pick?
| Scenario | Pick | One-liner reason |
|---|---|---|
| “I just want it to work.” | Docker | Two copy-pastes, done. |
| Corporate laptop blocks Docker | npm | Only needs Node.js—no admin rights? Use a Node version manager. |
| Hobby dev who loves source code | npm | which n8n → edit files live. |
5. Common rookie traps (and the quick escape)
| Trap | Symptom | Fix |
|---|---|---|
| Port 5678 already in use | Browser spins forever | Change to 6688: docker run … -p 6688:5678 … |
| Chinese or space in folder path | Docker screams “invalid mount” | Move to D:\n8n-data |
| Shut laptop, n8n gone (npm) | “Connection refused” next day | Run n8n start again, or set up PM2 / systemd service |
| Forgot password | You set cat123 but now…? | docker exec -it n8n sh then n8n user-management:reset |
6. Upgrading without tears
| Method | Upgrade one-liner |
|---|---|
| Docker | docker pull n8nio/n8n:latest && docker stop n8n && docker rm n8n && (re-run the run command) |
| npm | npm update -g n8n |
7. Epilogue – Go automate something cute
Whether you chose the instant succulent or the home-grown tomato, you now own a private, free, fully-functioning automation greenhouse.
Next tutorial: “How to email yourself a daily cat GIF using n8n and 0 lines of code.”
Stay tuned, and happy gardening!