Self Hosted Instance with no public URL - Auth Google

Hi, we’re assisting a client who is self-hosting n8n Community Edition and needs to integrate Google Drive using OAuth2. Their n8n instance is secured using ZeroTier and is currently only accessible over that private network. The default OAuth2 callback URL is set to http://localhost:xxxx/rest/oauth2-credential/callback.

Since Google requires a publicly accessible HTTPS URL for OAuth2 callbacks, what is the best practice in this case?

Or is there something else we’re missing here?

We’d appreciate any guidance on securely configuring this setup for our client. Thanks!

Hello @bigmovesio,

Indeed google requires a publicly https Url.
I would suggest creating a cloudflare tunnel if you can, linked to a domain.
Easiest and safest solution

Let me know if that helps

You’ll need to start your n8n instance up in tunnel mode. This will essentally expose your localhost to the internet using something like ngrok

Depending how youre running it

Via Docker:

Via NPM:

This will give you a public url to use instead of localhost

Just a note, I think everytime you stop and start n8n, it will generate a new url, so keep the instance running for as long as possible. Your other option is to host a docker instance of n8n in the cloud somewhere, something like digital ocean etc

1 Like