If you've been paying for n8n Cloud every month, or you've been avoiding automation because hosting sounded complicated or expensive, this might save you some money.
You can run your own fully functional n8n instance with a real public HTTPS domain for just $1.54 a year.
Yep, a year—not per month. The only thing you need to pay for is the domain. Everything else is completely free. No subscriptions, no hidden costs.
One honest downside though — this isn't a cloud server, it's literally running off my laptop. So if my laptop's off, n8n's off too. If you need 24/7 uptime this probably isn't for you.
Anyway here's how I did it, in three parts:
- Get n8n running locally with Docker (free)
- Grab a cheap domain and hook it up to Cloudflare
- Expose the local n8n instance to the internet with a Cloudflare Tunnel so webhooks (Telegram, WhatsApp, Google, whatever) can actually reach it
Let's go.
Part 1: Running it locally with Docker
Whole point of this step is just to get n8n working on your own machine first, no money involved yet.
Install Docker Desktop
Grab it from docker.com, whatever OS you're on.
Deploy the n8n Self-Hosted AI Starter Kit
Rather than installing n8n on its own, I just used the official n8n-io/self-hosted-ai-starter-kit repo on GitHub.
- Find the command matching your setup (CPU only vs Nvidia GPU etc, it's in the README) and copy the command.
- Open the terminal as Administrator.
- Paste the first 3 command copied from there.
-
Then you would need to edit the .env file before running the last command.
I'm in Windows so i did "code .env" to open the file, for Linux/MacOS maybe try nano or vim.
After opening replace the default values for N8N_ENCRYPTION_KEY and N8N_USER_MANAGEMENT_JWT_SECRET to any random long string. Doesn't matter much.
Then finally paste the last command (i.e, docker compose --profile gpu-nvidia up -> for Nvidia GPU people)
That one command pulls 4 containers:
| Container | What it does |
|---|---|
| n8n | the actual workflow builder / UI |
| Ollama | runs LLMs locally, uses your CPU/GPU |
| Qdrant | vector db, basically memory for AI agents |
| PostgreSQL | the database storing all your workflows/data |
Open it up
Once it's running, open the app docker and turn on the self-hosted-ai-starter-kit and when you see green light go to the URL:
http://localhost:5678
and you should see the n8n editor pop up.
The problem
Ok so here's where it gets annoying. Everything works great as long as you're on your own machine. But try hooking up a webhook trigger — Telegram, WhatsApp, whatever — and it just doesn't work. Because the webhook URL is still localhost:5678, which is a private address only your PC can see. Telegram's servers have literally no way to reach that.
That's what part 2 and 3 are for.
Part 2: Getting a domain + Cloudflare
Buy a cheap domain
You really don't need to spend much here. I used Porkbun — cheapest first-year pricing I could find. Got biswadeep.lol for $1.54.
Quick heads up
Before you fully connect things — in Porkbun and set up your basic DNS records (A record, CNAME etc) if you haven't already, and do it BEFORE switching the nameservers over. Makes the whole transition way less painful.
Add it to Cloudflare
Log into your Cloudflare dashboard.
- Domains overview page
- Add a domain
- Connect your domain, type it in, leave defaults as it is and press Continue
- Pick the Free plan
- Continue to Activation.
Cloudflare scans for any existing DNS records automatically.
Point your nameservers to Cloudflare
Cloudflare gives you two nameservers, unique to your domain.
- Back in Porkbun, go to NS settings
- Delete the default Porkbun nameservers
- Paste in the two from Cloudflare
- Save
Then Return back to Cloudflare and hit "I updated my nameserves".
Propagation takes anywhere from a few mins to a couple hours (mine took like 10 min). Once it's done, check Domains → Overview in Cloudflare, should say "Active."
Don't move on to part 3 until you see that Active status, otherwise you're just gonna confuse yourself.
Part 3: The Cloudflare Tunnel (this is the part that actually makes it work)
This is the bit that lets outside services actually talk to your local n8n, without you having to open sketchy ports on your router.
Create the tunnel
In Cloudflare: Networking → Tunnels → Create a tunnel. Name it whatever.
Install the connector
Cloudflare gives you an installer command based on your OS. Run it, follow whatever it says. Once it connects you'll see the tunnel status go "Healthy."
Set the public hostname
Inside the tunnel settings:
- Routes → Add Route
- Published application
- Set your subdomain, like
n8n.yourdomain.com - Service URL =
http://localhost:5678
And that's basically it — n8n.yourdomain.com now points straight at your localhost:5678 behind the scenes. Same app, just two doors into it.
One thing to remember: your n8n container actually has to be running for the domain to load. Obvious in hindsight but I forgot this like twice.
Fix the webhook URLs (important, don't skip)
Here's the annoying part — even though you can now reach n8n from your phone or wherever, if you open a Webhook Trigger node it STILL shows a broken localhost:5678 url. Google OAuth, Telegram, none of them can do anything with that.
Fix: open the docker-compose.yml in your project folder (self-hosted-ai-starter-kit) and add these two lines to the n8n service:
WEBHOOK_URL=https://n8n.yourdomain.com/
N8N_PROTOCOL=https
Restart everything
cd self-hosted-ai-starter-kit
docker compose down
docker compose up -d
Note: when you run docker compose down you might get a warning that some resource is still in use — don't panic, just run up -d right after and it sorts itself out.
Check it worked
Open the https://n8n.yourdomain.com/, click into any webhook node, and you should now see your actual domain instead of localhost.
Once you're here — Google OAuth redirects, Telegram bots, WhatsApp triggers, all of it just works, because there's finally a real HTTPS address for the outside world to hit.
What it actually cost me
| Thing | Cost |
|---|---|
| Docker Desktop | free |
| n8n / Ollama / Qdrant / Postgres | free, open source |
| Cloudflare (tunnel + proxy) | free tier |
| Domain (porkbun, yr 1) | $1.54 |
| Total | $1.54 |
That's pretty much it
Private, fully self-hosted n8n, local AI models, a vector db, a real database, and an actual public HTTPS domain that webhooks can hit — all for the price of a domain name. Only catch is it's tied to my laptop being on, which I'm fine with for now.
If you run into issues setting this up, drop a comment and I'll try to help sort it out.










Top comments (0)