> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turbostack.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup your enviroment

> Configure your `app` subdomain locally

A TurboStack production application is separated in a domain that hosts the landing page for marketing purposes and an `app` subdomain that hosts the application itself.

It's a common practice in the industry to use an `app` subdomain to separate your application from your landing page.
This practice has been adopted for these reasons:

* **Organization**: A subdomain allows for better organization of content. The main domain can focus on marketing and support, while the `app` subdomain is dedicated to the application itself. This separation make the navigation and user experience smoother.
* **Security**: Using an `app` subdomain can help implement specific security measure tailored to the application. For example, common cases do not have to handle any public page different than `/sign-in`.
* **Tracking Segmentation**: An `app` subdomain simplify tracking. You can segment traffic and user behavior more easily between the application and the marketing site, helping you find specific insights.

With all reasons explained, we need to setup our `/etc/hosts` file to point the subdomain `app.localhost` to the address `127.0.0.1`.

<Tabs>
  <Tab title="Mac/Linux">
    1. In your terminal, open the `/etc/hosts` file in your favorite editor

    ```bash theme={null}
    sudo nano /etc/hosts
    ```

    2. Add the following line at the end of the file:

    ```bash theme={null}
    127.0.0.1 app.localhost
    ```
  </Tab>

  <Tab title="Windows">
    1. Open **Notepad as Administrator**:<br />
       Click the Start menu, type Notepad, right-click on it, and select Run as administrator. This step is crucial as the hosts file requires admin privileges to edit.
    2. Open the `/etc/hosts` file:<br />
       In Notepad, click on **File > Open.** Select `hosts` file at the following path:

    ```
    C:\Windows\System32\drivers\etc\hosts
    ```

    3. Add the following line at the end of the file:

    ```bash theme={null}
    127.0.0.1 app.localhost
    ```

    4. Click **File > Save** to save your changes. You can then close Notepad.
    5. (optional) Sometimes, you may need to flush the DNS cache for changes to take effect. To do this, run the following command in your terminal:

    ```bash theme={null}
    ipconfig /flushdns
    ```
  </Tab>
</Tabs>

With all things done, you can open `http://app.localhost:3000` and you will see a page like this:

<img src="https://mintcdn.com/ravitechsolutions/jCk1IPeJr8ul3nyO/images/sign-in-page.png?fit=max&auto=format&n=jCk1IPeJr8ul3nyO&q=85&s=47e828ae20369836a278faf6b0fd2b61" alt="Sign In Page" width="1916" height="962" data-path="images/sign-in-page.png" />
