Just set up self-hosted n8n - OAuth problem

I have looked at similar previous questions and followed the solutions but still not working. I did everything in the Nate Herk video and it has always worked before on the cloud hosted n8n but I just set up self-hosted on Render and the only difference I can see is that the Authorised redirect URI is at localhost:5678 instead of oauth.n8n.cloud. If this is the problem, how do I fix it? Screenshot shows error messages. All APIs enabled. Test user account set up with same gmail account. I’ve run out of things to try.

Yes have got the same issue with my self hosted as well - the solution i used and it worked for me was

I installed using docker compose from the n8n github repo

made following changes in my compose yaml & .env file

Add this to your .env file:

N8N_HOST=yourdomain.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://yourdomain.com/

Then in your Docker Compose service for n8n, make sure you don’t hardcode those variables but reference them instead:

environment:
  - N8N_HOST=${N8N_HOST}
  - N8N_PROTOCOL=${N8N_PROTOCOL}
  - WEBHOOK_URL=${WEBHOOK_URL}

Thanks for the quick response. Where you have referenced yourdomain.com does this need to be a top level domain or can it be a subdomain? This is my first attempt at self-hosted and I’m starting to appreciate how simple the cloud solution has been.

Also, if there is anyone who has set up the self-hosted solution using Hostinger (or similar), did you also have setup problems or was it straightforward and worth the small investment? I’m thinking ahead to client implementations and want all their workflows to be on their own self-hosted n8n where they pay the monthly costs to avoid billing headaches but also I don’t want setup problems, that’s why I’m moving from cloud to self-hosted in preparation for my first client implementation. Any recommendations for the smoothest (not necessarily cheapest) route would be appreciated. Thanks in advance.

You will have to use your subdomain if you have self hosted on a sud domain route of your hosting.

Try and understand this the Base URL + n8n path where the n8n router will listen for the request to be received from any outside system of yours.

I hope I am clear :+1:

Sorry, it’s not clear, maybe because I’m on Render, so I’ll scrap my Render n8n and set it up again using the same method as you (using docker compose from the n8n github repo) then I’ll come back and it should make more sense. Thanks for your help.

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