How can I set up HTTPS for my locally hosted n8n instance?

n8n still launches on HTTP despite configuring HTTPS in my .bashrc. For instance:

export ENABLE_SSL='true'
export SSL_KEY_PATH='/new/path/to/key.pem'
export SSL_CERT_PATH='/new/path/to/cert.pem'

Any guidance?

Based on my experience, the configuration itself appears correctly set up, but the issue could be that the process running n8n isn’t loading your .bashrc file. I encountered a similar problem when using a service manager; the environment variables needed to be set directly within the service file rather than relying on a user-specific script. Running n8n from a terminal where you source your .bashrc manually often confirms whether the issue is with variable propagation or with the configuration itself.

I had a similar experience where HTTPS wasn’t being applied as expected for my n8n instance. I eventually discovered that the environment variables were correctly set up in my .bashrc, but the process manager (which was running n8n) didn’t source it properly. I solved the problem by directly specifying the SSL paths in the systemd unit file, ensuring that n8n picked up the correct settings. This approach saved a lot of time troubleshooting the issue and ensured a secure setup without any hidden misconfigurations.