l have a server environment which (at least for now) only allows me to install n8n via npm. But when doing so, a lot of things are not working. I use a custom domain to access n8n which is installed on a Digitalocean Droplet.
My main problems are the following two:
I can not get basic auth to work. I followed the instructions from the docs (set the N8N_BASIC_AUTH... variables & start n8n) but there’s no auth window appearing. I restarted the server, I restarted n8n, nothing appears. I tested multiple browsers
The redirect URL for API credentials is ...localhost:5678... even after I set the WEBHOOK_URL. echoing it, confirms, it is set. But it just isn’t reflected in the UI.
My question would be: Is the npm installation just limited and I cannot do this stuff? I found a few topics on here that suggest following docs that lead to 404 pages and then redirect to other docs that only show instructions for docker installation. If this is not the case, is there any part of the documentation that I just didn’t find, that could help me with my problems?
I am sorry to hear you’re having trouble. The npm variant of n8n is able to read environment variables. My first thought after reading your post would be that your environment variables don’t make it through to n8n. Can you confirm how exactly you are setting them and how you launch n8n? And which operating system are you running?
If I understand your second problem right, the WEBHOOK_URL environment variable wasn’t taken into account by n8n? You should be able to set in the same way as the other ones (e.g. N8N_BASIC_AUTH_ACTIVE=true N8N_BASIC_AUTH_USER=<USERNAME> N8N_BASIC_AUTH_PASSWORD=<PASSWORD> WEBHOOK_URL=https://n8n.example.com/ pm2 restart n8n --update-env).
If you haven’t set up a reverse proxy yet, the approach in this blog post would result in a decent setup indeed!