3 ways to use Spotify on your Raspberry Pi (even remotely)

raspberry pi spotify

If you like to listen to music at home, you can use your own Raspberry Pi as your personal stereo
In this post, I’ll show you how to play Spotify on Raspberry Pi

How to use Spotify on your Raspberry Pi?
There are a lot of methods to do this, but today I will show you my 3 favorite ways

  • Use Volumio, a dedicated music player for Raspberry Pi
  • Install Kodi as a media center and use the Spotify App
  • And finally, use MusicBox to play Spotify remotely and without screen

Let’s move directly to each solution

Play Spotify with Volumio

The first way is to use the Volumio music player

What is Volumio?

Volumio is a software dedicated to be a music player
You can play any file type with a good quality and use the web interface to manage it

It’s the perfect solution for a Raspberry Pi, as you can keep the Raspberry Pi in wireless, with a speaker on the jack port
Then you can use it as your home stereo, by controlling Volumio from your smartphone

Install Volumio on Raspberry Pi

The installation is straightforward
You need an available SD card, then follow this procedure:

  • Download Volumio from the official website
    Click on Download in the Raspberry Pi part
  • If needed, download and install Etcher from this website
    It’s a free tool to create SD card easily
  • Start Etcher, you’ll see something like this:
    etcher menu
  • On the left, choose the Volumio image file (no need to extract it)
    Then click on Flash!
  • After a few minutes, your SD card is ready

Insert the SD card in your Raspberry Pi and start it

Access the web interface

Everything can be managed from the web interface
If you have only Wifi available, there is an extra-step:

  • From your computer, connect to the Volumio Wifi network
    The password is: volumio2
  • A web page will open with a configuration wizard
  • Follow all the steps and enter your Wifi settings
  • At the end, switch back to your normal connection (probably automatic)

Anyway, you can now access to the web interface

  • Find your Raspberry Pi IP address (click on the link if you don’t know how)
    Basically, you can scan the network or check your Wifi access point
  • Enter this IP address in your browser: http://A.B.C.D
    For example: http://192.168.1.17
  • You’ll get something like that:
    volumio web interface
    That’s it you’re ready to move to the next step
    Remember that it’s also accessible from your smartphone, if you’re on the same network

Install & Play Spotify

The last step is to install Spotify

  • Go to the settings panel (the small wheel in the top right)
  • Click on Plugins
  • Then find Spotify in the list (the first one for me) and click on “Install”
  • A few seconds later, Spotify is installed

Then you need to active and configure the plugin

  • In the same page, click on “Installed plugins”
  • Enable Spotify by clicking on “Off”
    enable spotify volumio
  • Then click on Settings
  • Enter your login and password for Spotify, and save the configuration
  • Spotify is ready to use

Finally, go back to the Volumio home page
Click on “Browse” and scroll down to Spotify

You can now use Spotify on your Raspberry Pi and control it from your computer or smartphone

It’s working well, the installation is easy, and the interface is nice
I think I’ll keep the SD card somewhere 🙂

Play Spotify with Kodi

The second way to listen to Spotify on Raspberry Pi is to use Kodi

What is Kodi?

I already wrote a lot about Kodi on this blog
It’s a media center software, that runs on top of other systems like OSMC or LibreElec

In Kodi you can play any media
Today we’ll talk about Spotify, but you can also watch Netflix or YouTube on Kodi

Install Kodi

I already wrote a guide on how to install Kodi on your Raspberry Pi, so I will not repeat here

Take a new SD card, flash OSMC for example, and get started with your new media center solution

As soon as you finish the welcome wizard of OSMC, move to the next paragraph to install Spotify

Install the Spotify app

Enable SSH

If not already done, you need to have SSH working to send the repository file to your Raspberry Pi

  • Go into “My OSMC” > Settings
  • Click on SSH Server (stopped) and Apply to start it
  • Then connect with an SCP client like Filezilla or WinSCP
  • Once connected, created a new folder in the current directory
    For example “download”
    You’ll put all the files here later

Download and install the Spotify repository

Spotify is not available by default on Kodi
You need to add a new repository to do this

  • Download the repository zip file on this link: GitHub page
    In the Readme, there is a “Install with repository section”, click on the link to get the zip file
  • Upload this file to the download folder you just created (with Filezilla, WinSCP or other)
  • Back to OSMC, go to the Add-on browser (in Settings depending on your interface)
  • Choose “Install from zip file”
  • Then “Home Folder” and finally “download” (or the folder name you put the file into)
  • Select the corresponding zip file and click on it

The repository is now available to install new softwares on Kodi

Install and configure Spotify

The last step is to install Spotify from this repository

  • In the Add-on browser, this time select “Install from repository”
  • Click on “Marcelveldt’s BETA repository”
    marcelveldt's repository on kodi
  • Spotify is in the “Music Add-ons” category
  • Click on it, and then “Install”

After a few seconds, Spotify is installed, but you need to configure it
In the same window, click on “Configure” and enter your Username and Password

That’s it, Spotify is ready

Listen to Spotify

Finally, to play Spotify, choose “Music” from the main Menu
Then in Music Add-ons you’ll find Spotify and can do what you want in it

