Google Console integration failing with dockerized n8n - getting access blocked error on localhost setup

Hey folks,

I’m pretty new to automation workflows and I’m having trouble with my setup. I’ve got n8n running in a Docker container on my local machine and I’m trying to link it up with YouTube using Google Console.

The problem is I keep getting an “access blocked” message whenever I attempt the connection. I think this might be related to running everything locally instead of on a proper domain.

I already tried adding my account as a test user in the Google Console but that didn’t solve the issue. Has anyone else run into this problem with local n8n deployments? What’s the best way to get Google services to work with a localhost setup?

Google OAuth blocks localhost URLs - that’s why you’re getting the access error. The ngrok and 127.0.0.1 suggestions work, but here’s what fixed it for me: create a custom hosts file entry. Map a fake domain like local-n8n.dev to 127.0.0.1 in your hosts file, then set up both your Docker container and Google Console to use this domain instead of localhost. Google’s OAuth thinks it’s a real domain this way. Don’t forget to restart your Docker container after changing the hosts file and update the redirect URI in Google Console. This beats using external tunneling services and keeps your local dev environment stable.

had this exact headache last month! use ngrok to expose your local n8n instance with a public URL - google oauth hates localhost but works fine with ngrok tunnels. just run ngrok http 5678 then use that https url in your google console redirect settings instead of localhost.

I encountered a similar issue while configuring n8n locally. The ‘access blocked’ error often arises with Google’s OAuth system due to how it handles localhost connections. To resolve this, ensure that your redirect URI in the Google Console points to http://127.0.0.1:5678/rest/oauth2-credential/callback instead of using ‘localhost’. Alternatively, deploying n8n on a cloud platform like Railway or DigitalOcean could be a more efficient solution, as it avoids the complexities tied to local setups.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.