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

# RAG PDF Highlighter Installation: pip and Docker Setup Guide

> Install RAG PDF Highlighter as a Python package via pip or as a self-contained Docker container. Python 3.10 or later is required to run the service.

You can run RAG PDF Highlighter in two ways: as a Python package installed directly into your environment, or as a self-contained Docker container. Both approaches expose the same HTTP API on port 8000 and require no external services or databases to operate.

<Tabs>
  <Tab title="Python Package">
    Install the package from PyPI with `pip`. Python 3.10 or later is required.

    ```bash theme={null}
    pip install rag-pdf-highlighter
    ```

    **Dependencies installed automatically:**

    | Package          | Minimum Version |
    | ---------------- | --------------- |
    | `fastapi`        | 0.100           |
    | `uvicorn`        | 0.20            |
    | `httpx`          | 0.24            |
    | `langchain-core` | 0.1             |
    | `pymupdf`        | 1.23            |

    You do not need to install any of these separately — `pip` resolves and installs them as part of the `rag-pdf-highlighter` package.

    Once installed, start the API server with Uvicorn:

    ```bash theme={null}
    uvicorn rag_pdf_highlighter.main:app --host 0.0.0.0 --port 8000
    ```

    To run on a different port, replace `8000` with your preferred port number.
  </Tab>

  <Tab title="Docker">
    If you prefer to containerize the service, create a `Dockerfile` in your project root:

    ```dockerfile theme={null}
    FROM python:3.12-slim

    WORKDIR /app

    RUN pip install rag-pdf-highlighter

    ENV PORT=8000
    EXPOSE 8000

    CMD ["sh", "-c", "exec uvicorn rag_pdf_highlighter.main:app --host 0.0.0.0 --port ${PORT}"]
    ```

    Build the image:

    ```bash theme={null}
    docker build -t rag-pdf-highlighter .
    ```

    Run the container, mapping port 8000 on your host to port 8000 in the container:

    ```bash theme={null}
    docker run -p 8000:8000 rag-pdf-highlighter
    ```

    **Overriding the port** — pass the `PORT` environment variable to listen on a different port:

    ```bash theme={null}
    docker run -e PORT=9000 -p 9000:9000 rag-pdf-highlighter
    ```
  </Tab>
</Tabs>

## Verify the Installation

After starting the service with either method, confirm it is running correctly by calling the health-check endpoint:

```bash theme={null}
curl http://localhost:8000/
```

You should receive the following response:

```json theme={null}
{"status": "ok the app is running"}
```

If you see this response, RAG PDF Highlighter is ready to accept highlight requests. If the request fails, check that the port is not blocked by a firewall rule and that the process started without errors in your terminal output.
