Updated: 11 October 2026 · Applies to: n8n 2.40 (self-hosted)

You start n8n, open http://SERVER-IP:5678 and cannot log in, or n8n shows a message that it is configured to use a secure cookie but you are visiting an insecure address. The reason is the setting N8N_SECURE_COOKIE, which is on by default: n8n only sends its login cookie over HTTPS. Over plain HTTP the browser refuses it.

Best fix: open n8n over HTTPS

Give n8n a domain name and a certificate. The simplest ways:

n8n's documentation recommends a reverse proxy for HTTPS. After that open https://n8n.example.com and the message disappears.

For local testing only: turn the secure cookie off

If you only test n8n on a private network or through an SSH tunnel and accept the risk, you can turn the setting off:

  1. Add this to the environment: section of the n8n service (or to your docker run command with -e):
    - N8N_SECURE_COOKIE=false
  2. Recreate the container:
    cd ~/n8n-compose
    sudo docker compose up -d
  3. Open n8n again and log in.

Do not leave this on a server that is reachable from the internet. Without HTTPS, your password and the workflow data travel unencrypted, and anyone on the way can read them.

A safer way to test without HTTPS: an SSH tunnel

Keep n8n on 127.0.0.1:5678 (as in How to install n8n with Docker Compose and HTTPS on an Ubuntu VPS?) and forward the port from your computer:

ssh -L 5678:127.0.0.1:5678 user@YOUR-SERVER-IP

Then open http://localhost:5678. Most browsers treat localhost as a secure context, so the login normally works without changing the cookie setting. Safari is an exception. If your browser still complains, set N8N_SECURE_COOKIE=false for the test only and remove it afterwards.

Frequently asked questions

I use HTTPS but still get the message.
Check that the proxy passes X-Forwarded-Proto, and that you set N8N_PROXY_HOPS=1 and N8N_PROTOCOL=https as in How to fix n8n webhooks that do not work (test URL, production URL, wrong address)?.

Is the message a security risk?
It protects you: it stops n8n from sending login cookies in clear text. Fix the cause (HTTPS) instead of switching it off.

Official documentation: n8n documentation: security environment variables.

Need a server for n8n, or a hand with the setup?

Prefer a hand with the setup? Our engineers can do it for you: Hire an Expert, or use our on-demand server management.

Was this answer helpful?

Still stuck? Open a ticket