How to Install MPD on Linux Mint

MPD (Music Player Daemon) is a free and open-source server-side application that plays music in a client-server architecture. It is designed to be lightweight, flexible, and customizable. This tutorial explains how to install MPD on Linux Mint.

Prerequisites

Before starting the installation process, make sure you have the following:

Installation Process

The following steps explain how to install MPD on Linux Mint:

Step 1: Install Dependencies

MPD requires a few dependencies to be installed in order to function properly. Open the terminal and run the following command to install the required dependencies:

sudo apt-get install libmpdclient2 libmp3lame-dev libasound2-dev libflac-dev libvorbis-dev libopus-dev libcdio-paranoia-dev

This will install the necessary packages on your system.

Step 2: Download and Install MPD

You can download the latest version of MPD from the official website by running the following command:

wget https://www.musicpd.org/download/mpd/0.22/mpd-0.22.8.tar.xz

Extract the downloaded file using the following command:

tar -xf mpd-0.22.8.tar.xz

Now, navigate to the extracted directory using the following command:

cd mpd-0.22.8

Run the following commands to configure, compile, and install MPD:

./configure
make
sudo make install

This will configure, compile, and install MPD on your system.

Step 3: Create a Configuration File

Next, you need to create a configuration file for MPD. Run the following command to create a new configuration file:

sudo nano /etc/mpd.conf

Copy the following configuration into the file:

music_directory        "/var/lib/mpd/music"
playlist_directory     "/var/lib/mpd/playlists"
db_file                 "/var/lib/mpd/tag_cache"
log_file                "/var/log/mpd/mpd.log"
pid_file                "/run/mpd/mpd.pid"
state_file              "/var/lib/mpd/state"
sticker_file            "/var/lib/mpd/sticker.sql"
user                    "mpd"
bind_to_address         "localhost"
port                    "6600"

Save and exit the file.

Step 4: Create Required Directories

Now, you need to create the following directories and set the required permissions:

sudo mkdir -p /var/lib/mpd/music
sudo mkdir -p /var/lib/mpd/playlists
sudo chown -R mpd:audio /var/lib/mpd
sudo chmod -R 750 /var/lib/mpd
sudo mkdir -p /var/log/mpd
sudo touch /var/log/mpd/mpd.log
sudo chown -R mpd:audio /var/log/mpd
sudo chmod -R 750 /var/log/mpd
sudo mkdir -p /run/mpd
sudo chown -R mpd:audio /run/mpd
sudo chmod -R 750 /run/mpd

These commands will create the required directories and set the required permissions.

Step 5: Start MPD

Finally, start MPD by running the following command:

sudo systemctl start mpd

You can check the status of MPD by running the following command:

sudo systemctl status mpd

If everything is working properly, you should see the message "active (running)".

Conclusion

In this tutorial, you learned how to install MPD on Linux Mint. You can now use MPD to play music on your system. If you encounter any issues during the installation process or have any questions, feel free to ask for help in the comments section.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!