Install Spotify on Linux Command Line

This tutorial intends to show you how to Install Spotify on the Linux Command Line. As you must know, Spotify is a great and popular music streaming platform. It can be also installed on Linux distros by using the Snap. In Debian-based distros, Spotify can be installed with a Deb package too. Also, you can use Spotify for free with ads or you can purchase an account to access all the features.

Now you can follow the steps below to start your Spotify installation from the Linux terminal and start using it.

Steps To Install Spotify on Linux from the Command Line

To complete this guide, you must have access to your server as a non-root user with sudo privileges and follow the steps below. You can visit the Orcacore website and check for the Linux initial server setup guides.

Step 1 – Install Snapd Package on Linux

By using the snpad package, you can easily install Spotify on Linux distros. Let’s see how to install Snapd on Linux distros.

Snapd installation on Ubuntu / Debian

You can run the system update and use the command below to install the snapd package on Debian-based distros:

# sudo apt update
# sudo apt install snapd

Snapd installation on AlmaLinux / Rocky Linux / RHEL

On RHEL-based distros like Rocky Linux and AlmaLinux, you can use the following commands to install Snapd:

# sudo dnf update -y
# sudo dnf install epel-release -y
# sudo dnf install snapd -y
# sudo ln -s /var/lib/snapd/snap /snap
# sudo systemctl enable --now snapd.socket

Step 2 – Find Spotify Package with Snap in Linux

At this point, you can search for the Spotify package through the snapd package with the command below:

sudo snap find spotify

In your output, you will see:

Output
Name           Version               Publisher               Notes  Summary
spotify        1.2.13.661.ga588f749  spotify✓                -      Music for everyone
spotify-qt     v3.10                 kraxarn                 -      Lightweight Spotify client using Qt
spt-temp       v0.15.0-7-g3501ca9    spotify-tui             -      Spotify TUI
music-radar    0+git.4e4b5aa         keshavnrj✪              -      Music Recognition app for Linux Desktop
olivia         1.2                   keshavnrj✪              -      Elegant Clou

Step 3 – Spotify Installation via Linux Command Line Terminal

When you have found your package, you can easily use the following snap command to install Spotify:

sudo snap install spotify

When it is completed, you will get the following output:

Output
spotify 1.2.13.661.ga588f749 from Spotify✓ installed

Step 4 – Run Spotify in the Linux Command Line Terminal

At this point, you can easily search for Spotify from your Linux desktop and run it. Or you can simply run it from the Linux command line:

spotify

To sign in automatically to your Spotify account, you can use the following commands:

# spotify --username [email protected]
# spotify --username [email protected] --password 'yourpassword'

You can start the Spotify client with the  given URI when initialized or with the specified URL:

# spotify--uri=<uri>
# spotify--url=<url>
Spotify for everyone

Step 5 – Update Spotify on the Linux Terminal

All the snap packages are updated automatically. But you can also use the command below to update the Spotify package:

sudo snap refresh spotify

Step 6 – Uninstall the Spotify App on Linux

If you no longer want to use Spotify, you can easily remove it from the terminal with the following command:

sudo snap remove spotify

This will remove all the data and the common data directory.

Output
spotify removed

Step 7 – Install Spotify with Deb Package on Debian / Ubuntu

If you are a Debian or Ubuntu LTS user, you can use the Deb package to install Spotify. To do this, you need to add the Spotify repository on Ubuntu / Debian with the commands below:

# curl -sS https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg

# echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list

Then, run the system update and install the Spotify client with the following commands:

# sudo apt update 
# sudo apt install spotify-client

Next, you can run it from your Linux desktop.

If you plan to remove the package, you can use the command below:

sudo apt remove spotify-client

Conclusion

At this point, you have learned to Install the popular music streaming app called Spotify on Linux from the Command Line terminal by using the snapd package. Also, in Debian-based distros, you can use the Deb package to install Spotify. Then, you can easily run and start using Spotify for free or upgrade it by purchasing an account.

Hope you enjoy using it. You may be interested in these articles:

Using the fd command in Linux Examples

Top 5 Alternatives To Apache HTTP Server on Linux

Make a POST Request With cURL

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!