How To Setup Your Own MusicBrainz Mirror (Ubuntu 12.04-12.10)

MusicbrainzlogoSince I’ve been rebuilding my server a bit recently, I figured I’d put the steps into a document.  There are a few good guides out there, but I always seemed to run into weird issues which weren’t covered.

This is more-or-less a “how to” guide (with information borrowed from a couple sources), albeit slightly tailored to how I have my servers setup.  I based it off a fresh Ubuntu 12.10 install, but it also worked on a fresh 12.04 install.  If you’re going to use an existing server, there may be parts of this that don’t apply (such as network configuration).

If you do end up trying, let me know how it goes and if I missed anything.

MusicBrainz Mirror Installation Guide (Ubuntu 12.04 – 12.10)


  1. Fantastic guide! Thank you very much! This ist the first one that really works (even with Ubuntu 13.1x).
    Is it correct, that if I use it just as replicating MB “clone”, I don’t need the Nginx part?

    Do you plan to write another wonderful installation guide for the MB Search Server too?

    1. Awesome, glad it worked.

      Yep, you can run it with plackup as your http server as well. I prefer nginx because of the amount of traffic I get and the extra flexibility it provides but plackup will definitely work.

      To be honest, I haven’t looked at setting up the MB Search Server. I’m not even entirely sure what it is but I can check it out.

      1. Just try to disconnect from Internet and do the (two) different search methods (indexed/non indexed). You will see that only the much slower one works without the Search Server at MB.

        For some (more private) projects, it would be great to have private Search Server too. Otherwise, every self programmed tool will hammer the official Search Server. This is a) not allowed and b) your IP will be banned very soon .-)

        It would be awesome, if you could write such a helpful instruction for the Search Server too.

  2. Hi, Im very new to this (but hey, who cant follow a guide right) Im just wondering with the editing of the is it just those three things I have to change… Or do I go though and edit any values that seem relivent?


  3. Thanks for that.

    I got to this part

    // Yanked from the
    // Build unaccent postgres module as root
    $ exit
    # cd ~musicbrainz/musicbrainz-server/postgresql-musicbrainz-unaccent
    # make
    # make install
    # cd ..
    // Build collate postgres module
    # cd postgresql-musicbrainz-collate
    # make
    # make install

    and nnow I’m getting this error… things were going so well.

    root@MusicBrainz:/home/musicbrainz/musicbrainz-server/postgresql-musicbrainz-unaccent# make
    Makefile:23: /usr/lib/postgresql/9.1/lib/pgxs/src/makefiles/ No such file or directory
    make: *** No rule to make target `/usr/lib/postgresql/9.1/lib/pgxs/src/makefiles/’. Stop.

    Any help?

    Thanks in advance.

  4. Hello,

    Thank you very much for your Setup instructions. Now, I have my own replication of musicbrainz running at home 🙂

    Just 2 problems I met during the installation

    1 ) I put “listen;” instead of “listen;” in the /etc/nginx/sites-available/001-musicbrainz file, because on the port 80, the message “Welcome to nginx!” was shown, and nothing on the port 5000

    2) The command “plackup -Ilib -r” failed with the message “Can’t locate Set/”

    Si I installed the module manually :

    Go to and search the termes “Set/”

    Grab the package link, then

    cd /tmp
    gzip -d Set-Scalar-1.29.tar.gz
    tar xvf Set-Scalar-1.29.tar
    cd Set-Scalar-1.29
    perl Makefile.PL
    make test
    make install

    1. Thanks!

      I think the 5000/80 port issue is because of the existing “default” conf file in /etc/nginx/sites-enabled which will bind to port 80 and give you the “Welcome to nginx!” message. I’ll make a note to remove it in the guide.

  5. First off, thanks for the excellent tutorial! I used it in 13.10 and it had been running well for several months. I just upgraded to Ubuntu 14.04 and I ran into the following problem.

    When I try to run I get this error:
    Perl API version v5.14.0 of List::Util does not match v5.18.0 at /usr/share/perl/5.18/ line 92.

    Obviously there’s now a Perl mismatch problem, but I don’t know where to begin in fixing this. Any help?

  6. Hello!
    Thanks for this nice guide. I just it together with the from the mb server source code. Got everything running fine, updates are coming in each hour and manual starting the server with plackup -Ilib -r is working smooth without any errors. I’m not using the nginx part of your tutorial.

    However, I can’t seem to get the script to work. Here is the script:
    (almost the same as yours but the exec — is now exec for ubuntu 14.04)

    After starting the server this is what the log produces: (log after start command)

    After stopping the server I got error:
    rm: cannot remove ‘/root/musicbrainz-server/’: No such file or directory
    Server stopped.

    If I now look at the log the server seems to get started with the stop command? And then stopped immediately after it: (log after stop command)

    Do you have any idea?

Leave a Reply

Your email address will not be published. Required fields are marked *