Skip to content

idelsink/ampache-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ampache Docker

Docker Automated buil
GitHub stars Docker Stars Docker Pulls

An docker image with the Ampache music server.

See: hub.docker.com/r/idelsink/ampache

Usage

docker run --name=ampache -d -v /path/to/your/music:/media:ro -p 80:80 idelsink/ampache

There are extra ports that can be passed to the container using the -p flag. The ports are:

  • 80: http: ampache
  • 443: (not used but https for the future)
  • 9001: supervisord web UI (used to manage services)
  • 32400: plex interface (see See Plex backend)

Installation summary

  • Get MySQL root password (Found in terminal or in a file in the /root directory in the container)
  • Launch website (<url/ip> or localhost)
  • Fill in obtained root credentials
  • Add new database user
  • Installation type: whatever you like
  • Transcoding: Template Configuration => ffmpeg
  • Players: do whatever you like (See Available Players)
  • Create config
  • Create admin account
  • Update
  • And you're done!
  • Now just add your catalog(s) end configure it like you want it.

Installation

After starting the docker image as a daemon process, look at the logs for the pseudo-random generated MySQL root password.

docker logs ampache
# or for tailing the log file
docker logs -f ampache

The output would look something like this:

~~ Configuring system if not yet configured ~~
~~ Configuring supervisord ~~
~~ Configuring apache ~~
~~ Configuring mysql ~~
=> An empty or uninitialized MySQL volume is detected in /var/lib/mysql
=> Installing MySQL ...
=> Done!
=> Trying to secure database
=> Starting MySQL service
=> Waiting for confirmation of MySQL service startup
=> Databse is less vulnerable now; Stopping MySQL service

========================================================================
Random generated password for root is:
'MhKtpfjCHUzhT0vR51Sgu2iCuxlr3P97qo4D2A8jdRsOzaGsuV89nGfAEPF6qNKOIyY4FMawNJF86zOKLdg1eTykpr2vXED3wfrj
'
You can now connect to this MySQL Server using:

    mysql -uroot -p<password> -h<host> -P<port>

Change the above password if deemed necessary.
MySQL user 'root' only allows local connections.
========================================================================

~~ Configuring ampache ~~
=> Unzip ampache archive
~~ Starting the service manager supervisord ~~

Follow the rest of the steps from the installation summary.

Plex backend

To setup the Plex backend do the following:

  • Pass an extra port parameter while starting docker for the Plex backend pointing to port 32400.
    For example add -p 32400:32400 to the docker run command.
  • If not already done so during the Ampache setup process, enable the Plex backend at System > Use Plex backend > Enable
  • Manually go to the login.php page at http://[ip]:[plex port]/web/login.php
  • Login with an Ampache account
  • After login this page will NOT forward you to another page.
  • Manually go to the index.php page at http://[ip]:[plex port]/web/index.php
  • Link Ampache to an existing Plex account.
  • Setup port forwarding if applicable.
  • Now use the official or any Plex application to browse/play your content. (tested with the official Plex application on Android 6.0.1)

Available Players

Ampache is more than only a web interface. Several backends are implemented to ensure you can stream your media from anywhere. Select backends to enable. Depending the backend, you may need to perform additional configuration. See wiki page.

Players tested:

  • Web interface
  • Ampache API
  • Subsonic
  • Plex
  • UPnP
  • DAAP (iTunes)
  • WebDAV

Update

To update to the newest docker image, if necessary, a backup can be made. This is done by running a small script inside the docker container. This will backup the database and Ampache configuration.

Backup / restore configurations

Follow these steps to perform a backup of Ampache. Follow Steps 8 to (end) to restore a backup of Ampache.

  1. Find your docker name / ID
docker ps
  1. Connect to the running container
docker exec -it <ID or name> sh
  1. Run the backup script (inside the container)
mkdir /backup
/scripts/backup.sh b /backup
  1. Follow the instructions

  2. Exit the docker container

exit
  1. Copy the files from the container to the host
docker cp <ID or name>:/backup ./backup
  1. Update to the new/other container and let it finish configuring

  2. Copy the files from host to container

docker cp ./backup <ID or name>:/backup
  1. Restore the backup using the backup script
/scripts/backup.sh r /backup
  1. Follow the instructions

Exit the container and you're done.

Some extra notes

  • The MySQL root password can be found in the /root directory.
  • Make sure that your volume is mounted correctly, e.g. if using SELinux make sure to add the appropriate permission labels. (See this)
  • Make sure not to use a port that is already used by another webserver/process.

Image stack

License

You can check out the full license here

This project is licensed under the terms of the MIT license.