How to expose a local n8n instance running in Docker to the internet using a Cloudflare tunnel. External services like Gmail and Telegram can't reach your container because of firewall restrictions, but a tunnel routes their traffic through Cloudflare to localhost:5678.
Chapters
Here's how to set up a Cloudflare tunnel so that your local N8N is publicly accessible. So right now we have our Docker container where we did the self-hosted AI starter kit with N8N, Postgres, Qdrant, and Ollama. And all of these apps and services are able to talk to each other because they're all in the same containerized environment right here. And so what happens is if we try to access something like Gmail from this container, we're going to get blocked right here by this firewall. And vice versa, if Gmail tries to talk to us, our N8N instance, it's not going to be able to go through Same thing with something like Telegram. So what we have to do is we have to drag in Cloudflare here to basically create a tunnel. And this is going to be some sort of, you know, actual public address. So right now we access our N8N instance through localhost:5678, which means only our local device right here where we installed everything can use it. But through Cloudflare, what we do is we set up some sort of public domain, which is going to be HTTPS. And then what happens is something like Telegram can send data to Cloudflare, and then our tunnel from Cloudflare is basically just going to be able to eat right through this wall and go talk to our N8N instance. If you wanna watch the full video, click on that link right here, and I'll see you guys over there.