Setting up SSL certificates for local n8n installation

I’m trying to configure my local n8n setup to use SSL instead of the default HTTP connection. I’ve been working on this for a while but can’t seem to get it working properly.

I tried setting these environment variables in my shell configuration:

export N8N_PROTOCOL="https"
export N8N_SSL_KEY=/home/user/ssl/private.key
export N8N_SSL_CERT=/home/user/ssl/certificate.crt

After restarting n8n, the console still shows:

Workflow editor available at:
http://localhost:5678/

The application continues to run on HTTP rather than HTTPS. I’ve double-checked that my certificate files exist and have the correct permissions. Has anyone successfully configured SSL for a local n8n instance? What am I missing in my configuration?

make sure ur setting those env vars b4 starting n8n. half the time it’s just a timing issue - you export them then start n8n from a different terminal. i’d throw them in a .env file in your n8n directory instead, way more reliable. also check the n8n logs for SSL errors - they’ll tell u what’s actually breaking.

Had the same issue recently. Turned out my SSL certificate format was wrong. N8N is picky about SSL certs, especially self-signed ones. Make sure yours is in PEM format, and if you got it from a CA, include the full chain. Double-check your private key matches the certificate by running openssl x509 -noout -modulus -in certificate.crt | openssl md5 and openssl rsa -noout -modulus -in private.key | openssl md5 - the hash values should match. If you’re using Docker, don’t forget to mount the cert files properly so the container can see them. One more thing - even if the console shows HTTP, try going straight to https://localhost:5678 in your browser. SSL might be working fine despite what the console says.

Check your N8N_HOST environment variable too. When I switched to SSL, I had to set N8N_HOST=0.0.0.0 or whatever hostname you’re binding to. n8n will sometimes fall back to HTTP even with SSL variables set properly if this isn’t configured. Also make sure port 5678 isn’t already taken by another HTTP service - spent hours debugging this once. Try a different port like 8443 with N8N_PORT=8443 to rule out conflicts. Your cert paths look right if they’re absolute, but try moving the certs to n8n’s working directory temporarily in case there are permission issues.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.