Environment variables in n8n Desktop version

Hi,

I have installed n8n on a Microsoft Windows 10 with NPM (-g) for testing.

I’m trying to setup HTTPS in the Environment config file C:\Users\xxxxxx.n8n\n8n-desktop.env but no matter what I change in the config file (with a restart of n8n) doesn’t affect n8n.

I have tried to change the N8N_PORT in the config file to something else, but when i restart n8n it’s still using port 5678.

Is this the wrong place to set the Environment variables in a Windows installation?

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

I also have it installed on Windows (Server) with NPM.

There are a few reasons why using a config file can be a bit of a pain, not least of all because the variable names to use inside a config file are not all the same as how they are listed in the official N8N documentation.

I found it much easier to switch to Environment Variables set within Windows itself (e.g. System Properties > Advanced System Settings > Environment Variables) and create entries in the User Variables section for whatever user account you’re running N8N under.

I have values set for:
GENERIC_TIMEZONE
N8N_EDITOR_BASE_URL
N8N_HOST
N8N_PORT
N8N_PROTOCOL
N8N_SSL_CERT
N8N_SSL_KEY
VUE_APP_URL_BASE_API

From memory, the first time I created these, I had to log out of the account and then back in again and restart N8N, before it picked them up.

1 Like

n8n desktop doesn’t exist anymore but as you are running from npm you would need to set the environment variables using whatever option works best for windows.

Even for testing though I would strongly recommend using a docker image as it makes life a lot easier.