# ![Anubis](<https://daemonless.io/images/logos/anubis.png>) Anubis

[![Build Status](<https://img.shields.io/github/actions/workflow/status/daemonless/anubis/build.yaml?style=flat-square&label=Build&color=green>)](<https://github.com/daemonless/anubis/actions>) [![Last Commit](<https://img.shields.io/github/last-commit/daemonless/anubis?style=flat-square&label=Last+Commit&color=blue>)](<https://github.com/daemonless/anubis/commits>) [![OCI Pulls](<https://img.shields.io/docker/pulls/daemonless/anubis?style=flat-square&label=OCI+Pulls&color=blue>)](<https://hub.docker.com/r/daemonless/anubis>)

Weighs the soul of incoming HTTP requests using browser-based proof-of-work challenges to protect web apps from AI scrapers.

- [![Anubis screenshot 1](<https://daemonless.io/images/screenshots/anubis/challenge.png>)](</images/screenshots/anubis/challenge.png>)

|  |  |
| --- | --- |
| **Port** | `8923` |
| **Registry** | [`ghcr.io/daemonless/anubis`](<https://github.com/daemonless/anubis/pkgs/container/anubis>) |
| **Daemonless** | [daemonless/anubis](<https://github.com/daemonless/anubis>) |
| **Source** | [TecharoHQ/anubis](<https://github.com/TecharoHQ/anubis>) |
| **Website** | [anubis.techaro.lol](<https://anubis.techaro.lol/>) |

## Persistent signing key

On first start, the container generates a random 32-byte Ed25519 signing key at `/config/ed25519.key` (mode `0600`) so browser clearance cookies survive container restarts. Set `ED25519_PRIVATE_KEY_HEX`, `ED25519_PRIVATE_KEY_HEX_FILE`, or `HS512_SECRET` to supply your own key.

## Custom bot policies

Anubis ships with a built-in default policy. To customize rules, place a `botPolicies.yaml` file in `/config/botPolicies.yaml` (auto-detected on startup) or point `POLICY_FNAME` to a custom path. Reference policy files are bundled under `/usr/local/share/anubis/`.

## Reverse proxy usage

Place Anubis in front of a backend by setting `TARGET=http://app:port` and pointing Caddy, Traefik, Nginx, or HAProxy at port `8923`. Ensure your reverse proxy forwards `X-Real-Ip` and `X-Forwarded-For` headers.

## Prerequisites

Before deploying, ensure your host environment is ready. See the [Quick Start Guide](<https://daemonless.io/guides/quick-start/index.md>) for host setup instructions, including the security model for host vs. container privileges.

## Deployment

**Customize Paths, UID & Ports**

```
services:
  anubis:
    image: "ghcr.io/daemonless/anubis:latest"
    container_name: anubis
    environment:
      - PUID=1000  # User ID for the application process
      - PGID=1000  # Group ID for the application process
      - TZ=UTC  # Timezone for the container
      - TARGET=http://localhost:3923  # Upstream backend URL to reverse proxy to (set empty when using auth_request mode only)
      # - BIND=  # HTTP listen address (default :8923)
      # - METRICS_BIND=  # Metrics and /healthz listen address (default :9090)
      # - DIFFICULTY=  # Proof-of-work challenge difficulty (number of leading hex zeros, default 4)
      # - COOKIE_DOMAIN=  # Top-level domain for Anubis clearance cookies (for example example.com)
      # - POLICY_FNAME=  # Path to a custom botPolicies.yaml (auto-loaded from /config/botPolicies.yaml if present)
      # - SERVE_ROBOTS_TXT=  # Set to true to serve a disallow-all robots.txt
      # - WEBMASTER_EMAIL=  # Optional contact email shown on rejected request pages
      # - SLOG_LEVEL=  # Log level: DEBUG, INFO, WARN, or ERROR (default INFO)
      # - ED25519_PRIVATE_KEY_HEX_FILE=  # Path to persistent 32-byte hex Ed25519 signing key (auto-generated at /config/ed25519.key by default)
    volumes:
      - "/containers/anubis:/config"
    ports:
      - "8923:8923"
      - "9090:9090"
    # always (not unless-stopped) so FreeBSD's podman rc.d auto-starts it at boot
    restart: always
```

Save as `compose.yaml`, then run `podman-compose up -d`.

> [!WARNING]
>
> Exposing ports in AppJail means that your service can be reached from remote hosts. If that is not your intention, do not expose the ports and communicate with the service using the jail's IPv4 address or hostname assigned by the virtual network.

```
# .env

DIRECTOR_PROJECT=anubis
PUID=1000
PGID=1000
TZ=UTC
TARGET=http://localhost:3923
```

```
# appjail-director.yml

options:
  - virtualnet: ':<random> default'
  - nat:
services:
  anubis:
    name: anubis
    options:
      - container: 'args:--pull'
      - expose: '8923:8923 proto:tcp'
      - expose: '9090:9090 proto:tcp'
    oci:
      user: root
      environment:
        - PUID: !ENV '${PUID}'
        - PGID: !ENV '${PGID}'
        - TZ: !ENV '${TZ}'
        - TARGET: !ENV '${TARGET}'
    volumes:
      - anubis: /config
volumes:
  anubis:
    device: '/containers/anubis'
```

```
# Makejail

ARG tag=latest

OPTION container=boot
OPTION overwrite=force
OPTION from=ghcr.io/daemonless/anubis:${tag}
```

Save the files above, then run `appjail-director up`.

Install and manage **Anubis** on FreeBSD with [fjord](<https://fjord.daemonless.io>):

```
fjord install anubis
```

Or open the **App Store** in the fjord web UI and install **Anubis** from the wizard. New to fjord? See the [Install Guide](<https://fjord.daemonless.io/install/>).

> [!WARNING]
>
> **Experimental**
>
> Bastille's OCI support is experimental. It requires `buildah` and shares the host network stack (`inherit`). Mount volumes with `--volume HOST JAIL`; without it, image-declared volumes are stored under `${bastille_volumesdir}/${jail}`.

```
services:
  anubis:
    name: anubis
    image: "ghcr.io/daemonless/anubis:latest"
    network:
      - mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - TARGET=http://localhost:3923
    volumes:
      - "/containers/anubis:/config"
```

Save as `bastille-compose.yml`, then run `bastille up`.

Open `http://<server>:8923` from another machine (the server's own browser can't use a published port).

## Parameters

### Environment Variables

| Variable | Default | Description |
| --- | --- | --- |
| `PUID` | `1000` | User ID for the application process |
| `PGID` | `1000` | Group ID for the application process |
| `TZ` | `UTC` | Timezone for the container |
| `TARGET` | `http://localhost:3923` | Upstream backend URL to reverse proxy to (set empty when using auth\_request mode only) |
| `BIND` | \`\` | HTTP listen address (default :8923) |
| `METRICS_BIND` | \`\` | Metrics and /healthz listen address (default :9090) |
| `DIFFICULTY` | \`\` | Proof-of-work challenge difficulty (number of leading hex zeros, default 4) |
| `COOKIE_DOMAIN` | \`\` | Top-level domain for Anubis clearance cookies (for example example.com) |
| `POLICY_FNAME` | \`\` | Path to a custom botPolicies.yaml (auto-loaded from /config/botPolicies.yaml if present) |
| `SERVE_ROBOTS_TXT` | \`\` | Set to true to serve a disallow-all robots.txt |
| `WEBMASTER_EMAIL` | \`\` | Optional contact email shown on rejected request pages |
| `SLOG_LEVEL` | \`\` | Log level: DEBUG, INFO, WARN, or ERROR (default INFO) |
| `ED25519_PRIVATE_KEY_HEX_FILE` | `<ED25519_PRIVATE_KEY_HEX_FILE>` | Path to persistent 32-byte hex Ed25519 signing key (auto-generated at /config/ed25519.key by default) |

### Volumes

| Path | Description |
| --- | --- |
| `/config` | Persistent Ed25519 signing key (/config/ed25519.key) and optional custom botPolicies.yaml |

### Ports

| Port | Protocol | Description |
| --- | --- | --- |
| `8923` | TCP | Anubis HTTP proxy / auth endpoint |
| `9090` | TCP | Prometheus metrics and /healthz endpoint |

## Version Tags

Multi-arch manifests — resolve automatically to the right image for your platform.

| Tag | Description | Best For |
| :--- | :--- | :--- |
| `latest` | Official upstream Anubis FreeBSD binary (auto-tracks latest release). | Most users — recommended. |
| `pkg` | **FreeBSD Quarterly**. Uses stable, tested packages. | Production stability. |
| `pkg-latest` | **FreeBSD Latest**. Rolling package updates. | Staying current. |

| Tag | Description | Best For |
| :--- | :--- | :--- |
| `latest-amd64` | Official upstream Anubis FreeBSD binary (auto-tracks latest release). | Most users — recommended. |
| `pkg-amd64` | **FreeBSD Quarterly**. Uses stable, tested packages. | Production stability. |
| `pkg-latest-amd64` | **FreeBSD Latest**. Rolling package updates. | Staying current. |

| Tag | Description | Best For |
| :--- | :--- | :--- |
| `latest-aarch64` | Official upstream Anubis FreeBSD binary (auto-tracks latest release). | Most users — recommended. |
| `pkg-aarch64` | **FreeBSD Quarterly**. Uses stable, tested packages. | Production stability. |
| `pkg-latest-aarch64` | **FreeBSD Latest**. Rolling package updates. | Staying current. |

> [!NOTE]
>
> **Implementation Details**
>
> - **Architectures:** amd64, aarch64
> - **User:** `bsd` (UID/GID set via [PUID/PGID](<https://daemonless.io/guides/permissions/index.md>)). Defaults to `1000:1000`.
> - **Base:** Built on `ghcr.io/daemonless/base` (FreeBSD 15.1).

---

Need help? Join our [Discord](<https://discord.gg/Kb9tkhecZT>) community.
