Skip to main content

Installation

BatAudit runs via Docker Compose. No other dependencies required.

Prerequisites

  • Docker with Compose v2+
  • A terminal

One-command demo

The fastest way to see BatAudit running with realistic pre-loaded data:

git clone https://github.com/joaovrmoraes/bataudit.git
cd bataudit
docker compose -f docker-compose.demo.yml up

Once all services are healthy (about 30–60 seconds):

The demo includes 30 days of realistic audit events, anomaly alerts, orphan browser events, and a live event streamer that continuously generates new data.


Production setup

For a real deployment, use the standard docker-compose.yml:

1. Clone and configure

git clone https://github.com/joaovrmoraes/bataudit.git
cd bataudit
cp .env.example .env

2. Edit .env

# Required — change these
JWT_SECRET=your-strong-random-secret-here
INITIAL_OWNER_EMAIL=you@yourdomain.com
INITIAL_OWNER_PASSWORD=your-secure-password
INITIAL_OWNER_NAME=Your Name

# Database (defaults work for local Docker)
DB_USER=batuser
DB_PASSWORD=batpassword
DB_NAME=batdb

3. Start services

docker compose up -d

4. Open the dashboard

Navigate to http://localhost:8082/app and log in with the credentials from your .env.


Environment variables reference

VariableRequiredDefaultDescription
JWT_SECRETSecret key for signing JWT tokens
INITIAL_OWNER_EMAILEmail for the first owner account
INITIAL_OWNER_PASSWORDPassword for the first owner account
INITIAL_OWNER_NAMEDisplay name for the first owner
DB_HOSTpostgresPostgreSQL host
DB_PORT5432PostgreSQL port
DB_USERbatuserPostgreSQL user
DB_PASSWORDbatpasswordPostgreSQL password
DB_NAMEbatdbPostgreSQL database name
REDIS_ADDRESSredis:6379Redis address
API_READER_PORT8082Port for Reader service
LOG_LEVELinfoLog level: debug, info, warn, error
GIN_MODEreleaseGin mode: debug or release
TIERING_RAW_DAYS30Days to keep raw events
TIERING_HOURLY_DAYS365Days to keep hourly summaries

Services and ports

ServicePortNotes
Writer8081Event ingestion endpoint
Reader8082REST API + dashboard
PostgreSQL5432Internal only (not exposed by default)
Redis6379Internal only
tip

In production, expose only ports 8081 and 8082 behind a reverse proxy (Nginx, Caddy, Traefik).