Spotify: how to listen from the Linux terminal with Librespot?

It is excellent that the Spotify music service is compatible with Linux with Snap, Flatpak and Ubuntu applications, but in general, the application is cumbersome and does not work well on Linux PCs with minimal resources. That's why Librespot has entered the scene so that users can listen to Spotify from the Linux terminal.

Install Librespot

The installation of Librespot requires the installation of several building time dependencies. So, before we can deal with the source code, it is vital to review how to get everything you need to compile.

The dependencies for Linux distributions differ slightly, so things may not work 100% of the time. For more information on the dependencies you will need, see the GitHub page for developers.

Debian / Ubuntu

On Debian and Ubuntu, users must install the "build-essential" package, the Rust programming language and the "libasound2-dev" package. You will also need Git to interact with the source code.

sudo apt install build-essential cargo libasound2-dev rust git

Fedora

Fedora users will need to install the »alsa-lib-devel» package, the «make» package, the «gcc» package and the Rust programming language. You will also need to install Git to interact with GitHub.

sudo dnf install alsa-lib-devel cargo make gcc rust git -y

Linux arch

There are quite a few dependencies to install in Arch Linux to build Librespot. However, luckily for you, the entire program is within the Arch Linux AUR, so no effort is necessary. You just have to follow the following commands to install the dependencies, as well as Librespot in Arch.

It is excellent that the Spotify music service is compatible with Linux with Snap, Flatpak and Ubuntu applications, but in general, the application is cumbersome and does not work well on Linux PCs with minimal resources. That's why Librespot has entered the scene so that users can listen to Spotify from the Linux terminal.

Install Librespot

The installation of Librespot requires the installation of several building time dependencies. So, before we can deal with the source code, it is vital to review how to get everything you need to compile.

The dependencies for Linux distributions differ slightly, so things may not work 100% of the time. For more information on the dependencies you will need, see the GitHub page for developers.

Debian / Ubuntu

On Debian and Ubuntu, users must install the "build-essential" package, the Rust programming language and the "libasound2-dev" package. You will also need Git to interact with the source code.

sudo apt install build-essential cargo libasound2-dev rust git

Fedora

Fedora users will need to install the »alsa-lib-devel» package, the «make» package, the «gcc» package and the Rust programming language. You will also need to install Git to interact with GitHub.

sudo dnf install alsa-lib-devel cargo make gcc rust git -y

Linux arch

There are quite a few dependencies to install in Arch Linux to build Librespot. However, luckily for you, the entire program is within the Arch Linux AUR, so no effort is necessary. You just have to follow the following commands to install the dependencies, as well as Librespot in Arch.

sudo chmod + x / usr / local / bin / librespot
sudo chmod 755 / opt / librespot /

You can then start the Librespot application from your terminal window with:

librepot

Use of Librespot

LibreSpot is not a terminal application in the sense that it has a full text-based user interface to use. However, it works with Spotify connect, so if your Linux PC cannot handle the amount of RAM that the official Spotify client needs, this is the best alternative, by far.

To use the Librespot application, start by taking out a smartphone and installing the Spotify application on it. Once the application is configured, log in to your Spotify account. Then follow the following step-by-step instructions to learn how to play music through Librespot.

1: Go to the Spotify application on your smartphone and press the search button to find an artist, playlist, album or song to listen to, and click on it to tell the Spotify application on your smartphone to start playing it.

2: Open the playback window at the bottom so that it appears full screen on your smartphone.

3: Pause the music of the application so that it does not play, but do not close the playback window.

4: Find a white icon in the lower left of the playback window of the Spotify application and paste it with your finger to open the “Spotify Connect” pop-up window. If you can't find the icon, it looks like the logo of a Smartphone / TV.

5: After touching the Spotify Connect icon, a new window will appear on your smartphone. This window says "Connect to a device" and shows a list of the devices enabled for Spotify Connect-.

6: In the «Connect to a device» window, click on the device called «Librespot».

7: Press the music play button that you previously stopped to listen to Spotify through the Linux terminal of your PC.