Skip to content

Docker Deployment

Deploy Flex Video using Docker Compose for the quickest setup.

Quick Start

1. Download Configuration

# Create directory
mkdir -p /opt/flex && cd /opt/flex

# Download docker-compose.yml
curl -O https://flex.blackwire-ts.com/download/docker-compose.yml

Download Portal

Visit flex.blackwire-ts.com to download configuration files and installers.

2. Start Services

docker compose up -d

3. Verify Installation

# Check containers are running
docker compose ps

# Check API health
curl http://localhost:3539/flex/health

4. Access Web Interface

Open http://localhost:8080 in your browser.

Configuration

Environment Variables

Create a .env file for configuration:

# /opt/flex/.env

# API key for internal service authentication (auto-generated by installer)
FLEX_API_KEY=your-secure-api-key

# Hardware decoding (set to false to enable GPU acceleration)
FLEX_FORCE_SW_DECODERS=true

Volume Mounts

Volume Purpose Default
license_data License storage Docker volume
screenshots Screenshot files Docker volume
fvm_data Persistent settings Docker volume
site_docs Documentation Docker volume
api_docs OpenAPI spec Docker volume

To use host directories:

volumes:
  - /path/to/license:/licensing
  - /path/to/screenshots:/screenshots

Video Files

To play local video files, mount a directory to /video:

volumes:
  - /path/to/videos:/video:ro

Then use file:///video/filename.ts as the source URI.

Hardware Acceleration

NVIDIA Jetson

Uncomment the NVIDIA section in docker-compose.yml:

flex-av1:
  runtime: nvidia
  environment:
    - NVIDIA_VISIBLE_DEVICES=all
    - NVIDIA_DRIVER_CAPABILITIES=all

Requires nvidia-container-toolkit.

Intel VAAPI

Uncomment the Intel section:

flex-av1:
  devices:
    - /dev/dri:/dev/dri

Set FLEX_FORCE_SW_DECODERS=false in .env.

Service Management

Start Services

docker compose up -d

Stop Services

docker compose down

View Logs

# All services
docker compose logs -f

# Specific service
docker compose logs -f flex-manager

Restart Service

docker compose restart flex-manager

Update Images

docker compose pull
docker compose up -d

Accessing Services

Service URL Description
Web UI http://localhost:8080 Management interface
REST API http://localhost:3539 Pipeline control
Documentation http://localhost:8082 This documentation
API Docs (Swagger) http://localhost:8081 Interactive API reference
RTSP Streams rtsp://localhost:8554/* MediaMTX streams
RTSP Server rtsp://localhost:8731/* GStreamer streams

Remote Access

Replace localhost with your server's IP for remote access.

Optional: Swagger UI

Swagger UI provides interactive API documentation. Enable with the docs profile:

# Start with Swagger UI
docker compose --profile docs up -d

# Or add to .env for permanent enablement
echo "COMPOSE_PROFILES=docs" >> .env

Access at http://localhost:8081.

Linux vs. macOS

Linux (Production)

Uses host networking for optimal performance:

network_mode: host

macOS (Development)

Uses port mappings (host networking unsupported):

docker compose -f docker-compose.mac.yml up -d

Health Checks

All services include health checks:

# Check health status
docker compose ps

# Manual health check
curl http://localhost:3539/flex/health
curl http://localhost:35391/health
curl http://localhost:58080/v3/info

Troubleshooting

Containers Won't Start

# Check logs
docker compose logs

# Check resource limits
docker stats

# Verify ports are free
ss -tulpn | grep -E '8080|3539|8554'

Permission Denied

# Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in

Camera Not Detected

# Verify device exists
ls -la /dev/video*

# Check container has access
docker exec flex-av1 ls -la /dev/video*

Out of Memory

Increase Docker memory limits or reduce container reservations in docker-compose.yml.

Next Steps