This guide assumes you have solid knowledge of Linux, shairport-sync, PulseAudio, Docker and Docker Compose. If you are solid on these things, this guide should be easy to follow. This guide also assumes your Linux server doesn’t have a desktop environment because this guide will have you disable the usermode PulseAudio service which would probably break a desktop environment. I am personally running Debian but Ubuntu should work with these instructions. Other distros may also work with minimal deviation from these instructions.
git clone https://github.com/noelhibbard/shairport-sync-docker.git
- Docker install instructions: https://docs.docker.com/engine/install/debian/
- Install Packages
apt update && apt install -y pulseaudio pulseaudio-utils alsa-utils
- Disable usermode systemd service
sudo systemctl --global disable pulseaudio.service pulseaudio.socket
- Install system wide PulseAudio systemd service
sudo usermod -d /var/run/pulse pulse sudo adduser root audio sudo adduser root pulse-access sudo systemctl --system enable $PWD/pulseaudio.service --now
Empty out the entire /etc/pulse/system.pa
and add this single line:
echo "load-module module-native-protocol-unix auth-anonymous=1" > /etc/pulse/system.pa
Add a line to /etc/pulse/system.pa
for each ALSA output you want available in in Pulse. For example:
echo "load-module module-alsa-sink device=<device> sink_name=<sink_name>" >> /etc/pulse/system.pa
Note: device
is the ALSA output device you want to make available in PulseAudio (Example: hw:0
). sink-name
is the name of the sink. What ever you use here is what you will use in shairport-sync.conf for the pa sink.
Restart PulseAudio to reload config
sudo systemctl restart pulseaudio
The docker containers will be placed on your host network. Before you can do that you have to supply the physical network interface, subnet and gateway for your host network.
- set interface here:
networks.spsnet.driver_opts.parent
(Example:eth0
) - set subnet here:
networks.spsnet.ipam.config.subnet
(Example:192.168.1.0/24
) - set gateway here:
networks.spsnet.ipam.config.gateway
(Example:192.168.1.254
)
A single docker-compose.yaml will contain the configureation for all your SPS docker containers. My example has two instances. One named Instance1 with the IP 192.168.1.101 and the other named Instance2 with the IP 192.168.1.102. Edit these how ever fits your environment. Also notice the volume entry that maps your shairport-sync.conf into the container. Make sure you also edit the name and PulseAudio sink within your shairport-sync.conf files.
docker compose up -d
docker compose stop
docker compose restart
docker compose logs -f
docker compose pull
docker compose up -d