# Debugging Fides in IntelliJ IDEA Ultimate

This guide will show how to use the IntelliJ debugger with Fides running in Docker. The setup for PyCharm Professional should be very similar.

## Prerequisites

- [Intellij IDEA Ultimate (opens in a new tab)](https://www.jetbrains.com/idea/buy/#commercial) or [PyCharm Professional (opens in a new tab)](https://www.jetbrains.com/pycharm/buy/#commercial)
- [Docker plugin (opens in a new tab)](https://plugins.jetbrains.com/plugin/7724-docker)
- [Python plugin (opens in a new tab)](https://plugins.jetbrains.com/plugin/631-python) _(this is needed for Intellij)_
- [Docker Desktop (opens in a new tab)](https://www.docker.com/products/docker-desktop/)

## Setup

### Connect to Docker daemon

This step will allow the IDE to connect to Docker Desktop.

Go to: **Settings/Preferences** -> **Docker** -> **+**

- Select **Docker for "your operating system"**

See the screenshot below:

### Configure Python Remote Interpreter

Define a Docker-based remote interpreter.

Go to: **File** -> **Project Structure...** -> **Platform Settings** -> **SDKs** -> **+**

- Set **Server** to `Docker`
- Set **Configuration files** to `.docker-compose.yml`
- Set **Python interpreter path** to `python`

After clicking **OK** the Remote Python Docker Compose should be listed as an SDK.

See screenshots below:

### Run/Debug Configuration

Set up a Run/Debug Configuration so that breakpoints can be hit in the f source code.

Go to: **Run/Debug Configurations** -> **+** -> **Python**

- To debug Fides, debug the `<path on your machine>/src/fides/main.py` script
- Make sure to select **Use specified interpreter** set the Remote Python Docker Compose _(created in the previous section)_
- Add `FIDES__CONFIG_PATH=/fides` to **Environment variables**

See screenshot below:

## Hit a Breakpoint

Now the IDE is ready to debug the source code. Click the debug button for **main** _(setup in the previous section)_.

Try firing a http request to Fides from Postman or Curl and hit a breakpoint.

There is a postman collection in this repo: `docs/fides/docs/development/postman/Fides.postman_collection.json`

Screenshot of hit breakpoint below:

## Links

The information in this guide is largely based on the [pycharm (opens in a new tab)](https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html) and [interpreters (opens in a new tab)](https://www.jetbrains.com/help/idea/configuring-local-python-interpreters.html).

[Release Checklist](/content/docs/community/development/release_checklist "Release Checklist"/index.html) [Updating the Database Diagram](/content/docs/community/development/update_erd_diagram "Updating the Database Diagram"/index.html)
