I’m testing n8n on my machine and want to switch from HTTP to HTTPS. I’ve tried adding some config stuff to my bashrc file:
N8N_PROTOCOL="https"
N8N_SSL_KEY=/my/key/location
N8N_SSL_CER=/my/cert/location
But when I fire up n8n, it still shows:
You can now use the editor at:
http://localhost:5678/
It’s not working like I hoped. Any ideas on how to get HTTPS running? I’m kinda stuck here. Thanks for any help!
hey alex, i’ve had similar issues. make sure ur certificates are valid and in the right place. also, try adding N8N_PORT=443 to ur config. sometimes n8n needs a lil nudge to use https. if that doesn’t work, maybe check ur firewall settings? good luck mate!
I’ve been through this HTTPS setup dance with n8n before, and it can be a bit tricky. One thing that worked for me was setting the environment variables directly when starting n8n, rather than relying on .bashrc. Try running it like this:
N8N_PROTOCOL=https N8N_SSL_KEY=/path/to/key N8N_SSL_CERT=/path/to/cert n8n start
Make sure you’re using the correct paths to your key and cert files. Also, double-check that your cert isn’t expired - that caught me out once.
If you’re still hitting issues, you might want to look into the n8n config file. Sometimes environment variables don’t play nice, but explicitly setting these in the config file can do the trick. Worth a shot if nothing else works!
I encountered a similar situation when setting up HTTPS for n8n locally. Have you considered using a reverse proxy like Nginx? It’s a robust solution that worked well for me. You can configure Nginx to handle the SSL/TLS termination and forward requests to your n8n instance. This approach allows you to keep n8n running on HTTP internally while presenting HTTPS to the outside world. It also provides additional benefits like load balancing and caching if needed in the future. Just ensure your SSL certificates are properly configured in Nginx. Remember to adjust your firewall settings to allow traffic on port 443 if you haven’t already.