Setting Up Your Own Personal Music Cloud with Ampache

So, I am taking a road trip across the country and I wanted a quick and easy way to access all my music from my media server at home. I also wanted the ability to cache my music for the flight or download it onto my Android phone prior to the flight. Utilizing my 4G phone I realized the best way to do this was to set up my own personal music cloud! Now there are many different services that do this:

  • Pandora.com, which is a music radio station that palys music base on likes. I really like this site.
  • Slacker.com, which is similar to Pandora.com
  • Google Music, which allows you to upload up to 5,000 songs(I think) of you music for free!
  • SubSonic, similar to Ampache that I’ll be using in this article.
  • Ampache, I played with this application a few years ago and liked how customizable it is and it uses Apache (which I have already installed.)

My set up:

  • Mediaserver with my Music running on Ubuntu 12.04 with LAMP
  • Android Phone with Amdroid
  1. Installing LAMP (Linux Apache Mysql PHP) on Ubuntu 12.04, see here for more details on LAMP.
    sudo apt-get install tasksel
    sudo tasksel install lamp-server
  2. Download dependencies
    sudo apt-get install flac faad lame php5-gd
  3. Create Mysql Database “ampacheDB” and MySQL database user “ampache_user”
    mysql -u root -p {your MySQL root password}

    Create the Database

    mysql> CREATE DATABASE ampacheDB;

    Create the user

    mysql> CREATE USER ampache_user;
    mysql> SET PASSWORD FOR ampache_user = PASSWORD("yourpassword");
    mysql> GRANT ALL PRIVILEGES ON ampacheDB.* TO ampache_user@localhost IDENTIFIED BY ‘yourpassword’
    mysql> FLUSH PRIVILEGES;
  4. Download, extract, and install the Ampache app.
     sudo mkdir /var/www/ampache
    wget http://ampache.org/downloads/ampache-3.5.4.tar.gz
    tar xzvf ampache-3.5.6.tar.gz
    sudo cp -R ampache-3.5.6/* /var/www/ampache/
  5. Navigate to http://{you_apache_server}/ampache and walk through the setup questions.
    ampache setup

    NOTICE: You may choose to check the box labeled “Overwrite Existing” since we already created the database.
  6. Log into Ampache, go to System Settings and Add Catalog. Fill out the text-field appropriate to your setup and click “Add Catalog”. This will take some time depending on how big of a catalog you have for music. My particular setup of 5,000 songs, took 15min for Ampache to catalog.
    ampache catalog setup
  7. Once finished you can test out your Ampache Music Cloud by creating a quick playlist and clicking Play!
    ampache playlistCool XSPF Flash Player.
    xspf player
  8. Now if your music collection contains anything higher than 192Kbs MP3s or FLAC files, you may want to consider having Ampache automatically transcode these files to a smaller bitrate. To do this open up the ampache.cfg.php file with vi. I assumed this at step 2 which is why I had you install flac faad and lame.
    sudo vi /var/www/ampache/config/ampache.cfg.php

    Find these lines and uncomment the file formats you would like to transcode. I choose to convert any m4a, flac, or ogg files I might have to mp3.

    ; List of filetypes to transcode
    transcode_m4a           = true
    transcode_m4a_target    = mp3 
    transcode_flac  = true
    transcode_flac_target   = mp3
    transcode_mp3          = false
    transcode_mp3_target    = mp3
    transcode_ogg           = true
    transcode_ogg_target    = mp3

    Now back in the Web gui is where you set the bitrate size for the target file format, MP3 in this case. Go to settings –> streaming
    ampache bitrate

  9. On your Android or iPhone device, download Amdroid or another Ampache client. I chose Amdroid because I found it the easiest to quickly start playing songs. Install it from the App Store.

    Then, configure it with your server information. Use the entire path to your ampache instance http://{your_server}/ampache

    Select some music!

    Play some music!

HAVE FUN!!

Sources:

Leave a Reply

↓