Skip to content

sweisgerber/docker-snapcast

Repository files navigation

Snapcast (Docker Image)

Snapcast Multiroom audio docker image w/ Snapweb files.

Based on linuxserver/docker-baseimage-alpine & snapcast. Also available at DockerHub

Should get used in conjunction with a player, that plays to a FIFO, like:

Features Include:

  • Snapserver w/ sane defaults
  • Snapclient (optional, needs mounting of host audio devices into docker)
  • snapweb management interface & browser audio playback
    • default on http://:1780m which include a browser snapclient player
  • alsa
  • librespot (for functioning as spotify target)
  • shairport-sync (for functioning as airplay target)
  • FIFO usage to stream the audio from players to the network
  • Based on linuxserver/docker-baseimage-alpine
    • ... which allows use of linuxserver/docker-mods to add more pip & OS packages
    • Uses s6-overlay from base image
    • small footprint

docker-compose

I strongly advice to use docker-compose, as using a docker commandline is quite annoying with a complex setup. An example can get found in the repository. A more complex example together with mopidy can get found at mopiroom.

version: "3"
services:
  snapcast:
    image: docker.io/sweisgerber/snapcast:latest
    hostname: snapcast
    environment:
      - PUID=1000
      - PGID=1000 # set to audio group ID
      - TZ=Europe/Berlin
      - START_SNAPCLIENT=false # set to `true` for snapclient to start
      # --host: name or ip of compose service or dockerhost
      # --soundcard: <ID> from `snapclient -l` from inside the container
      # - SNAPCLIENT_OPTS=--host snapcast --soundcard <ID>
      #   => Don't use quotes for SNAPCLIENT_OPTS="" !
      # - HOST_AUDIO_GROUP=<AUDIO-GID> # set to GID of host audio group
    restart: "unless-stopped"
    ports:
      - 1704:1704
      - 1705:1705
      - 1780:1780
    # devices:
      # - /dev/snd:/dev/snd # optional, only if you want to use snapclient
    volumes:
      - /<path>/<to>/<snapcast>/config/:/config/
      - /<path>/<to>/<snapcast>/data/:/data/
      # /audio should get used to place FIFOs for audio playback from mpd/mopidy/host/etc
      - /<path>/<to>/audio-fifos/:/audio/

Configuration

Configuration SnapClient

To enable snapclient:

In any case, give the official documentation a read