Installation

TRAPPER ships as a multi-container Docker stack covering the Expert backend (this module), the AI Manager, the AI Worker host coordinator, and the Citizen Science frontend. We use a unified deployment toolchain — the trapper-setup repository — to orchestrate the entire ecosystem with one interactive wizard, instead of running docker compose against a hand- edited .env file as in v1.

If you only want to develop on this module (Expert backend) without the AI stack and Frontend, see Expert-only development setup at the end of this page.

Note

This page covers getting a deployment running. Tweaking individual runtime options (database, storage, AI pipeline, distance estimation, trackers, …) is documented in Configuration.

Prerequisites

A Linux host (Ubuntu Server LTS recommended) with:

  • Docker Engine ≥ 24 and Docker Compose v2 (docker compose subcommand, not legacy docker-compose). Follow the official installation guide at https://docs.docker.com/engine/install/.

  • Python 3.11+ on the host (used by trapper-setup itself; the stack containers ship their own Python).

  • Git and curl for fetching trapper-setup and the AI Worker installer.

  • For AI inference (optional): an NVIDIA GPU with working driver, a Hailo-8 PCIe device with hailo-all installed, or sufficient CPU. The AI Worker coordinator autodetects available hardware at startup.

The reference target is amd64 / arm64 Linux. Apple Silicon Macs work for local development via Docker Desktop. Windows is supported via Docker Desktop + WSL2 but is not what the team runs day-to-day.

What you get out of the box

A successful installation gives you the following running services. All ports listed are localhost defaults; in production deployments they sit behind Traefik.

Service

What it does

Port

Trapper Expert (Django)

Core backend, REST API, admin

8000

Trapper Expert Celery

Background tasks (uploads, AI dispatch)

Trapper Expert Uploader

Chunked-upload FastAPI service

8088

Trapper Expert Nginx

Static + media + video streaming

8080

Trapper AI Manager

Prediction-job orchestration

8001

AI Worker coordinator

Host process, autodetects hardware

34821

Citizen Science frontend

Angular SPA

4200

PostgreSQL (Expert)

TimescaleDB-enabled main database

5432

PostgreSQL (AI)

Plain PostgreSQL for the AI Manager

5433

RabbitMQ

Celery broker (Expert and AI Manager)

5672

Memcached

Shared cache

11211

Pure-FTPd

FTPS upload endpoint

21

The PostgreSQL Expert image is TimescaleDB-enabled because the ObjectFrameObservation per-frame index is stored as a hypertable; see Frame-level data and USE_FRAMES_HYPERTABLE for the optional flag that lets new installs skip the extension entirely.

Expert-only development setup

If you are working only on this module (no AI stack, no frontend), the project’s own ./start.sh is still the path of least resistance for a quick dev loop.

  1. Clone this repository:

    git clone https://gitlab.com/trapper-project/trapper.git
    cd trapper
    
  2. Copy and adjust the env template:

    cp trapper.env .env
    # Edit .env if you want to point at an external DB or change ports
    
  3. Start the dev stack with the in-tree helper:

    ./start.sh -pb dev
    

    Flags: -p pulls images, -b builds the local trapper image. See ./start.sh -h for the full list (notably -d for an external database — see Database).

  4. Create a superuser:

    docker exec -it trapper bash
    python /app/trapper-project/manage.py createsuperuser
    

This path skips the AI stack and frontend entirely. Use it for quick iteration on the Expert backend; switch to trapper-setup for any deployment-shaped task.

Upgrading

If you installed via trapper-setup, follow the upgrade procedure in the trapper-setup README — at minimum:

./profiles/<profile>/stop.sh --no-coordinator
docker compose pull
./bin/install-coordinator.sh <profile> --reinstall
./profiles/<profile>/start.sh
./admin.py manage trapper migrate -p <profile>
./admin.py manage trapper-ai-web migrate -p <profile>

If you installed via the in-tree ./start.sh (Expert-only dev), pull the new image and run migrations inside the container:

./stop.sh
./start.sh -pb dev
docker exec -it trapper bash
python /app/trapper-project/manage.py migrate