spotifyd
This is all pretty obvious, but recording it here for posterity. spotifyd is an open-source, lightweight Spotify client for Premium accounts. We use it for our home server, which runs a couple of instances to enable Spotify Connect to the home speakers.
Setup is pretty easy but requires a little systemd messing around. Step 1 is to clone the repo and build spotifyd (which needs Rust’s cargo
), and then symlink it into /usr/bin
. I’m using the pulseaudio backend, so the command to build is cargo build --release --features pulseaudio_backend
. Step 2: write
[Unit]
Description=A spotify playing daemon
Documentation=https://github.com/Spotifyd/spotifyd
[Service]
ExecStart=/usr/bin/spotifyd --no-daemon
Restart=always
RestartSec=12
[Install]
WantedBy=default.target
to /etc/systemd/user/spotifyd.service
and chmod it to readable for everyone. Step 3: for each user that wants to run spotifyd, make ~/.config/spotifyd/spotifyd.conf
containing
[global]
username = ...
password = ...
device_name = ...
where username
and password
are your spotify credentials and device_name
is the name you want to appear in your Spotify Connect menus. (Ours is “skald”, to continue the Asgard-based naming tradition.)
Finally, step 4 is
systemctl --user enable spotifyd.service
systemctl --user start spotifyd.service
and it should start up. You can check the logs with journalctl --user-unit spotifyd -xe -f
.