How to Setup Spotify Connect on the Raspberry Pi

In this Raspberry Pi Spotify tutorial, we will be going through all the steps to set up the Spotify connect service. This setup is headless, so you will need to control it using another device.

Raspberry Pi Spotify

Using the Raspotify software package, we can set up your Raspberry Pi so that it can work as a cheap Spotify Connect device.

Working as a Spotify Connect device allows you to easily stream songs from any Spotify app to your Raspberry Pi. This setup is an affordable way of connecting any speakers to Spotify.

In addition to showing you how to install the Spotify connect software, we will walk you through some of the basic configuration options that you can specify.

While this isn’t the full Spotify, it does allow you to easily use any other device to play music from your Raspberry Pi. It also allows you to run Spotify on your Raspberry Pi in a completely headless setup.

You will need a Spotify premium account to be able to complete this tutorial.

Equipment List

Below are all the bits and pieces that I made use of for this Raspberry Pi Spotify tutorial.


Raspberry Pi 2, 3 or 4

Micro SD Card

Power Supply

Ethernet Cord or WiFi dongle (The Pi 3 and 4 has WiFi inbuilt)

Spotify Premium


Raspberry Pi Case

This project is all about audio, so it might be worth purchasing a USB Audio Card or a Raspberry Pi sound card. The default Raspberry Pi setup is good enough for most users.

Setting up a Raspberry Pi Spotify Connect Device

1. Our first task is to ensure everything is up to date with our operating system. It will make installing the Spotify software to our Raspberry Pi a little easier.

To do this, we will need to run the following two commands. The first will update the package list. The second command upgrades the installed packages.

sudo apt update
sudo apt upgrade

2. Next, we need to make sure that both “curl” and “apt-transport-https” packages are installed to our Raspberry Pi.

Without these, we won’t be able to set up the raspotify repository on Raspbian.

Run the following command to install our needed packages.

sudo apt install -y apt-transport-https curl

3. With the packages we need installed we can go ahead and add the “raspotify” GPG key and its repository.

Without the GPG key, the apt package manager won’t be able to verify the files it’s retrieving from the repository.

You can do these two things by running the following two commands.

curl -sSL | sudo apt-key add -v -
echo 'deb raspotify main' | sudo tee /etc/apt/sources.list.d/raspotify.list

4. Now that we have the raspotify repository added to our Raspberry Pi, we can now go ahead and install the raspotify package.

This package will handle turning our Raspberry Pi into a Spotify Connect device. We can install the package by running the two commands below.

We need to rerun the update due to us adding the raspotify repository in the previous step. Without an update, the package manager won’t know what’s contained in that repository.

sudo apt update
sudo apt install raspotify

5. With the “raspotify” software now installed, the software should start automatically and be ready for connections.

You should now be able to connect to your Raspberry Pi’s Spotify software. You can do this by opening up the Spotify app on your chosen device and selecting it from the “Connect to a device” menu.

Spotify App Connect to Raspberry Pi

Configuring the Spotify Connect Software

1. While the Raspotify software works perfectly fine right out of the box, you can make changes to its configuration.

You can use this configuration file to adjust things such as the bitrate or the device name.

Run the command below to begin modifying the “raspotify” config file.

sudo nano /etc/default/raspotify

2. Within this file, you will see multiple different options that you can configure yourself. We will go into a couple of these and explain what you can use them for.


This option defines the name for your Spotify connect service on the Raspberry Pi. You can set this to something to easier identify where the Raspberry Pi is or what the Pi is connected to.


With this option, you can specify the bitrate that you would like the device to utilize.

You can pick three different values for this option, 96 for low-quality, 160 for medium-quality or 320 for high-quality audio.

OPTIONS="--username <USERNAME> --password <PASSWORD>"

The “OPTIONS=” option allows you to specify additional options to pass through to the Spotify Connect software.

In our example, we will be passing in both a Spotify device username (<USERNAME>) and password (<PASSWORD>). By specifying these, you will be able to access the Raspberry Pi Spotify service outside the local network.

Please note that the username and password options are not what you use to log back into the account normally. You will need to retrieve these details by going to the “Set device password” screen on your Spotify account.

If the link above directs to your profile homepage and there is no option to set device password then simply enter your normal Spotify Username and password.

3. If you have made any changes, you can save the file by pressing CTRL + X then Y followed by ENTER.

