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

# On Local Machine

The custom application can be run on various platforms, including your local machine (laptop or desktop), external devices
such as a Raspberry Pi, or a virtual machine. It can also be executed directly on the PPL controller. This guide provides
instructions on running the application on your local machine.

<Note>
  It is recommended to run your custom application on a local machine first. This approach allows you to test and
  troubleshoot the newly developed application. Once testing is complete, the application can then be transferred to the
  Power Platform controller for execution.
</Note>

Follow the steps below to run the custom application on your local machine. The instructions assume that a code editor
is open and the `dep-ppl-app` repository is loaded.

<Steps>
  <Step title="Write Your Application">
    Open the `app/main.py` file in the repository and implement your custom application logic. This is the main entry
    point for your application. See the [Main Script](/custom-applications/application/write/boilerplate) section
    for more details on how to structure your code.
  </Step>

  <Step title="Update the .env File">
    Open the `.env` file in the root of the repository and update the following values:

    * **IP\_ADDRESS** — the IP address of the controller.
    * **NATS\_USERNAME** — the username for the NATS client connection.
    * **NATS\_PASSWORD** — the password for the NATS client connection.

    <Note>
      The username and password for the NATS connection should match the credentials specified in the `config.json`
      file on the controller under the **nats local** section.
    </Note>
  </Step>

  <Step title="Install Dependencies">
    Make sure all required Python dependencies are installed. Open a terminal in the repository folder and run:

    ```bash theme={null}
    pip install -r requirements.txt
    ```
  </Step>

  <Step title="Run the Application">
    Open a terminal in the repository folder and run the application with:

    ```bash theme={null}
    python -m app
    ```

    This will start the main Python application defined in the `app` folder.
  </Step>
</Steps>
