# How to create the .env file?

**URL:** <https://forum.dfinity.org/t/how-to-create-the-env-file/23186>\
**Category:** Command Line Tools\
**Created:** [September 20, 2023, 12:12pm UTC](https://forum.dfinity.org/t/how-to-create-the-env-file/23186 "2023-09-20T12:12:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [September 20, 2023, 12:12pm UTC](https://forum.dfinity.org/t/how-to-create-the-env-file/23186/1 "2023-09-20T12:12:44Z")

</div>

I noticed that in my project there was created an `.env` file.

I removed it. Now I am trying to automatically create the `.env` file again, but can’t find how.

Please, explain how to make `DFX` create the `.env` file with canister principals.

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [September 20, 2023, 12:25pm UTC](https://forum.dfinity.org/t/how-to-create-the-env-file/23186/2 "2023-09-20T12:25:19Z")

</div>

Add this to your dfx.json: `"output_env_file": ".env"`

---

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [September 20, 2023, 12:25pm UTC](https://forum.dfinity.org/t/how-to-create-the-env-file/23186/3 "2023-09-20T12:25:36Z")

</div>

I’ve found: `dfx deploy frontend` creates `.env` file.
