# Installation

### Prerequisites

Before you install, make sure you have the following:

* **Python 3.6 or later** — [python.org/downloads](https://www.python.org/downloads/)
* **pip** — included with Python 3.4+; verify with `pip --version`
* **Administrator or root privileges** — required to send ARP packets and capture network traffic
* **A Roku device** connected to your local network
* **A Pi-hole server** running on your local network

{% hint style="warning" %}
You must run the script with administrator privileges on Windows (`Run as Administrator`) or root/sudo on macOS and Linux. Without elevated permissions, the tool cannot send ARP packets or capture DNS traffic.
{% endhint %}

### Install

{% tabs %}
{% tab title="Windows" %}
{% stepper %}
{% step %}

#### Step 1: Install Npcap

Scapy requires a packet capture driver on Windows. Download and install Npcap from [npcap.com](https://npcap.com/). During installation, enable the option **“Install Npcap in WinPcap API-compatible mode”**.
{% endstep %}

{% step %}

#### Step 2: Clone the repository

Open a Command Prompt or PowerShell window **as Administrator** and run:

```bash
git clone https://github.com/maddog1110/pi-hole-on-roku-without-router-access.git
cd pi-hole-on-roku-without-router-access
```

{% endstep %}

{% step %}

#### Step 3: Install Python dependencies

```bash
pip install -r requirements.txt
```

{% endstep %}

{% step %}

#### Step 4: Verify the installation

```bash
python roku_pihole.py --help
```

{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="macOS" %}
{% stepper %}
{% step %}

#### Step 1: Clone the repository

```bash
git clone https://github.com/maddog1110/pi-hole-on-roku-without-router-access.git
cd pi-hole-on-roku-without-router-access
```

{% endstep %}

{% step %}

#### Step 2: Install Python dependencies

```bash
pip install -r requirements.txt
```

{% endstep %}

{% step %}

#### Step 3: Verify the installation

```bash
sudo python roku_pihole.py --help
```

{% hint style="info" %}
macOS may require `sudo` to access raw network sockets. You will be prompted for your password when running the script.
{% endhint %}
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Linux" %}
{% stepper %}
{% step %}

#### Step 1: Clone the repository

```bash
git clone https://github.com/maddog1110/pi-hole-on-roku-without-router-access.git
cd pi-hole-on-roku-without-router-access
```

{% endstep %}

{% step %}

#### Step 2: Install Python dependencies

```bash
pip install -r requirements.txt
```

{% endstep %}

{% step %}

#### Step 3: Verify the installation

```bash
sudo python roku_pihole.py --help
```

{% hint style="success" icon="lightbulb" %}
On Linux, you can grant the Python binary the `CAP_NET_RAW` and `CAP_NET_ADMIN` capabilities instead of running as root:&#x20;

```
sudo setcap cap_net_raw,cap_net_admin+eip $(which python3)
```

This allows you to run `python roku_pihole.py` without `sudo`.
{% endhint %}
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

### Dependencies

The only runtime dependency is [Scapy](https://scapy.net/), a Python packet manipulation library. It is listed in `requirements.txt` and installed by `pip install -r requirements.txt`.

| Dependency | Purpose                                        |
| ---------- | ---------------------------------------------- |
| `scapy`    | ARP spoofing and DNS packet capture/forwarding |
