Deploy Ampache
Self-hosted music and video streaming server with MariaDB, Subsonic API
MariaDB
Just deployed
/var/lib/mysql
Just deployed
/data
Deploy and Host Ampache on Railway
Ampache is an open-source web application for streaming your own music and video library. It indexes audio files into a browsable catalog with playlists, smart lists, ratings and multiple users, plays them in the browser, and serves them to mobile and desktop players through the Ampache, Subsonic and Jellyfin-compatible APIs.
About Hosting Ampache
Ampache is a PHP application that needs a web server, a MySQL-compatible database and persistent storage for its config file and your media. This template runs Ampache 8.4.0 from the official ampache/ampache image (built from our GitHub repo) with MariaDB 11.4 as a separate service on Railway's private network. On the first start it installs the database schema, creates the admin account with a generated password, creates a music catalog on the volume and enables web uploads into it. Config, backups and media live on a Railway volume, and Ampache applies database migrations on every start, so redeploys and updates keep your library.
Common Use Cases
- Stream your personal music collection to the browser and to Subsonic-compatible phone apps from anywhere
- Share a family or team music library with separate accounts, playlists and listening statistics
- Upload albums from the web UI and keep them organised in one self-hosted catalog
Dependencies for Ampache Hosting
- MariaDB (included as its own service, with a volume)
- A Railway volume for Ampache's config, backups and media
Deployment Dependencies
- Ampache: https://ampache.org and https://github.com/ampache/ampache (release 8.4.0)
- Official Docker image: https://hub.docker.com/r/ampache/ampache (tag
nosql8.4.0) - Template repo (Dockerfile, start scripts, changelog): https://github.com/aalfath/ampache-railway-template
Implementation Details
Services:
- Ampache: Apache and PHP 8.5, public HTTPS domain, health check on
/healthz, volume at/data(config,backup,media/music). An hourly cron runs Ampache's maintenance, and new files in/media/musicare added to the catalog automatically. - MariaDB: Ampache's database on the private network, volume at
/var/lib/mysql, generated passwords.
After deploy:
- Open the Ampache domain and log in as
adminwith theAMPACHE_ADMIN_PASSWORDvalue from the Ampache service's Variables tab. - Add music with Upload in the sidebar, or copy files into
/media/music(for example withrailway ssh). - In a Subsonic-compatible app, use
https://YOUR-DOMAINwith your Ampache username and password.
Tested with 0.5 GB RAM and 1 vCPU per service. Large libraries and transcoding need more. Optional settings (AMPACHE_ADMIN_EMAIL, PHP_MEMORY_LIMIT, APACHE_MAX_WORKERS) are described in the repo README.
Updates: when the template repo moves to a new Ampache version, Railway shows an "update available" notice in your project. Read the changelog, run backup-db.sh in the Ampache service shell (it writes a dump to /data/backup), then apply the update.
Why Deploy Ampache on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Ampache on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
MariaDB
mariadb:11.4.13