4. Once you have made any changes to the raspotify configuration file, you will need to first restart the “raspotify” service by running the command below.

sudo systemctl restart raspotify

Hopefully, by now, you will now have successfully set up your headless Raspberry Pi Spotify device. It’s an excellent way to have a barebones audio player that can use any speaker that supports USB or a 3.5mm connection.

There are plenty of other media projects that you can do with the Raspberry Pi. I highly recommend checking out the Kodi media center if you’re after something that can do a little bit of everything.

If you run into trouble following this trouble or have  some feedback then please don’t hesitate to leave a comment below.


  1. Avatar for Aaron Rohrbacher
    Aaron Rohrbacher on

    I’m a pi newb, but a linux oldtimer. Just switched to raspberry pi OS from ubuntu 64 after experiencing the wretched wasteland that is ARM64 application development. And to think, I thought I knew everything! Anyway, this tutorial was the first smooth thing for me on a pi, and then so was your plex tutorial. And now I love you. Thank you.

  2. Avatar for Brendan
    Brendan on

    This is exactly what I was looking for to address multiple users in our house needing to interchangeably connect to limited set of speakers. Works seamlessly. Thank you.

  3. Avatar for James Larner
    James Larner on

    Just a hot tip: if you want to use the 3.5mm jack and there is no sound then disconnect the pi from the HDMI cable.

    Somehow even if you force the pi to use the jack it still wants to use HDMI.

    Works now GREAT! thanks!

  4. Avatar for msv
    msv on

    Works like A charm with old Raspberry Pi Model B rev 2.0

  5. Avatar for David
    David on

    I’ve installed it successfully but how to start the raspotify now?

    Best regards

    1. Avatar for Gus
      Gus on

      Hi David,

      You can start Raspotify by running the following command: sudo systemctl start raspotify

  6. Avatar for scott
    scott on

    Thanks! I have this running on 2 model 1 B’s flawlessly. This was exactly what I was looking for. Much appreciated.

  7. Avatar for Bartłomiej
    Bartłomiej on

    Works just perfect on —> Rpi4, now i only need to buy USB sound card !
    Thanks ! 🙂

  8. Avatar for Chuseto
    Chuseto on

    Hi! I’m very excited about this project!!! Thanks so much!!!
    But… I’ll love to play that on the mini-jack 3,5 mm.
    How can I choose that exit? Or how can I change the hdmi defoult to 3,5mm jack???
    Thanks so much!!

    1. Avatar for Chuseto
      Chuseto on

      Hi again, I’m just fix it, on global adjustments of Raspberry pi Config.
      Audio —- “Force jack output”
      Thanks so much for the project!!

  9. Avatar for Thien
    Thien on

    Work for me ! thank you !

  10. Avatar for Tyler Stevenson
    Tyler Stevenson on

    If I put it on a raspberry pi and not I don’t want to run it how to I remove it from the pi?

    1. Avatar for Emmet
      Emmet on

      Hi Tyler,

      You can remove the raspotify software from your device by running the following command.

      sudo apt remove raspotify


  11. Avatar for Lars Erik Larsen
    Lars Erik Larsen on

    Can it be playd over hdmi or is it just usb or 3.5mm jack?

    1. Avatar for Emmet
      Emmet on

      Hi Lars,

      This project should work over HDMI.


  12. Avatar for Nicolau Centola
    Nicolau Centola on

    Thanks a lot for the tutorial. I was looking for a Spotify solution for years! Just one question: do you know if it works on a RP 1 model B? Thanks in advance.

    1. Avatar for Emmet
      Emmet on

      Hi Nicolau,

      Yes this should still work with a Raspberry Pi 1.


  13. Avatar for MWalk
    MWalk on

    Can this download Spotify playlists like on a phone?
    Can it play local files (while the local source is available)?

    1. Avatar for Emmet
      Emmet on

      Hi Mwalk,

      Sadly not, this is basically just allowing Spotify to stream the audio from the device to the Raspberry Pi.

      It will not download, store or play files that are locally available.


  14. Avatar for Koen De Mulder
    Koen De Mulder on

    Works great! Thanks for clear instructions.

  15. Avatar for CyrX
    CyrX on

    Cool, pretty straight forward! Note, that only Spotify Premium users can cast audio on the raspotify device. Otherwise it appears grayed on the Spotify Android app.

Leave a Reply

Your email address will not be published. Required fields are marked *