Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

StyleGrab can be self-hosted using Docker or built from source.

Prerequisites

  • Docker and Docker Compose (recommended)
  • Or: Rust 1.75+, PostgreSQL 16+, and a headless Chromium instance

The fastest way to get StyleGrab running locally:

# Clone the repository
git clone https://github.com/stylegrab/stylegrab.git
cd stylegrab

# Copy environment template
cp .env.example .env

# Edit .env with your values (see Configuration)
nano .env

# Start all services
docker compose up -d

This starts:

  • app — StyleGrab API server on port 3000
  • postgres — PostgreSQL database
  • redis — Redis cache
  • browser — Headless Chromium for extractions

From Source

# Clone the repository
git clone https://github.com/stylegrab/stylegrab.git
cd stylegrab

# Copy environment template
cp .env.example .env

# Set up PostgreSQL and run migrations
# (ensure DATABASE_URL is set in .env)
cargo install sqlx-cli
sqlx database create
sqlx migrate run

# Build and run
cargo build --release
./target/release/stylegrab

Verify Installation

# Check health endpoint
curl http://localhost:3000/health

# Expected response
{"status": "ok"}

Headless Browser Setup

StyleGrab requires a Chromium instance with CDP (Chrome DevTools Protocol) enabled:

# Run Chromium with CDP enabled
chromium --headless --disable-gpu --remote-debugging-port=9222

# Or use the provided Docker image
docker run -d --name chrome \
  -p 9222:9222 \
  zenika/alpine-chrome \
  --no-sandbox --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222

Set BROWSER_WS_URL=ws://localhost:9222 in your .env file.

Next Steps