Skip to content

scufre/ampache-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ampache-docker

Docker image for Ampache, a web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.

How to use this image

This section covers two methods for running Ampache, first with the docker run command, and then using docker-compose.

docker run

To run the current Ampache master (stable) branch:

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

docker-compose

This method is recommended as it creates persistent volumes for important data and makes restarting the container much easier.

If you're already using Docker Desktop for Windows or Mac then Docker Compose is included. If you are using a different version or on Linux, follow these instructions in the docker docs: Install Docker Compose

In the GitHub repository is a simple docker-compose.yml file to get started. Download the file and run this command to start an Ampache container:

docker-compose up -d

This automatically creates the following bind mounts:

  • ./data/media mounted at /media for music
  • ./data/mysql mounted at /var/lib/mysql for persistent MySQL storage
  • ./data/config mounted at /var/www/config for persistent Ampache configuration
  • ./data/log mounted at /var/log/ampache for debug logs

Permissions

In the container the webserver runs as the http user (UID and GID 33). If you created the directories manually, it is important to ensure that the Ampache Configuration, and log directories are readable and writeable by that user.

chown 33:33 ./data/config -R
chown 33:33 ./data/log

Optionally, the media directory should be writable as if you wish to allow uploads.

chgrp 33 ./data/media && chmod g+w ./data/media

Image Variants

For more advanced users a few different image variants are available.

ampache:version

travis status

Recommended: Specifies a particular version from the Ampache master (stable) branch. Pinning Ampache to a specific version can prevent issues where you unexpectedly update a major version of Ampache with breaking changes you're not aware of.

Use something like Diun to monitor for updates to the image.

ampache:latest

travis status

Pulls the most recent image from the Master (stable) branch

ampache:develop

travis status

Pulls the most recent image from the Develop branch. This is generally safe to run but can break occasionally. Contains the latest features and updates.

The develop tag is set up to use git updates so you don't have to rebuild your images to stay up to date with development.

ampache:nosql

travis status

For advanced users, this provides an image without a MySQL server built-in. You must provide your own MySQL server.

ampache:nosql<version>

travis status

The nosql image pinned to a specific version.

Running on ARM

The automated builds for the official repo are now built for linux/amd64, linux/arm/v7 and linux/arm64.

Installation

  1. Open http://localhost/install.php and click Start Configuration, then Continue
  2. On the Insert Ampache Database page:
    1. MySQL Administrative Username: admin
    2. MySQL Administrative Password: (see container output)
      • The logs will show a line like: mysql -uadmin -pjnzYXLz7cMzq -h<host> -P<port>. The password is everything after -p, in this case jnzYXLz7cMzq.
    3. Check Create Database User
    4. Ampache Database User Password: Enter anything
    5. Click Insert Database
  3. Generate Configuration File page:
    1. Click Create Config
  4. Create Admin Account page:
    1. Enter anything for Username and Password
    2. Click Create Account
  5. Ampache Update page:
    1. Click Update Now!
    2. Click [Return to main page] to login using previously entered credentials

After installation you will need to setup a catalog. Make sure to use /media as the path where your media is located.

Themes

By default Ampache only ships with one theme built-in located at /var/www/public/themes/reborn. We want to avoid mounting the whole /themes directory otherwise the reborn theme will not be updated when the Amapche image updates. It's best to make a copy of the existing theme and then we can mount it in the /themes directory as a new theme.

Make sure that the container is already running then copy the current theme to a folder on the host:

docker run -d --name=ampache ampache/ampache
docker cp ampache:/var/www/public/themes/reborn ./data/new-theme
docker container stop ampache

Now make modifications to the theme and then start the container again this time mounting the new theme to the container:

docker run -d --name=ampache -v ./data/new-theme:/var/www/public/themes/new-theme

Thanks to

  • @ericfrederich for his original work
  • @velocity303 and @goldy for the other ampache-docker inspiration
  • @kuzi-moto for bringing the image out of the dark ages

About

Ampache docker package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.7%
  • Dockerfile 42.3%