Unable to connect google tools on n8n localhost, is there any work around

Hey everyone,
I’ve been running n8n on localhost, but I’m facing a big issue — I can’t connect any Google tools (like Google Sheets, Gmail, Drive, etc.). It seems the OAuth flow isn’t working locally, and without these integrations, n8n becomes pretty useless for my needs.
Is there any way to fix this on localhost, maybe through some custom configuration or reverse proxy, or do I basically have no option other than buying the n8n Cloud plan?
Any advice or solutions would be greatly appreciated!
Thanks.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
2 Likes

When using docker, you can set an external Url as your host Url. So you also need a cloudflare tunnel or something. Than you have a correct url to enter at the google redirect urls. Unfortunately I’m super sick and cannot go to my PC to show you what to enter, but it’s 100% possible to connect.

2 Likes

Hi,
I struggled too, but it it possible.
for OAuth2, you need to set up Google Cloud,
[Comment connecter toutes les google apps a n8n en 5mn]
and there is also an alternative with Google Service Accounts described below:
FInd YouTube for Tech Tim and video ’Self-Host Your Own Automation Platform with n8n + Docker’
at timetamp 18:40

All the best!

1 Like

Hi @Zelite ,
You can connect Google tools to n8n on localhost, but you’ll need to adjust the OAuth setup because Google doesn’t allow localhost URLs for this process. The easiest way is to use a tool like ngrok, localtunnel, or Cloudflare Tunnel to give your local n8n a public HTTPS link. For example, running ngrok http 5678 will give you something like https://randomname.ngrok.io. Add this link (plus /rest/oauth2-credential/callback at the end) to your Google Cloud Console under Authorized redirect URIs. Then, in n8n, update your Google credentials to use the same link and restart n8n if needed. Since your local setup will now be online, make sure to protect it with a password or environment variables so no one else can access it.

2 Likes

I’m already getting it using the ENV variable with my domain using proxmox, however I cannot figure out for the life of me as to why n8n is adding a space between my domain and the rest of the callback url. theres no space in the ENV url and I have tried my domain with a forward slash at the end and without to no avail… still have the malformed entry error from Google. going nuts!

I’m doing it with localhost without any issues, I think you haven’t configured it properly, it’s very simple to do it, please check this video (it’s done in localhost):

Thanks!

mine has to be some sort of bug…cant get it to stop putting a space in my webhooks and cant use domains…can only use localhost

also i have two more blank spots to fill in beyond whats in the n8n form in the video