Config file location?

Newbie here.
I installed n8n via NPM, configured nginx, all good, saves data, reachable from the web, love it.
But I can’t figure ot where the config file is, where I can set up authentication.
The install docs mention a .env file - but is that also for NMP install (no docker) ?
I added the .env in the .n8n folder. No luck.
I added the .env in the n8n folder. No luck.
I added the .env in the root folder. No luck.

How do I refer my n8n instance to a config? I’d like to set the basic auth.

Welcome to the community.

Did you check?

Hello @RicardoE105, thank you for replying.
I did check, and there is no word about a config file.
I did find a config file in .n8n and by adding anything to that file in JSON format didn’t affect my instance.
In fact I can’t see anything in the Config description regarding where the file can be edited.

Probably just me, because there are no conversations about this in github/forum.
It seems, I’m overlooking something super obvious :slight_smile:

Same question here:

But it was never answered. What does environmental variables mean and where to edit them in case of a NPM install :slight_smile: ? I don’t want to use docker at this point.

Just set an env variable to in the process. Depending on your operating system, the way to do it might vary.

For Linux and macOS, you can do:


For example: To set the timezone, you can do export GENERIC_TIMEZONE=Europe/Berlin

The possible env variables that you can set are here.

You can check here what env variables are.

The Nginx part, sadly, I cannot help as I do not have experience with it.

Thank you for pointing me to the right direction! Now I know where to research.
I’ll post my solution here once I find it :slight_smile:

1 Like

Hey @joeyk did you find solution? i’m currently in the same situation :smiling_face_with_tear:
i tried to do some chatgpt 4 solutions, he gave me this:

`Navigate to C:\Users\USERNAME.n8n.
Create a new text file there named env.txt.
Open the env.txt file and add the following environment variables:
Replace YOUR_STATIC_IP with your actual static IP address. If you use HTTPS (SSL), replace http with https.

Save your changes.
Rename the file from env.txt to .env. In PowerShell, run this command in the same folder (C:\Users\USERNAME.n8n):
Rename-Item -Path “.\env.txt” -NewName “.env”
Restart n8n using the following command:
n8n start`

The problem in my .n8n there’s only .config file there’s no .env and i don’t want to run this solution it may effect my current production

Hi, sorry, I don’t use windows. I think yours is a different issue.
Don’t listen to chatgpt :smiley:

1 Like