Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Install Spotify

Below are various ways you can install a client to install Spotify music. This is order of my preference.

From Deb Pakage

Run the following to install Spotify.

Ubuntu 22.04 And Newer

KEY_URL=""  \
  && curl -fsSL $KEY_URL | sudo gpg --dearmor -o /usr/share/keyrings/spotify.gpg \
  && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/spotify.gpg] stable non-free" \
  | sudo tee /etc/apt/sources.list.d/sublime-text.list \
  && sudo apt update \
  && sudo apt install spotify-client -y

Ubuntu 20.04 And Older

KEY_URL="" \
  && curl -sS $KEY_URL | sudo apt-key add - \
  && echo "deb stable non-free" \
  | sudo tee /etc/apt/sources.list.d/spotify.list \
  && sudo apt update \
  && sudo apt install spotify-client -y

Possible Issues (Intel Graphics)

When I installed Spotify this way, the player would not let me play music, and tell me to disable "offline mode", which it wasn't in. Also, when I launched Spotify from the CLI, I would get this error message on startup.

libva error: /usr/lib/x86_64-linux-gnu/dri/ init failed

In the end, I was unable to fix this issue, and ended up using the Nuvola solution. However, after physically installing an Nvidia graphics card, and installing the nvidia drivers, this problem "went away".

Nuvola (Flatpak)

Nuvola is a lightweight desktop application for streaming web-based media, which includes Spotify. Unfortunately it is not in active development anymore, but I found that it works and does the job, and unlike other third-party solutions such as Clementine, Spot, and ncspot, it works even if you don't have a Spotify premium account.

Run the following command to install the Spotify Nuvoloa application. This will add the relevant repositories before then installing the flatpak.

flatpak remote-add --if-not-exists flathub \
  && flatpak remote-add --if-not-exists nuvola \
  && sudo flatpak update \
  && flatpak install nuvola eu.tiliado.NuvolaAppSpotify

This client "just works" and unlike the official spotify snap package, if you re-launch it from your launcher, it will re-open your existing instance, rather than launching a new one that won't work.

Snap Package

This is the easiest way to install Spotify. However, it is annoying that if you launch spotify again from your launcher, it will bring up a new instance that won't work, instead of re-opening your existing instance. I also just hate snaps, and find them slow and buggy.

snap install spotify


Last updated: 26th February 2023
First published: 30th July 2022