# Config file location?

**URL:** <https://community.n8n.io/t/config-file-location/5232>\
**Category:** Questions\
**Tags:** deployment\
**Created:** [April 13, 2021, 1:49pm UTC](https://community.n8n.io/t/config-file-location/5232 "2021-04-13T13:49:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeyk](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/joeyk/32/4249_2.png) [@joeyk](https://community.n8n.io/u/joeyk)\
**Post date:** [April 13, 2021, 1:49pm UTC](https://community.n8n.io/t/config-file-location/5232/1 "2021-04-13T13:49:38Z")

</div>

Hey,  
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.  
Thx.

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [April 13, 2021, 2:35pm UTC](https://community.n8n.io/t/config-file-location/5232/2 "2021-04-13T14:35:28Z")

</div>

Welcome to the community.

Did you check?

> **[Configuration methods | n8n Docs](https://docs.n8n.io/hosting/configuration/configuration-methods/)**
>
> How to set environment variables for n8n.

---

<div class="post-metadata">

**Author:** ![joeyk](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/joeyk/32/4249_2.png) [@joeyk](https://community.n8n.io/u/joeyk)\
**Post date:** [April 13, 2021, 3:19pm UTC](https://community.n8n.io/t/config-file-location/5232/3 "2021-04-13T15:19:43Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![joeyk](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/joeyk/32/4249_2.png) [@joeyk](https://community.n8n.io/u/joeyk)\
**Post date:** [April 13, 2021, 3:29pm UTC](https://community.n8n.io/t/config-file-location/5232/4 "2021-04-13T15:29:18Z")

</div>

Same question here:

> [@Nginx and n8n](http://community.n8n.io/t/nginx-and-n8n/4208):
>
> Hello everyone, I have n8n running in docker with an open port 5678. How can I use nginx to set authorization on it by login and password?

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

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [April 13, 2021, 3:50pm UTC](https://community.n8n.io/t/config-file-location/5232/5 "2021-04-13T15:50:10Z")

</div>

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:

export THE\_NAME=THE\_VALUE

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

The possible env variables that you can set are [here](https://docs.n8n.io/reference/configuration.html#base-url).

You can check [here](https://en.wikipedia.org/wiki/Environment_variable) what env variables are.

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

---

<div class="post-metadata">

**Author:** ![joeyk](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/joeyk/32/4249_2.png) [@joeyk](https://community.n8n.io/u/joeyk)\
**Post date:** [April 13, 2021, 3:51pm UTC](https://community.n8n.io/t/config-file-location/5232/6 "2021-04-13T15:51:57Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![kravzz1](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/kravzz1/32/12363_2.png) [@kravzz1](https://community.n8n.io/u/kravzz1)\
**Post date:** [June 3, 2023, 4:31pm UTC](https://community.n8n.io/t/config-file-location/5232/7 "2023-06-03T16:31:56Z")

</div>

Hey @joeyk did you find solution? i’m currently in the same situation 🥲  
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:  
N8N\_HOST=YOUR\_STATIC\_IP  
N8N\_PORT=5678  
N8N\_PROTOCOL=http  
VUE\_APP\_URL\_BASE\_API=http://YOUR\_STATIC\_IP:5678/  
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

---

<div class="post-metadata">

**Author:** ![joeyk](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/joeyk/32/4249_2.png) [@joeyk](https://community.n8n.io/u/joeyk)\
**Post date:** [June 4, 2023, 8:06am UTC](https://community.n8n.io/t/config-file-location/5232/8 "2023-06-04T08:06:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![protechtedd](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/protechtedd/32/30787_2.png) [@protechtedd](https://community.n8n.io/u/protechtedd)\
**Post date:** [October 5, 2023, 5:27pm UTC](https://community.n8n.io/t/config-file-location/5232/9 "2023-10-05T17:27:52Z")

</div>

@kravzz1 What you posted actually worked for me. I was struggling to get my n8n install on windows via npm to take the N8N\_HOST variable using a JSON config file. I followed the chatgpt instructions in your post, created a file simply named `.env` and then opened it with a text editor, put the lines in it, saved, ran n8n via command line, and it worked like a charm.

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [October 12, 2023, 5:28pm UTC](https://community.n8n.io/t/config-file-location/5232/10 "2023-10-12T17:28:26Z")

</div>

Closed on October 12, 2023, 5:28pm UTC

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