Sign inSign up

bunchofbricks/librespot-snapcast

By bunchofbricks

•Updated 7 months ago

This image allows you to stream spotify music to all snapcast clients in your network.

Image
Internet of things
1

2.6K

bunchofbricks/librespot-snapcast repository overview

⁠librespot-snapcast

Current latest contains:

On trixie-slim

Drop issues, questions or anything else as an issue⁠ in the repo⁠ for this image. As i am only providing amd64 images at the moment, you can use the Dockerfile in the repo to build it for your device.

⁠Why?

This image allows you to stream spotify music to the librespot server which can send the stream to the snapcast-server which can send the stream to all your snapcast clients in your network.

⁠What do you need?
  • build a snapserver config (example included)
  • create the docker-compose.yml and start the container
  • a spotify premium account from which you can stream to devices
  • snapcast clients which can pick up and play the stream

For more information visit the well documented github pages of snapcast⁠ / librespot⁠

⁠docker-compose.yml
services:
  snapcast:
    image: bunchofbricks/librespot-snapcast
    network_mode: host # Finding the librespot spotify devices won't work properly without network_mode: host
    container_name: snapcast
    volumes:
      - <your-path>/server.json:/root/.config/snapserver/server.json # This is to keep your snapcast client-settings persistent (for example volume levels, latency settings)
      - <your-path>/snapserver.conf:/etc/snapserver.conf # You should create this file before you start the container
    restart: always
⁠Snapcast config example

Attention: This example is heavily shortened. Take a look at the well documented original config file at github:

This example should contain everything to run the snapserver. Nevertheless i recommend to use the original snapserver.conf from github⁠ and then add/change what you need.

You probably want to change "MySpotifyDeviceName" to something you want.

[server]
user = root
group = root
[http]
enabled = true
bind_to_address = 0.0.0.0
port = 1780
doc_root = /usr/share/snapserver/snapweb
[stream]
source = librespot:///usr/local/bin/librespot?name=MySpotifyDeviceName&devicename=MySpotifyDeviceName&bitrate=320&volume=100&normalize=true&disable_audio_cache=true&killall=false

Afters starting the container, you should be able to find "MySpotifyDeviceName" as a device you can stream to. Every Snapcast Client in your network should be able to find the snapcast server and play the stream. Snapweb is enabled, so every device with a browser can visit http://<address_of_your_docker_host>:1730 and then be your first snapcast client

Tag summary

Content type

Image

Digest

sha256:8f50ee043…

Size

50.9 MB

Last updated

7 months ago

docker pull bunchofbricks/librespot-snapcast