Hey everyone! I’m testing n8n on my local machine and I’m trying to switch from HTTP to HTTPS. I’ve added some stuff to my bashrc config file:
export N8N_PROTOCOL="https"
export N8N_SSL_KEY=/my/key/location
export N8N_SSL_CER=/my/cert/location
But when I fire up n8n, it still shows:
Editor is now accessible via:
http://localhost:5678/
I’m scratching my head here. Any ideas on how to get HTTPS working? Thanks in advance!
I encountered a similar issue when setting up HTTPS for n8n. Have you tried restarting your terminal after modifying the bashrc file? Sometimes environment variables don’t take effect immediately. Also, double-check that your SSL key and certificate paths are correct and the files exist. Another thing to consider is whether you’re running n8n with the ‘–tunnel’ option, which might override your HTTPS settings. If none of these solve the problem, you could try setting the protocol directly in the n8n config file instead of using environment variables. Hope this helps you troubleshoot!
I’ve been through this HTTPS setup process with n8n before, and it can be a bit tricky. One thing that’s not immediately obvious is that n8n doesn’t always pick up environment variables set in .bashrc.
What worked for me was creating a separate .env file in the n8n root directory and putting the configuration there:
N8N_PROTOCOL=https
N8N_SSL_KEY=/path/to/your/key.pem
N8N_SSL_CERT=/path/to/your/cert.pem
Then, when starting n8n, use the command ‘n8n start --env’. This explicitly tells n8n to look for the .env file.
Also, make sure your SSL certificate is valid and not expired. I once spent hours debugging only to realize my cert had expired! If you’re still having issues, try running n8n with increased logging using ‘n8n start --log-level=debug’. This might give you more insight into what’s going wrong.
hey mate, i had a similar headache. try adding these to ur .env file instead of bashrc:
N8N_PROTOCOL=https
N8N_SSL_KEY=/path/to/key
N8N_SSL_CERT=/path/to/cert
then run ‘n8n start --env’. worked for me! goodluck!