# Self-host Ampache

> A web based audio and video streaming server with a library, playlists, users and a Subsonic compatible API, backed by MariaDB. Finish the install from the first page with the database details shown in the notes.

- Page: https://levelrail.com/templates/ampache/
- JSON: https://levelrail.com/templates/ampache.json
- Category: Media
- Licence: AGPL-3.0-or-later (Network copyleft (AGPL) license)
- Source: https://github.com/ampache/ampache
- Upstream docs: https://ampache.org/

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 8.4.0

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| ampache | ampache/ampache | 8.4.0 | 80 | config -> /var/www/html/config; media -> /media |
| db | mariadb | 11.8.9 | none | mariadb_data -> /var/lib/mysql |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | MYSQL_DATABASE | preset |
| db | MYSQL_ROOT_PASSWORD | generated |

## Deploy

### CLI

```bash
levelrail-cli templates install ampache --name my-ampache
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain ampache=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/ampache/install \
  -d '{
    "name": "my-ampache"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Open the page and run the installer with database host db, database ampache, user root and the generated root password, then create the admin.

## Questions

### Can I deploy Ampache on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id ampache for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image ampache/ampache:8.4.0, mariadb:11.8.9 is what you deploy there.

Self-host Ampache, Ampache docker compose file, deploy Ampache on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
