MPD Setup

In this tutorial, we will see my setup for Music Player Daemon (MPD)

Installation

First install necessary packages (mpd and ncmpcpp).

For Arch based distro run following command in a terminal

sudo pacman -S mpd ncmpcpp

Setup

Create necessary directory and files. We will use ~/.config/mpd directory for mpd configration. Run following commands


mkdir -p ~/.config/mpd/playlists
touch ~/.config/mpd/database

Configuration

Create a file called mpd.conf inside ~/.config/mpd directory with following text

db_file                 "~/.config/mpd/database"
music_directory         "~/Music"
playlist_directory      "~/.config/mpd/playlists"

auto_update "yes"
bind_to_address         "127.0.0.1"
port                    "6600"
restore_paused          "yes"
max_output_buffer_size  "16384"

audio_output    {
        type            "pipewire"
        name            "Pipewire Sound Server"
}

Adjust music_directory value appropriately to point to the folder where you have your music files.

Start Server

We will use systemd. Use following command to start mpd at startup

systemctl --user enable mpd
systemctl --user start mpd

Client

Start ncmpcpp and press 1, 2, or 3 to view different layout for browsing the songs.

If you cannot see the audio files, make sure to restart your computer once.

Conclusion

Hopefully, this tutorial was helpful.

Leave a comment

Filed under Uncategorized

Leave a comment