playing spotify in kodi

If you like this solution and want to learn more about Kodi on OSMC, I have two blog posts about it, feel free to read them:

If not, I have a last solution for you 🙂

Play Spotify with MusicBox

The last way I want to show you is to use a dedicated software: MusicBox

What is MusicBox?

MusicBox is a suite of tools, build on Raspbian, to create a music player for the main streaming services:

  • Spotify
  • SoundCloud
  • Google Music
  • Itunes Podcasts
  • etc …

It’s available as an image you can flash on an SD card and use directly

What I like about this solution is that you can control it via a web browser, so you can use your phone as a remote control
Plug a speaker on your Raspberry Pi and you have an always ready music player

Install MusicBox

To install MusicBox on your Raspberry Pi, take a free SD card and follow this procedure:

  • If needed, download and install Balena Etcher on your computer
    It’s a free tool to flash operating systems on SD card
  • Download the latest MusicBox release from GitHub
    Take the first zip file in the links list
  • Open Etcher, and flash the image on your SD card
    etcher menu
    Select the MusicBox image by clicking on the left button
    And the click on Flash! to start the SD card creation
  • After a few minutes, the process ends, and you can eject the SD card

Configure MusicBox

You can configure most of the settings from your web browser
But if needed (for example if you want to use your Raspberry Pi with WiFi), you can do it in a configuration before starting MusicBox

Configuration file

Before starting the Raspberry Pi with the fresh new SD card:

  • Re-insert the fresh new SD card in your computer
  • Find the SD card drive
  • Open the configuration file from the config folder: settings.ini
  • At the beginning of the file, you’ll find the network settings
    If you need to connect in WiFi, fill the file like this:
    network configuration on musicbox
  • Browse the file for other settings you want to change, for example:
    • enable_ssh to enable an SSH access on boot
    • Spotify parameters: if you want to insert your credentials and keys here (I’ll show you later how to get this)
    • And all the other streaming providers that you can enable or disable from here

Settings tab

If you don’t need Wi-Fi and prefer using the web interface to configure everything, it’s possible, just move on to the next paragraph

Listen to Spotify

To turn MusicBox into a Spotify player, there are another few things to do now

First boot

Insert the SD card in your Raspberry Pi and start it
It can take a few minutes on the first boot, be patient
(follow the next paragraph procedure during that time)

If needed the default login and password are:

  • Login: root
  • Password: musicbox

No need for a screen

If you have a screen and want to use the jack as the audio output, unplug the HDMI cable to make sure MusicBox will use the jack as the main output

In my case, I had no sound on first boot with my screen plugged
After a reboot without HDMI it was ok
And you don’t need a screen

Get your Spotify keys

To use Spotify with MusicBox, you need a premium account
You also need two keys from this URL: https://www.mopidy.com/authenticate/#spotify

get client id and secret from spotify

  • Click on “Log in with Spotify”
  • The credentials appear in the config section below (where the red boxes are)
  • Keep the page open, you’ll need this information later

Access the web interface

To access the web interface, you need to know the IP Address of the Raspberry Pi
If you don’t know how to do this, click on the link above to find how step-by-step

But you have several choices:

  • Plug a screen, log in and use the ifconfig command
  • Check your DHCP server for the new IP (in your Internet box probably)
  • Make a scan of your network

When you find it, open it in your browser: http://YOUR_IP
You should see the web interface of MusicBox
It’s working well on your phone if you prefer

web interface for musicbox

Before playing with this interface, we’ll move to the configuration part

Configuration

If you haven’t configured MusicBox yet from the settings.ini file, you need to do this from the web interface

  • Click on Settings to access all the MusicBox options
  • Feel free to browse all the settings, but in this tutorial I will stay focus on Spotify
  • Click on Spotify
  • Click Enable Spotify and fill your Username and Password
    Then enter your Client ID and Client Secret you got in a previous step
  • You should have something like that:
    spotify settings musicbox
  • Then save and reboot the Raspberry Pi
    It’s not mandatory to reboot, but for me it didn’t work until the reboot

Play Spotify

You are finally ready to play something from Spotify!

The Browse section is not working for me, but you can click on the Search tab from the Home page
Then enter a song title or album and click play

raspberry lips album
I don’t recommend this song, I’m just kidding 🙂

You can now listen to Spotify with your Raspberry Pi and control it from your phone
It’s really nice to use

Related Questions

Is there a way to play Spotify on Raspberry Pi for free? No, Spotify is a premium service, you need a paid account to use it. There is a free trial for 30 days if you want to try it, but that’s all

Why didn’t you use the web player? It was the easiest way a few years ago, but I didn’t make it work now, even with an user-agent switcher. Spotify seems to limit the usage to some systems and highly encourage to use their app

Conclusion

That’s it, you know 3 ways to install Spotify on your Raspberry Pi: Volumio, Kodi and MusicBox

The final choice is up to you, but for me I think Volumio is the best option if you only want to play music (with Spotify or other)

Let me know if you would like to get more details on Volumio or MusicBox, I can make a dedicated post with all the settings, tips, etc…

And you, which solution will you use to listen to Spotify on your Raspberry Pi?

Leave a Reply

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