How To Run Spotify Music Player as a Flatpak App

Flatpak, originally created by Alexander Larsson, is a competing technology to the snap package format introduced by Canonical in Ubuntu 16.04. Flatpak is formerly known as xdg-app until May 2016. Both Flatpak and Snap claim to provide a safe sandbox environment to run applications.

The developers of Flatpak has a strong background and involvement in the Fedora and Gnome community. But now, this technology has ported to other Linux distributions like Ubuntu, Debian, Arch Linux.

This tutorial will show you how to install and run Spotify music player as a Flatpak app. The following steps were successfully tested on Fedora 23, Ubuntu 16.04, Debian 8 Jessie and Arch Linux.

Install flatpak and flatpak-builder

Fedora 23 and newer

flatpak is used to install packages whereas flatpak-builder is for building packages. ostree is a tool designed to handle trees of large binaries and is the core mechanism of Flatpak.

sudo dnf install flatpak flatpak-builder ostree

Ubuntu 16.04

sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak flatpak-builder ostree

Debian 8 Jessie

Install from sdk.gnome.org repository.

wget -O - https://sdk.gnome.org/apt/debian/conf/alexl.gpg.key | sudo apt-key add -

echo "deb [arch=amd64] https://sdk.gnome.org/apt/debian/ jessie main" | sudo tee -a /etc/apt/sources.list.d/flatpak.list

sudo apt install apt-transport-https

sudo apt update

sudo apt install flatpak flatpak-builder ostree

Arch Linux

The flatpak package contains both flatpak and flatpak-builder binary.

sudo pacman -S flatpak ostree

Building the Spotify Flatpak App

Download the Gnome SDK GPG key.

wget https://sdk.gnome.org/keys/gnome-sdk.gpg

Then add Gnome SDK repository. The following command will name the repository gnome.

flatpak --user remote-add --gpg-import=gnome-sdk.gpg gnome http://sdk.gnome.org/repo/

From the Gnome SDK repository, we install freedesktop.org SDK runtime for building the Spotify flatpak app.

flatpak --user install gnome org.freedesktop.Sdk 1.4

Install freedesktop.org Platform runtime for running the Spotify flatpak app.

flatpak --user install gnome org.freedesktop.Platform 1.4

The creator of flatpak, Alexander Larsson, created a Github repository for building the Spotify flatpak app. Clone the spotify-app repository from Github and cd to it.

git clone https://github.com/alexlarsson/spotify-app.git

cd spotify-app

Now build the Spotify Flatpak app.

make

It will download the Spotify deb file from Spotify repository, build the app and put the app into a local flatpak repository which will created in the current working directory. Once it’s done, add the local repository.

flatpak --user remote-add --no-gpg-verify local-spotify repo

Then install Spotify app from local repository.

flatpak --user install local-spotify com.spotify.Client

Now list installed apps.

flatpak list

spotify flatpak app

Then you can start it with:

flatpak run com.spotify.Client

Spotify Flatpak app running on Ubuntu 16.04

spotify flatpak app running on ubuntu 16.04

Spotify Flatpak App Running on Fedora 23

Spotify Flatpak App Running on Fedora 23

Spotify Flatpak App running on Debian 8 Jessie

Spotify Flatpak App running on Debian 8 Jessie

Spotify Flatpak App running on Arch Linux

Spotify Flatpak App running on Arch Linux

It is worth noting that this Spotify Flatpak app requires freedesktop.org runtime which will not guarantee that it can be used to run other Flatpak app.

Comments, questions and suggestions are always welcome. If you find this post useful, please subscribe to our free newsletter or follow us on Google+, Twitter or like our Facebook page.

Rate this tutorial
[Total: 2 Average: 5]

2 Responses to “How To Run Spotify Music Player as a Flatpak App

  • What is the advantage to running spotify as a flatpak app and can you do it on a mac?

    • Xiao Guoan (Admin)
      3 years ago

      Flatpak is a packaging format for Linux. Because of the fragmentation of the Linux platform, a software developer may need to release several different-formated packages for each Linux distro. Flatpak makes it easy for developers as Flatpak app can run on all mainstream Linux distros since they have Flatpak support.

      Mac does not have Flatpak support.

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here