n8n Local Setup Guide + Global Access via Ngrok & Cloudflare

Learn how to install n8n on Mac, Windows, or Linux and share it online using Ngrok or Cloudflare Tunnel. Perfect for automation testing, client demos, and workflow development.

n8n Local Setup Guide + Global Access via Ngrok & Cloudflare

Automation is transforming the way we work — and tools like n8n make it easier than ever to connect apps, automate workflows, and eliminate repetitive tasks.

But here’s the challenge: you’ve built something amazing locally, and now you want to test it with real external webhooks or share it instantly with a client — without deploying it to the cloud.

That’s where Ngrok and Cloudflare Tunnel come in. These tools create a secure bridge between your local machine and the internet, giving you a shareable, public link to your local n8n instance.

In this guide, you’ll learn:

  • How to install n8n on Mac, Windows, and Linux.
  • How to make it accessible online using Ngrok or Cloudflare Tunnel.
  • Security best practices to keep your local instance safe.

Whether you’re testing integrations, running client demos, or just exploring automation ideas, this setup will save you hours.

1.1 Prerequisites

  • Node.js (v18 or later) — Download here
  • npm or yarn (comes with Node.js)
  • Homebrew (brew) — a popular macOS package manager that makes installing tools easier. Install it with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

1.2 Install Node.js via Homebrew (Optional)

brew install node

1.3 Install n8n Globally

npm install n8n -g

1.4 Start n8n

n8n

Access it at: http://localhost:5678

Pro Tip: Use n8n start --tunnel for quick testing, but for more reliable sharing, use Ngrok or Cloudflare.

2.1 Prerequisites

  • Node.js (v18 or later) — Download here
  • npm (comes with Node.js)
  • Chocolatey (choco) — a package manager for Windows that lets you install tools directly from PowerShell or Command Prompt. Install from here.

2.2 Install n8n

npm install n8n -g

2.3 Start n8n

n8n

Access it at: http://localhost:5678

3.1 Prerequisites

  • Snap (snap) — a Linux package manager for easy installs.
  • Node.js — install with:
sudo apt update
sudo apt install nodejs npm

3.2 Install n8n

sudo npm install n8n -g

3.3 Start n8n

n8n

Access it at: http://localhost:5678

Pro Tip: Run n8n as a systemd service for reliability on Linux servers.

4.1 Install Ngrok

  • Sign up at ngrok.com to get your auth token.
  • Install via:
brew install ngrok/ngrok/ngrok  # Mac
choco install ngrok             # Windows
sudo snap install ngrok         # Linux

4.2 Authenticate Ngrok

ngrok config add-authtoken YOUR_AUTHTOKEN

4.3 Start Tunnel

ngrok http 5678
  • You’ll get a URL like: https://random-id.ngrok.io
  • Keep both terminals open (one for n8n, one for ngrok).

Pro Tip: Reserve a custom subdomain for stable links.

5.1 Install Cloudflare Tunnel (cloudflared)

brew install cloudflared       # Mac
choco install cloudflared      # Windows
sudo apt install cloudflared   # Linux

5.2 Authenticate with Cloudflare

cloudflared tunnel login

5.3 Start a Quick Tunnel to your local n8n

cloudflared tunnel --url http://localhost:5678
  • You’ll get a URL like: https://random-name.trycloudflare.com
  • Keep both terminals open (one for n8n, one for cloudflared).

6.1 Set n8n to use public URL from Ngrok or Cloudflare for webhook nodes

# Stop n8n, then run with your public URL:
export WEBHOOK_URL="https://your-public-url.com"
n8n
# Stop n8n, then run with your public URL:
$env:WEBHOOK_URL="https://your-public-url.com"
n8n
# Stop n8n, then run with your public URL:
export WEBHOOK_URL="https://your-public-url.com"
n8n

6.2 Add basic auth in n8n when exposing publicly

export N8N_BASIC_AUTH_ACTIVE=true
export N8N_BASIC_AUTH_USER=demo
export N8N_BASIC_AUTH_PASSWORD=strongpassword
n8n
$env:N8N_BASIC_AUTH_ACTIVE="true"
$env:N8N_BASIC_AUTH_USER="demo"
$env:N8N_BASIC_AUTH_PASSWORD="strongpassword"
n8n
export N8N_BASIC_AUTH_ACTIVE=true
export N8N_BASIC_AUTH_USER=demo
export N8N_BASIC_AUTH_PASSWORD=strongpassword
n8n

Running n8n locally is a great start, but making it accessible online opens the door to live testing, client feedback, and faster automation development.

Ngrok & Cloudflare Tunnel give you instant public links for quick sharing. Both can make your automation projects easier to share and test without traditional deployment.

Now, it’s your turn:
✅ Install n8n locally
✅ Pick Ngrok or Cloudflare Tunnel
✅ Share your work instantly

💬 Have you ever shared an automation project before it was deployed? Which method worked best for you? Comment below and let’s discuss!


Discover more from Abdelrahman Algazzar

Subscribe to get the latest posts sent to your email.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top