Giter VIP home page Giter VIP logo

ampache-docker's Introduction

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.

ampache-docker's People

Contributors

idelsink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ampache-docker's Issues

Setup ampache from git repo

Directly setup ampache using composer from the git repository. This way, changing versions is simple by just changing to another git hash.

Add a version that doesn't include MySQL

I already have my own MySQL instance, so I don't need one included inside this container. Maybe there could be ampache and ampache:mysql versions of the image.

Backup script point to wrong place for ampache.cfg.php

Backup script point to wrong place for ampache.cfg.php
I fixed it with vi, and then it runs smoothly.

The backup script (/scripts/backup.sh) states the wrong location (on line 6)

It wrongly states:
AMPACHE_CONF="${AMPACHE_DIR}/config/ampache.cfg.php"

It should run like this:
AMPACHE_CONF="${AMPACHE_DIR}/var/www/localhost/ampache/config/ampache.cfg.php"

Thank you for this awesome project!!!

Plex Backend Version

After installation:

Ampache
2 hours ago
0.9.9.13.525-197d5ed
Plex Media Server
Ampache
Linux (#1 SMP Debian 3.2.54-2)

but it not work, because the Web-App needs at least Plex Media Server 1.3.0.
How to update Plex Media Server?

Docker Compose Version Needed, Please

I have been using Your Ampache Docker for long.

If You can, please add a sample yml (Docker compose file) for this Ampache instance for Us commoners to start with. :)

Renan AKA BeGo

Is dos2unix really necessary?

I'm converting all the ampache files from windows line ending to unix line ending.
I did this a while ago to fix an issue.

Can I add this to the Dockerfile or just ignore this completely?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.