Sign inSign up

flaviostutz/rpi-spotify

By flaviostutz

•Updated almost 6 years ago

Raspotify Container to be run on Raspberry-Pi. Use your Raspberry as a remote Spotify speaker.

Image
5

10K+

flaviostutz/rpi-spotify repository overview

This container runs a headless Spotify⁠ player that can be remote-controlled by any Spotify app. Audio is output to /dev/snd, so you need to make sure the docker container has access to it (see examples). This allows the host system to play back the audio using alsa⁠, pulseaudio⁠, forked-daapd⁠ (to Airplay), snapserver⁠, etc.

This requires a Spotify premium account, but does not require a Spotify developer key or libspotify binary.

The process run is librespot⁠, an open source client library for Spotify. This docker container image leverages the work from David Cooper⁠.

Dockerhub⁠:

⁠Prerequisites

  • A Raspberry Pi (tested on RPi2/3)
  • Docker
  • docker-compose

⁠Usage

  • Create file docker-compose.yml
version: "3.7"
services:
  rpi-spotify:
    image: flaviostutz/rpi-spotify
    network: host
    restart: always
    environment:
      - SPOTIFY_NAME=MySpeaker
      - DEVICE_NAME=/dev/snd  
  • Run docker-compose up -d

  • Open Spotify App and click on a speaker icon (Connect to a device)

  • If you are on the same network as this container, select the speaker "MySpeaker"

  • Enjoy!

⁠ENVs

  • SPOTIFY_NAME: Specifies the name of this speaker (shown in Spotify client)
  • DEVICE_NAME: Output io device to which the sound will be output. Defaults to "/dev/snd"

⁠Development

Auto build doesn't work on Docker Hub because it is a cross compilation on RPI. You have to build the image locally and push it manually

docker-compose build
docker login 
docker push flaviostutz/rpi-spotify

⁠Screenshots

Tag summary

Content type

Image

Digest

Size

86.9 MB

Last updated

about 7 years ago

docker pull flaviostutz/rpi-spotify