🐳 Sky-view as a Docker container

This section provides instructions for deploying and running the software as a Docker container.

Prerequisites

Ensure Docker is installed on your Linux system. Refer to the Docker documentation for installation instructions specific to your Linux distribution.
If you prefer managing your Docker deployment with Docker Compose, ensure that Docker Compose is also installed.

On Windows, you can use a WSL2 or VM to manage your Docker environment.

Running Docker on a machine that is not connected to the internet

If you are not connected to the internet, you can download the Docker image from the Docker Hub and store it locally.
More information on Docker offline

Docker

docker run -it --rm\
  --device=/dev/dri \
  --group-add=video \
  --network host \
  -e SKY_VIEW_SERVER_ADDR=":8100" \
  -e SKY_VIEW_DB_PATH="/data/sky-view.db" \
  -e SKY_VIEW_USERS_DB_PATH="/data/skyview-users.db" \
  -e SKY_VIEW_STREAM_EVENTS_DB_PATH="/data/skyview-stream-events.db" \
  -e SKY_VIEW_LOG_PATH="/data/sky-view.log" \
  -e SKY_VIEW_LOG_MAX_SIZE_MB="10" \
  -e SKY_VIEW_LOG_MAX_BACKUPS="5" \
  -e SKY_VIEW_LOG_MAX_AGE_DAYS="0" \
  -v sky-view-data:/data \
  impleo/sky-view:1.8.3
  • --device=/dev/dri and --group-add=video: Provide access to host GPU devices for VA-API/NVDEC hardware acceleration. Remove these lines if your host lacks GPU drivers or you prefer software decode.
  • --network=host: Uses the host’s network, allowing the container to listen on all network interfaces of the host. Also required for udp multicast support.
  • -v sky-view-data:/data: Mounts the database volume inside the container.

After running this command, the sky-view service will be accessible at http://localhost:8100.

Docker Compose

Create a docker-compose.yml file in your preferred directory and define the services required for running the sky-view.

Example docker-compose.yml:

services:
  caddy:
    image: caddy:2
    container_name: caddy
    network_mode: host
    # ports:
    #   - "80:80"
    #   - "443:443"
    volumes:
      - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./data:/data
      - ./config:/config
    extra_hosts:
      - "host.docker.internal:host-gateway"
    depends_on:
      - sky-view
    restart: unless-stopped

  sky-view:
    image: impleo/sky-view:1.8.3
    container_name: skyview
    # Host network required for UDP multicast support
    network_mode: host
    depends_on:
      timescaledb:
        condition: service_healthy
        required: false
    environment:
      SKY_VIEW_ANALYTICS_ENABLED: "${SKY_VIEW_ANALYTICS_ENABLED:-false}"
      SKY_VIEW_ANALYTICS_HOST: "${SKY_VIEW_ANALYTICS_HOST:-127.0.0.1}"
      SKY_VIEW_ANALYTICS_PORT: "${SKY_VIEW_ANALYTICS_PORT:-5432}"
      SKY_VIEW_ANALYTICS_DB: "${SKY_VIEW_ANALYTICS_DB:-skyview}"
      SKY_VIEW_ANALYTICS_USER: "${SKY_VIEW_ANALYTICS_USER:-skyview}"
      SKY_VIEW_ANALYTICS_PASSWORD: "${SKY_VIEW_ANALYTICS_PASSWORD:-skyview}"
      SKY_VIEW_SERVER_ADDR: "${SKY_VIEW_SERVER_ADDR}"
      SKY_VIEW_SERVER_NAME: "${SKY_VIEW_SERVER_NAME:-SkyView}"
      SKY_VIEW_SERVER_SHORT_NAME: "${SKY_VIEW_SERVER_SHORT_NAME:-SkyView}"
      SKY_VIEW_DB_PATH: "/data/skyview.db"
      SKY_VIEW_USERS_DB_PATH: "/data/skyview-users.db"
      SKY_VIEW_STREAM_EVENTS_DB_PATH: "/data/skyview-stream-events.db"
      SKY_VIEW_PWA_VAPID_PUBLIC_KEY: "${SKY_VIEW_PWA_VAPID_PUBLIC_KEY}"
      SKY_VIEW_PWA_VAPID_PRIVATE_KEY: "${SKY_VIEW_PWA_VAPID_PRIVATE_KEY}"
      SKY_VIEW_PWA_VAPID_CONTACT: "${SKY_VIEW_PWA_VAPID_CONTACT}"
    volumes:
      - data:/data
        # mount only the needed CA directory as read-only
      - type: bind
        source: ./data/caddy/pki/authorities/local
        target: /caddy_pki
        read_only: true
    devices:
      - /dev/dri:/dev/dri
    group_add:
      - video
    restart: unless-stopped

  timescaledb:
    image: timescale/timescaledb:2.15.2-pg16
    container_name: skyview-timescaledb
    restart: unless-stopped
    profiles:
      - analytics
    environment:
      POSTGRES_DB: "${SKY_VIEW_ANALYTICS_DB:-skyview}"
      POSTGRES_USER: "${SKY_VIEW_ANALYTICS_USER:-skyview}"
      POSTGRES_PASSWORD: "${SKY_VIEW_ANALYTICS_PASSWORD:-skyview}"
      TIMESCALEDB_TELEMETRY: "off"
    ports:
      - "${SKY_VIEW_ANALYTICS_PORT:-5432}:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${SKY_VIEW_ANALYTICS_USER:-skyview} -d ${SKY_VIEW_ANALYTICS_DB:-skyview}"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - analytics-data:/var/lib/postgresql/data

volumes:
  data:
  analytics-data:

TimescaleDB is optional and only needed when the Analytics license option is enabled. Set SKY_VIEW_ANALYTICS_ENABLED=true and export COMPOSE_PROFILES=analytics in your .env file (or shell) to start it alongside SkyView:

SKY_VIEW_ANALYTICS_ENABLED=true
COMPOSE_PROFILES=analytics
SKY_VIEW_ANALYTICS_PASSWORD=change-me
docker compose up -d timescaledb sky-view

When Analytics is disabled or unlicensed, SkyView will continue to run without TimescaleDB.