Scripts2026年4月26日·1 分钟阅读

Ampache — Self-Hosted Music Streaming Server

Ampache is an open-source web-based audio and video streaming application written in PHP. It lets you host your music library on your own server and stream it from any browser or Subsonic-compatible app.

Introduction

Ampache has been a staple of self-hosted music streaming since 2001. It catalogs your audio and video files, organizes them with metadata, and streams them to your browser or any Subsonic/DAAP-compatible player on your phone, desktop, or smart speaker.

What Ampache Does

  • Catalogs and streams audio and video files from your server
  • Organizes music by artist, album, genre, year, and custom playlists
  • Provides a web player with queue management, shuffle, and repeat
  • Supports Subsonic and DAAP APIs for third-party mobile and desktop players
  • Manages multiple users with individual libraries, playlists, and access rights

Architecture Overview

Ampache is a PHP application backed by MySQL or MariaDB. It scans configured media directories to build a metadata catalog, pulling tags from files and optionally fetching album art and artist information. The web interface is server-rendered with JavaScript enhancements. Streaming is handled through direct HTTP delivery or on-the-fly transcoding using FFmpeg. The Subsonic and DAAP API endpoints allow any compatible client to connect as if it were a native streaming server.

Self-Hosting & Configuration

  • Deploy with Docker or install on any LAMP stack (Apache/Nginx + PHP + MySQL)
  • Point Ampache at one or more directories containing your music files
  • Run the catalog scanner to import metadata and generate the library
  • Configure transcoding profiles to convert FLAC or other formats on the fly for mobile streaming
  • Enable the Subsonic API to connect mobile apps like DSub, Ultrasonic, or play:Sub

Key Features

  • On-the-fly transcoding with configurable bitrate and codec settings
  • Multiple API interfaces: Ampache XML/JSON, Subsonic, DAAP, and WebDAV
  • Smart playlists based on genre, year, rating, play count, or custom rules
  • Album art fetching and metadata correction tools
  • Multi-user support with per-user catalogs and access controls

Comparison with Similar Tools

  • Navidrome — modern Go-based server with a clean UI; Ampache offers more configuration options and supports video alongside audio
  • Jellyfin — full media server for movies, TV, and music; Ampache is focused specifically on music with deeper library management
  • Plex — commercial media server with music support; Ampache is free, self-hosted, and does not require an account on an external service
  • Funkwhale — federated music platform with social features; Ampache is a traditional server-client model without federation
  • Koel — Laravel-based music streamer with a modern SPA interface; Ampache has a larger feature set and longer track record

FAQ

Q: What audio formats does Ampache support? A: Ampache reads any format that PHP and your media scanner can parse, including MP3, FLAC, OGG, AAC, WMA, and OPUS. FFmpeg-based transcoding can convert between formats on the fly.

Q: Can I use Ampache with my phone? A: Yes. Enable the Subsonic API and connect with any Subsonic-compatible app such as DSub (Android) or play:Sub (iOS).

Q: Does Ampache support podcasts? A: Yes. Ampache can subscribe to podcast RSS feeds, download episodes, and stream them through the web interface or API.

Q: How do I keep my library updated when I add new files? A: Schedule the catalog update command via cron, or trigger a scan manually from the web interface. Ampache detects new, modified, and deleted files.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产