Misc

2025

How to install Spotifyd on Raspberry Pi 4 running Raspberry Pi OS

Published on Wednesday, July 16, 2025

This blogpost is intended as a note to self, as I struggled finding a clear guide on how to install Spotifyd that was up to date. I also ran into a few problems along the way.

My setup:

  • Raspberry Pi 4 8GB

  • 128gb Micro SD card

  • Edifier Bookshelf speakers

  • Physical audio cable connected from the Raspberry Pi to the speakers

  • USB mouse

  • USB keyboard

  • Monitor + Micro HDMI to HDMI connector + HDMI cable

The intent of installing Spotifyd is being able to stream using Spotify to my speakers without needing to connect with bluetooth. Saving my phone power from draining using Bluetooth (despite being Bluetooth 5).

Step 1 - Pi OS

Write Raspberry Pi OS to your Micro SD card. Find the instructions here.

Insert the Micro SD card into the Raspberry Pi while powered off and plug the power cable in to power the Pi on. Follow the boot instructions.

Step 2 - Prepare Pi OS

Open Terminal and update the Raspberry Pi with the following command.

sudo apt update && sudo apt upgrade -y

And install the necessary dependencies with the following command.

sudo apt install -y curl libasound2 libasound2-dev build-essential

Step 3 - Get Spotifyd

Get the latest Spotifyd build. Look for aarch64, and get spotifyd-linux-aarch64-slim.tar.gz with the following command.

wget https://github.com/Spotifyd/spotifyd/releases/latest/download/spotifyd-linux-aarch64-slim.tar.gz
tar xvf spotifyd-linux-aarch64-slim.tar.gz
sudo mv spotifyd /usr/local/bin/
sudo chmod +x /usr/local/bin/spotifyd

Verify it's working by checking the version number with the following command.

spotifyd --version

Step 4 - Create configuration

Run the following commands once after another to create your configuration file. Spotifyd will read this file before launching. Once it's running and you make changes to it, you need to restart Spotifyd.

mkdir -p ~/.config/spotifyd

And next, to actually create the config file in the directory.

nano ~/.config/spotifyd/spotifyd.conf

Now configure the config file the way you want. The offical docs from Spotifyd regarding the config file are here. A general note is that alsa is the recommended backend. For my setup, my audio could not be controlled from my phone unless I specified the mixer as PCM. My config file is at follows:

[global]
username = "your_spotify_username"
password = "your_spotify_password"
backend = "alsa"
device_name = "Raspberry pi"
bitrate = 160
volume_controller = "softvol"
cache_path = "/tmp/spotifyd"
no_audio_cache = true
mixer = "PCM"

Write the config file using CTRL+O, then press Enter to confirm, then CTRL+X to exit. These instructions are also in the bottom of the terminal window.

Step 5 - Run Spotifyd

Run Spotifyd with the following command. At this point Spotifyd is running as long as the terminal window that launched this command is open. With this command you can spot for any errors.

spotifyd --no-daemon

At this point you should test connecting from a phone or other device to your Raspberry Pi using Spotify Connect and testing if it's working. If not, you should troubleshoot the configuration and if you have unkown errors, Google them or ask ChatGPT.

Step 6 - Create the background service

We don't want to run Spotifyd only when the terminal is open, we want to run it in the background. To do this, run the following command in a new terminal window. Close the terminal window from the step before.

sudo nano /etc/systemd/system/spotifyd.service

Now that the service file is created, paste the following into it.

[Unit]
Description=Spotifyd daemon
After=sound.target network-online.target

[Service]
User=YOURUSERNAME
Group=audio
ExecStart=/usr/local/bin/spotifyd --no-daemon
Restart=on-failure
Environment=XDG_RUNTIME_DIR=/run/user/1000

[Install]
WantedBy=multi-user.target

Write the config file using CTRL+O, then press Enter to confirm, then CTRL+X to exit. These instructions are also in the bottom of the terminal window.

Commonly your user ID should be 1000, check this now using the following command. If your user ID is different, go back and update it in the service file.

id -u pi

Now we run the following commands in order to start spotifyd using the background service.

sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl restart spotifyd

And finally, we check the status.

systemctl status spotifyd

If all is well, you should see active and running in green.

Step 7 - Enjoy

You can close all terminal windows as Spotifyd is now a background service and as long as your Raspberry Pi is running, you should see your Pi show up on Spotify Connect.


© 2025 lucvanloon.com

Reach me at hey@lucvanloon, LinkedIn or give me a follow on X.

© 2025 lucvanloon.com

Reach me at hey@lucvanloon, LinkedIn or give me a follow on X.