Http://localhost:5678/rest/oauth2-credential/callback

I just got a VPS that came with n8n installed from fasthosts. I am not trying to connect my Google sheet but having this error. I tried change the .env file and updating the webhook url and base url to n8n.mydomain.com but not lock.

I have also restarted the server too.

is there anything I can do to change the Oauth redirect URL?

Hey! So the OAuth redirect URL comes from yoru env variables, you need to set N8NEDITORBASEURL=https://n8n.mydomain.com and WEBHOOKURL=https://n8n.mydomain.com/ plus N8NPROTOCOL=https and N8NHOST=n8n.mydomain.com, then fully restart n8n. If you already did that and it still shows localhost, the most common gotcha is n8n is loading config from somewhere else like a docker-compose file or systemd service override instead of the .env you edited. Check which config your instance is actually reading from.

Thanks so much, how do i check th econfig my instance is reading from? The n8n insall came with the vps purchase, I didnt install it myself, so I have been struggling to get the env variables updated.

Since it came preinstalled check if its running in docker with docker ps and if so look at the docker-compose file usually in /opt/n8n or /root/n8n-docker for the env vars, thats probably where the actual config lives instead of whatever .env you edited.

Hi @Olatubosun please consider following this:

Also make sure you know how to actually SSH into the machine and connect it to a suitable wifi or lan cable, so that it has access to the internet.

Thanks for your feedback. Here is the output from docker ps

My opt directory does not have an n8n folder in it.

These are the items in my root directory.

And this is the content of the docker-compose.yaml in the root directory.

I cant find where to update the n8nhost and webhookurl still

You can do this

welcome to the n8n community @Olatubosun
since the VPS provider preinstalled n8n, I would first ask them where the deployment files or environment variables are managed (Docker Compose, .env, Portainer, Plesk, etc.), because until you edit the actual runtime config and restart the service, n8n will keep using the old public URL settings such as localhost

I was quite suprised the technical team told me they dont know where the environment files are managed. If I am not able to set it up, I’ll wipe the server completely and start from scratch by installing it myself.