Technology
 

Install

From Music Player Daemon Community Wiki

Installing from source should work for all *nix distributions. In many cases it is better to go below to look for specific installation instructions for your distribution if you're in a *nix distribution.

Contents

[edit] General Installing From Source

  • First check that you have all the dependencies that you want from Dependencies
  • Retrieving the sources
    • First, do you want to install from the latest development sources? If so, follow the guide.
    • Otherwise you can download the latest sources
  • Follow the procedure at linuxquestions.org going straight to the ./configure step if you downloaded from subversion. A hint that that link doesn't give is there are specific options that you can look through by typing ./configure --help, then adding those to your ./configure will make your MPD turn out differently, although the defaults will do just fine.

[edit] Debian Install Procedure

If you are using any of the following Debian distributions:

  • Sarge
  • Etch (oldstable)
  • Lenny (stable)
  • Squeeze (testing)
  • Sid (unstable)

... then simply do:

aptitude update
aptitude install mpd

[edit] Ubuntu Install Procedure

  • First, edit /etc/apt/sources.list and enable the 'universe' repository. After you make this change, you will have to run apt-get update.
  • You can use Synaptic. If for some reason this installation fails, this howto on the Ubuntu Forums may help.
aptitude update  
aptitude install mpd

[edit] Gentoo Install Procedure

To install from the mpd-portage overlay see the mpd-overlay guide.

  • Check that you have all the USE flags you want supported for MPD, for questions about specific dependencies see the Dependencies page.
  • Install MPD:
# emerge mpd
  • Edit the /etc/mpd.conf file as a superuser:
# {your text editor here} /etc/mpd.conf


    • The log files you specified in /etc/mpd.conf must exist before running MPD.
      • The log files must also have the permissions set so that they can be edited by the default user (normally user: mpd).


    • Put your music/playlists in the directories defined in /etc/mpd.conf (symlinks are fine).


    • Setup MPD to start in the init scripts:
# rc-update add mpd default
  • Create the MPD database:
# /usr/bin/mpd --create-db
  • Finally start MPD:
# /etc/init.d/mpd start

[edit] Arch Linux Install Procedure

  • Sync and install with pacman
pacman -Sy mpd
  • Configure MPD.
cp /etc/mpd.conf.example /etc/mpd.conf 
{your editor} /etc/mpd.conf
  • Create these two directories if they don't exist: ~/.mpd and ~/.mpd/playlists
mkdir -p ~/.mpd/playlists
  • Create the MPD database (this can take a while depending on the size of your collection):
/etc/rc.d/mpd create-db
  • Start MPD
/etc/rc.d/mpd start
  • Install a client - this will give you every client in pacman
pacman -Sy ncmpc mpc gmpc glurp sonata

[edit] Fedora Install Procedure

# yum install mpd

or

# apt-get install mpd

if you prefer apt.

  • Edit the /etc/mpd.conf file as a superuser:
# {your text editor here} /etc/mpd.conf
  • Create the MPD database:
# mpd --create-db
  • Finally start MPD:
# service mpd start
  • Make it come on when you reboot:
# chkconfig mpd on
  • The clients (mpc, nmpc,gmpc, sonata, xfmpc, xfce4-mpc-plugin, gimmix, pympdtouchgui) are available from fedora (official repo). Install them with:
# yum install mpc

Substitute "mpc" in the command above with the client you want.

[edit] Mandrake Install Procedure

  • MPD is available through urpmi, to install:
urpmi mpd

[edit] FreeBSD Install Procedure

[edit] Installing with Ports

    • you may need to update your ports tree (use CVSup, see the FreeBSD handbook)
    • make sure internet works, or put the source file in /usr/ports/distfiles
    • if portupgrade is installed
portinstall musicpd

otherwise

cd /usr/ports/audio/musicpd 
make install clean



      • note: if you want support for AAC or MOD files, then put WITH_AAC=true and WITH_MOD=true in /etc/make.conf before you compile

[edit] Installing with Packages

  • you may need to set some options, otherwise you will probably get an outdated MPD release (see the FreeBSD handbook)
  • make sure internet works, then do a
pkg_add -r musicpd
pkg_add /path/to/package.tgz

[edit] Configure MPD

  • for general configuration: edit /usr/local/etc/mpd.conf (see Configuration for details)
  • to start MPD at boot time: edit /etc/rc.conf and include musicpd_enable=YES
  • initial database creation:
/usr/local/bin/mpd --create-db /usr/local/etc/mpd.conf

[edit] Kernel compilers beware

  • MPD needs System V shared memory; make sure 'SYSVSHM' is included in your kernel!

[edit] Mac OS X 10.3, 10.4 Install Procedure

See the osx page for details.

[edit] NetBSD Install Procedure

  • First select all the dependencies that you want from Dependencies and put the appropriate indications in the PKG_OPTIONS.musicpd variable. Possibilities are: aac, audiofile, flac, iconv, id3, and ogg.
  • install MPD through pkgsrc
    • you may need to update your pkgsrc tree (2004Q2 and up have it) (see the documentation for more information on updating)
cd /usr/pkgsrc/audio/musicpd 
make install
  • configure MPD:
    • for general configuration edit /usr/pkg/etc/mpd.conf (see Configuration for details) (example is in /usr/pkg/share/examples/mpd/mpd.conf)
    • initial database creation:
/usr/pkg/bin/mpd --create-db /usr/pkg/etc/mpd.conf

[edit] SPARC/SPARC64 notes

Since libmad is integer only, performance isn't the best on NetBSD/sparc{,64}. In case you don't want MPD to use 15% CPU on a 440 MHz UltraSPARC-IIi, you might consider adding these lines to your /usr/pkgsrc/audio/libmad/Makefile:

CONFIGURE_ARGS+= --enable-fpm=sparc 
CONFIGURE_ARGS+= --enable-speed

and then run

cd /usr/pkgsrc/audio/libmad 
make clean all replace

[edit] OpenBSD Install Procedure

These are the configure script flags I found helpful for getting mpd running on Openbsd 3.8 i386.

MPD 0.11:

  • ./configure --with-ao-includes=/usr/local/include --with-ao=/usr/local/lib --disable-ipv6

MPD 0.12:

  • ./configure --enable-ao --with-ao-includes=/usr/local/include --with-ao=/usr/local/lib

[edit] Windows Install Procedure

This may not work yet, but if it does the instructions are at Windows Compatibility

[edit] OpenWRT Install procedure

Full details on how to setup mpd and phpMp2 on OpenWRT are available here


[edit] Software Appliance Availability

If you have a spare machine (virtual or real) and you don't want to deal with configuration and setup yourself, there is a software appliance based on MusicPD available at http://www.rpath.org/rbuilder/project/musicpd/ -- it's currently shipped as a VMware virtual machine image, and comes with a minimal version of rPath Linux, MusicPD installed and configured, phpMp, and the beginnings of a web-based configuration tool. It also supports music shares over NFS and Samba. Word of warning: the appliance does not include MP3 support.