Setting N8N_SECURE_COOKIE=false doesn't work

I’ve tired to run n8n via npx n8n on Fedora 41
I’ve setup latest nodejs v22.12.0
modified .n8n/.env to include posgresql settings
N8N_SECURE_COOKIE=false
N8N_HOST=0.0.0.0
N8N_PORT=5678
WEBHOOK_URL=http://SrvName:5678/
N8N_PROTOCOL=http
DB_TYPE=postgresdb

and it starts, but in browser I get

I’ve tried starting with inserting before npx
N8N_SECURE_COOKIE=false && npx n8n
but no change, but it obviously reads .env, as it starts on the on other interfaces.
What else I should do to get it working.
Or maybe how to make it work on https if that is obligatory for non local installs

output when starting

ollama@s5:~$ nvm version
v22.12.0
ollama@s5:~$ npx n8n 
User settings loaded from: /ai/ollama/.n8n/config
(node:184432) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Initializing n8n process
n8n ready on 0.0.0.0, port 5678
Version: 1.70.2

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

Press "o" to open in Browser.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @w3fans

in linux the env should be exported via command
export N8N_SECURE_COOKIE=false

without the export command you have only defined a local variable which npm doesn’t know

1 Like

n8n doesn’t know of a file named .n8n/.env, and will not pick up these env variables from there.

Please let us know if you found these instructions in the docs somewhere, so that we can get the docs fixed.

Actually I just removed && and then it started to work.

TBH I don’t even know anymore, was using ChatGPT a lot looking documentation, search, forums. It’s very little written about modifying parameters when started as npx n8n. I didn’t realize it doesn’t pickup .env, it makes sense, as I was doing all possible changes and no luck.
BTW at the same time it was but inside to prevent adding new elements if not started by https…
But regardless I gave up and was able to install it via docker, and setup reverse proxy so I can connect directly from outside.
Thanks for your help

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