MCPSERV.CLUB
Audiobookshelf

Audiobookshelf

Self-Hosted

Self-hosted audiobook and podcast server

Active(100)
10.4kstars
0views
Updated 2 days ago

Overview

Discover what makes Audiobookshelf powerful

Audiobookshelf is a **self‑hosted** media streaming platform focused on audiobooks and podcasts. From a developer’s standpoint, it functions as an HTTP API server that ingests audio files, catalogs metadata, and streams content to web or mobile clients. It exposes a JSON‑based REST interface for CRUD operations on books, series, and playlists, while also providing WebSocket endpoints for real‑time playback events. The core goal is to deliver a lightweight, yet feature‑rich backend that can be embedded into larger media stacks or operated as a standalone service.

Metadata extraction

Playlist & queue management

User & role management

Streaming

Overview

Audiobookshelf is a self‑hosted media streaming platform focused on audiobooks and podcasts. From a developer’s standpoint, it functions as an HTTP API server that ingests audio files, catalogs metadata, and streams content to web or mobile clients. It exposes a JSON‑based REST interface for CRUD operations on books, series, and playlists, while also providing WebSocket endpoints for real‑time playback events. The core goal is to deliver a lightweight, yet feature‑rich backend that can be embedded into larger media stacks or operated as a standalone service.

Key Features

  • Metadata extraction: Parses ID3/MP4 tags and external JSON/YAML files to auto‑populate book details, authors, cover art, and chapter markers.
  • Playlist & queue management: API endpoints for creating, updating, and ordering playlists; supports shuffle, repeat, and cross‑fade.
  • User & role management: JWT‑based authentication with pluggable OAuth2 or LDAP backends.
  • Streaming: Adaptive bitrate support via HTTP Range requests; optional integration with a local transcoder for format conversion.
  • Analytics: Exposes playback statistics (time spent, completion rate) through a built‑in GraphQL endpoint.

Technical Stack

LayerTechnology
RuntimeNode.js (v20+) with TypeScript for type safety
FrameworkNestJS – a modular, MVC‑style framework that encourages clean separation of concerns
DatabasePostgreSQL (primary) for relational metadata; optional Redis cache for session tokens
SearchElasticSearch or Meilisearch for fast full‑text queries on titles, authors, and descriptions
ContainerizationDocker Compose definitions included; supports Kubernetes via Helm charts
CI/CDGitHub Actions with automated linting, unit tests, and image publishing to Docker Hub

The application follows a micro‑service‑like architecture within a single monorepo: the API server, background workers (for metadata extraction and transcoding), and a lightweight front‑end SPA served by the same Node process. This design simplifies deployment while keeping the codebase modular.

Core Capabilities & APIs

  • REST: /api/books, /api/series, /api/playlists – standard CRUD with pagination and filtering.
  • WebSocket: ws://host/api/stream – delivers playback progress, volume changes, and error notifications.
  • GraphQL: /graphql – flexible queries for nested data (e.g., book chapters with timestamps).
  • Webhook support: POST hooks on events such as book.uploaded or playlist.updated.
  • CLI: audiobookshelf-cli for bulk import, metadata refresh, and database migrations.

All endpoints are authenticated; the API server supports role‑based access control (admin, user) and can be extended with custom middleware for rate limiting or audit logging.

Deployment & Infrastructure

Audiobookshelf is designed to run on any Linux host with Docker. The official docker-compose.yml defines three services: the API, PostgreSQL, and a reverse‑proxy (Traefik). For production, it is recommended to:

  1. Run PostgreSQL in a separate container or managed service.
  2. Use TLS termination via Traefik with Let's Encrypt certificates.
  3. Persist media files on a dedicated NFS or cloud block storage volume.

Scalability is achieved by horizontally scaling the API layer behind a load balancer and using PostgreSQL read replicas. The background workers can be scaled independently to handle large ingestion workloads.

Integration & Extensibility

  • Plugin system: Developers can write Node modules that hook into lifecycle events (onBookUploaded, onPlaybackStarted). The plugin API is documented in the repo and can be loaded via a simple JSON config.
  • External APIs: Supports integration with Goodreads, Open Library, and Spotify for metadata enrichment.
  • Webhooks: Exposes a /webhook endpoint that can be consumed by external services (e.g., Slack notifications when a new series is added).
  • Custom UI: The front‑end is built with React; developers can fork the repo and replace components or add new pages without touching the API.

Developer Experience

  • Documentation: Comprehensive README, API reference (OpenAPI spec), and example payloads.
  • TypeScript types: All public interfaces are exported, enabling IDE autocompletion.
  • Community: Active GitHub Discussions and a Discord channel for real‑time support.
  • Testing: Built‑in Jest tests cover 90% of the codebase; developers can run npm test to validate changes.
  • Logging: Structured JSON logs with log levels configurable via environment variables.

Use Cases

  1. Personal Media Hub – A home server that aggregates all audiobooks and podcasts, accessible via a custom front‑end.
  2. Library Backend – A municipal library’s digital collection, exposing a self‑hosted API to its mobile app.
  3. Corporate Training – An internal platform for streaming training modules, with role‑based access and analytics.
  4. Podcast Network – A network of podcasters can host episodes on a shared server, using webhooks to trigger publishing workflows.

Advantages Over Alternatives

  • Open‑source & permissive license: No vendor lock‑in, fully modifiable.
  • Performance: Node.js + NestJS delivers low latency; HTTP Range requests enable efficient streaming.
  • **

Open SourceReady to get started?

Join the community and start self-hosting Audiobookshelf today