ERROR: Your n8n server is configured to use a secure cookie, however you are visiting this via an insecure URL

I have a local n8n installed on a server with Windows Server 2012 R2, and when I try to access it from a machine within my network using ip:port

is showing the following error:

"Your n8n server is configured to use a secure cookie,
however, you are visiting this via an insecure URL

To fix this, consider the following options:
Configure TLS/HTTPS (recommended) or
If you are running this locally, try using localhost
If you prefer to disable this security feature (not recommended), set the N8N_SECURE_COOKIE environment variable to false"

So I wanted to know if I really need to put TLS/HTTPS inside a local server (a server that I will only use within my network)

and about the second option of disabling N8N_SECURE_COOKIE I don’t know how to do it

if anyone can help me?

thank you very much

1 Like

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:

n8n version: Version 1.42.1

Database (default: SQLite):

n8n EXECUTIONS_PROCESS setting (default: own, main): Default

Running n8n via (Docker, npm, n8n cloud, desktop app): NPM

Operating system: Windows Server 2012 R2

Hey @TI_Formula_Ativa ,

Welcome to the community :raised_hands:

It looks like you have found the option, So you would need to set the environment variable to false, This can be set however you would normally set them. For me on Mac / Linux it would be export N8N_SECURE_COOKIE=false but For Windows it could be the set command for a dos terminal or whever the powershell version of that is. You could also add it as an option in the system properties, It may be worth looking at using Docker instead of npm as this is generally easier to use and configure.

1 Like

Open PowerShell as an administrator.

Run the following command:
Powershell
Copy code
[System.Environment]::SetEnvironmentVariable(‘N8N_SECURE_COOKIE’, ‘false’, ‘Machine’)

Restart the n8n service or server for the changes to take effect.

1 Like

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