# Run with Docker

## Prerequisite

Docker must be installed. Refer to the official Docker install instructions [here](https://docs.docker.com/engine/install).

## Running the Agent

Start the Docker container with the following command:

{% tabs %}
{% tab title="Linux" %}

```bash
docker run \
    -p 8080:8080 \
    -p 4200:4200 \
    -v ~/.stoobly:/home/stoobly/.stoobly \
    stoobly/agent
```

{% endtab %}

{% tab title="macOS" %}

```bash
docker run -it \
    -p 8080:8080 \
    -p 4200:4200 \
    -v ~/.stoobly:/home/stoobly/.stoobly \
    stoobly/agent
```

{% endtab %}
{% endtabs %}

The above command will:

1. Download the `stoobly/agent` Docker image from [Docker Hub](https://hub.docker.com/r/stoobly/agent)
2. Start the proxy and UI server
3. Expose the proxy on port 8080 and the UI on port 4200

{% hint style="info" %}

* If the proxy port conflicts, configure it with the `--proxy-port INTEGER` option
* If the UI port conflicts, configure it with `--ui-port INTEGER` option
  {% endhint %}

{% hint style="info" %}
The command will also mount the `~/.stoobly` data directory from your host as a data volume to persist changes. If you don't want to persist changes then remove the `-v ~/.stoobly:/home/stoobly/.stoobly` Docker option
{% endhint %}

After running the command, you should see output similar to this to indicate that the agent started up successfully:

```
UI server listening at http://0.0.0.0:4200

Loading script /usr/local/lib/python3.14/site-packages/stoobly_agent/record.py
Proxy server listening at http://*:8080
```
