Setting up secure HTTPS for local n8n instance

I’ve been testing n8n on my computer and want to switch from HTTP to HTTPS. I tried adding some stuff to my bashrc file:

export N8N_PROTOCOL="https"
export N8N_SSL_KEY=/my/key/file/location
export N8N_SSL_CERT=/my/cert/file/location

But when I start n8n, it still shows:

Editor is now accessible via:
http://localhost:5678/

It’s not working like I hoped. How can I get HTTPS running for my local n8n setup? Any tips or tricks would be really helpful. I’m not sure if I’m missing a step or doing something wrong. Thanks!

I’ve gone through a similar process setting up HTTPS for my local n8n instance. In my experience, simply modifying your bashrc file isn’t enough; you need to generate SSL certificates first. I created a self-signed certificate and key using OpenSSL, then updated my n8n configuration to reference these new files and restarted the service completely.

Make sure you are running the latest version of n8n as older versions have issues with HTTPS setups. If the problem persists, checking the n8n logs for SSL-related errors can help pinpoint the issue. Remember, browser warnings for self-signed certificates are typical for local development.

hey there, i’ve dealt with this before. make sure u actually generated the SSL cert and key files first. then double-check the file paths in ur env vars are correct. also, try setting these directly in n8n config file instead of bashrc. sometimes that works better for local setups. good luck!

I encountered a similar challenge when setting up HTTPS for my local n8n instance. One crucial step you might be missing is generating the SSL certificate and key files. Have you created these files yet? If not, you can use OpenSSL to generate self-signed certificates for testing purposes.

After generating the certificates, ensure the file paths in your environment variables are correct and absolute. Also, double-check that n8n has read permissions for these files. Sometimes, restarting your terminal or even rebooting your system is necessary for environment changes to take effect.

If you’re still facing issues, consider setting these variables directly in your n8n configuration file instead of using environment variables. This approach can sometimes be more reliable for local setups.