# Is the .env file used in the Swiftype Rails example application necessary?

**URL:** <https://community.swiftype.com/t/is-the-env-file-used-in-the-swiftype-rails-example-application-necessary/157>\
**Category:** Setup & Indexing\
**Tags:** rails\
**Created:** [April 8, 2016, 10:29pm UTC](https://community.swiftype.com/t/is-the-env-file-used-in-the-swiftype-rails-example-application-necessary/157 "2016-04-08T22:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/swiftype/original/1X/fd652d1735c60057fa71c371375511028f9a1832.png) [@system](https://community.swiftype.com/u/system)\
**Post date:** [April 8, 2016, 10:29pm UTC](https://community.swiftype.com/t/is-the-env-file-used-in-the-swiftype-rails-example-application-necessary/157/1 "2016-04-08T22:29:51Z")

</div>

> **A little more detail for this portion of the [Rails tutorial](https://swiftype.com/documentation/tutorials/rails) would be helpful:**

> > ```
> > Create a `.env` file with the Swiftype API Key and your engine slug:
> > 
> > SWIFTYPE_API_KEY=your_api_key
> > SWIFTYPE_ENGINE_SLUG=your_engine_slug
> > 
> > ```

> **Where does this `.env` file go within the Rails app?**

> **Also, instead of creating this `.env` file, can these two lines of code go in with the rest of my ENV keys in my `application.yml` file?**

The `.env` file is a file defined by the [Foreman gem](http://ddollar.github.io/foreman/), which lets you run Procfile applications locally as you would on Heroku. Also, the `.env` file sets environment variables as you would with the [heroku config](https://devcenter.heroku.com/articles/config-vars) command. You’ll want to make sure it’s placed in the root of your Rails application.

The important thing to note is that you are able to configure your application to use your Swiftype API key and engine key. Putting these in environment variables is just one way to do it. As long as it works, use whatever method you like.
