ncmpcpp++
ncmpcpp++ ↗️
Step-by-step Guide⚓︎
Step-by-Step Guide
This guide provides a step-by-step tutorial for setting up mpd, ncmpcpp, and mpc on Arch Linux for beginners. It covers installation, configuration, and basic usage. This video demonstrates installing mpd and ncmpcpp on Arch Linux:
ncmpcpp + mpd + mpc step-by-step tutorial for someone who has never attempted setting this up in Arch Linux
Step-by-stepTtutorial⚓︎
Step-by-step Tutorial
Setting up ncmpcpp, mpd, and mpc on Arch Linux for the first time can seem a bit daunting, but it's a very rewarding experience for a minimalist, powerful music setup. mpd (Music Player Daemon) is the backend server that plays your music, ncmpcpp is a powerful terminal-based client for mpd, and mpc is a simple command-line client used for quick actions and scripting.
Here's a step-by-step tutorial:
Prerequisites:
-
Arch Linux installed: You should have a working Arch Linux installation.
-
Basic terminal familiarity: You'll be using the command line extensively.
-
A directory for your music: Make sure you have a place where your music files are stored (e.g.,
~/Music).
Step 1: Install MPD, ncmpcpp, and mpc⚓︎
Install MPD, ncmpcpp, and mpc
First, let's install the necessary packages. These are available in the official Arch Linux repositories.
Video Resource:
For a general installation overview on Arch-based systems, you might find this helpful:
- ArchMerge : 206 installation of mpd and ncmpcpp and how to use it (Note: While titled for ArchMerge, the installation steps for MPD/ncmpcpp are largely similar for Arch Linux).
Step 2: Configure MPD (Music Player Daemon)⚓︎
Configure MPD (Music Player Daemon)
MPD needs to be configured to know where your music is, where to store its database, and how to output audio. It's generally recommended to run MPD as a user service.
1: Create MPD configuration directory and files:
- It's good practice to keep MPD's configuration and related files in
~/.config/mpd/.
mkdir -p ~/.config/mpd/playlists
mkdir -p ~/.local/state/mpd # Recommended for state_file
touch ~/.config/mpd/database
touch ~/.config/mpd/log
touch ~/.config/mpd/pid
touch ~/.config/mpd/state
touch ~/.config/mpd/sticker.sql
2: Copy the example configuration file:
MPD provides a good starting point for its configuration.
3: Edit mpd.conf:
Open the copied configuration file with your favorite text editor (e.g., nano, vim):
You'll need to modify or uncomment the following lines. Make sure to adjust paths to match your system.
music_directory: This is crucial. Point it to where your music files are.
Self-Correction: If your music is on an external drive or in multiple locations, you can use symbolic links within your music_directory and ensure follow_outside_symlinks is set to yes.
playlist_directory: Where MPD will save your playlists.
db_file: Path to the music database file.
log_file: Path to MPD's log file.
pid_file: Path to the process ID file.
state_file: Path to the file where MPD saves its state (e.g., current playlist, playback position).
sticker_file: Path to the sticker database.
bind_to_address: Unless you want MPD to be accessible from other machines on your network, keep it local.
or
port: The default is6600. You usually don't need to change this.
auto_update: This is very useful. MPD will automatically update its database when changes are detected in yourmusic_directory.
-
audio_output: This is where you configure how MPD outputs sound.- PulseAudio (recommended for desktop users):
If you are using PulseAudio (which is common on modern Linux desktops), this is the simplest way.
- ALSA (Alternative):
audio_output {
type "alsa"
name "My ALSA Output"
# device "hw:0,0" # Uncomment and adjust if you have issues with default ALSA device
# mixer_type "software" # Optional: Can help with volume control issues
}
If you prefer ALSA directly, use this block.
restore_paused: If you want MPD to resume playback where you left off.
Save and close the mpd.conf file.
Video Resource:
-
For a deeper dive into MPD configuration and why certain settings are chosen, consider watching: why I use music player daemon (mpd), + my config (This video provides a good conceptual overview, even if not exclusively Arch-focused for every command).
-
Another helpful guide on basic MPD setup on Arch: Easy MPD (Arch Linux)
4: Start and Enable MPD as a user service:
This ensures MPD starts automatically when you log in.
5: Update MPD's music database:
Now that MPD is running, tell it to scan your music directory.
This command can take some time if you have a large music collection. You won't see much output until it's done.
Why I use music player daemon (mpd), + my config:
Why I use MPD
Step 3: Configure ncmpcpp⚓︎
Configure ncmpcpp
ncmpcpp is the client you'll interact with most often. It has a rich set of features and is highly customizable.
1: Create ncmpcpp configuration directory and copy example config:
2: Edit ncmpcpp/config:
Open the configuration file:
At a minimum, ensure these lines match your MPD setup:
mpd_host: Should match yourmpd.conf.
mpd_port: Should match yourmpd.conf.
mpd_music_dir: This path is important for ncmpcpp to correctly display file paths and enable features like the tag editor. It must match themusic_directoryyou set inmpd.conf.
Optional (but highly recommended) ncmpcpp customizations:
-
Visualizer: To enable the audio visualizer (like a spectrum analyzer), you need to configure
MPDto output audio data to aFIFO(named pipe) and then tellncmpcppto read from it.- Edit
~/.config/mpd/mpd.confagain: Add thisaudio_outputblock in addition to your regular audio outputPulseAudio/ALSA:
- Edit
Save and restart MPD:⚓︎
Save and restart MPD
Then, edit ~/.config/ncmpcpp/config:
visualizer_data_source = "/tmp/mpd.fifo"
visualizer_output_name = "my_fifo"
visualizer_in_stereo = "yes"
visualizer_type = "spectrum" # Or "wave", "ellipse", "wave_filled"
visualizer_look = "+|" # Customize how the visualizer bars look
- Layout and Colors:
ncmpcppis extremely customizable.
Explore the ncmpcpp/config file for options like:
-
song_list_format: How songs are displayed in lists. -
now_playing_screen_artwork: For displaying album art (requires additional setup likecoverart-mpdormpd-coverandchafa). -
colors_enabled: Set toyesfor colored interface. -
progressbar_look: Customize the progress bar. -
lines_separator: Visual separators.
Save and close the ncmpcpp/config file.
Video Resource:
- For visual examples of ncmpcpp customization and specific features like the visualizer: How to configure mpd and ncmpcpp on Linux This link is to an article that also contains a video walkthrough that covers customization including the visualizer.
Easy MPD (Arch Linux)⚓︎
Easy MPD
Step 4: Using ncmpcpp and mpc⚓︎
Using ncmpcpp and mpc
-
Start ncmpcpp:
Simply type
ncmpcppin your terminal:-
Initial Database Scan: If you just updated the
MPDdatabase,ncmpcppmight show a progress bar at the bottom indicating the database update. Once it's done, you should see your music library. -
Navigation:
- Press
F1for a help screen with keybindings. 1to8(orF1toF8) switch between different views (playlist, browser, search, tag editor, etc.).u: Update database.j/kor arrow keys: Move up/down.spacebar: Play/pause.s: Stop.[/]: Volume down/up.add(orain browser view): Add selected item to playlist.p: Previous song.n: Next song.q: Quit ncmpcpp.
- Press
-
-
Using mpc (MPD client):
mpcis a command-line tool for quick control overMPD.-
Play/Pause:
-
Next song:
-
Previous song:
-
Set volume:
-
Show current song:
-
Update database:
-
List all commands:
-
Video Resource
Video Resource:
- For controlling music playback using
mpcand other tools, see: Control music playback - sxhkd, ncmpcpp, mpc and mpd (This video focuses on integratingmpcwith keyboard shortcuts, which is a common use case).
Troubleshooting Tips.⚓︎
Troubleshooting Tips
-
"Connection refused" error in
ncmpcpp:- Make sure
mpd.serviceis running:systemctl --user status mpd.service. - Check your
mpd_hostandmpd_portin~/.config/ncmpcpp/configandmpd.conf. They must match. - Ensure no other process is using port
6600(or whatever port you configured). You can check withss -tunelp | grep 6600.
- Make sure
-
No music appearing in
ncmpcpp:- Double-check your
music_directoryin~/.config/mpd/mpd.conf. - Make sure
mpd.servicehas write permissions to thedb_file,log_file, etc., and read permissions for yourmusic_directory. Since you're running it as a user service, this is usually not an issue, but worth checking. - Run
mpc updateagain.
- Double-check your
-
No sound:
- Verify your
audio_outputconfiguration inmpd.conf. - Ensure your sound system,
PulseAudio/ALSAis working correctly outside ofMPD. - Check
mpdlogs:journalctl --user -u mpd.service.
- Verify your
-
Visualizer not working:
- Did you add the
fifoaudio output block tompd.confand restartmpd.service? - Are the
visualizer_data_sourceandvisualizer_output_namecorrect inncmpcpp/config?
- Did you add the
Another Step-by-step Guide
This step-by-step guide, now with integrated video resources, should get you up and running with mpd, ncmpcpp, and mpc on your Arch Linux system. Enjoy your music.
Ncmpcpp: The Best MPD Client With The Worst Name⚓︎
Ncmpcpp
Control mpd and ncmpcpp like a pro!⚓︎
mpd and ncmpcpp