Self-hosted web interface and downloader for Qobuz.
README.md

gobuz #

A self-hosted web interface, library browser, playlist manager, and downloader for Qobuz.

Requires a Qobuz account with an active subscription (and Go 1.27.4+ when building from source).

Containers (Docker / Podman) #

Multi-arch images (linux/amd64, linux/arm64) are published to atcr.io/sullen.net/gobuz:

  • latest / vX.Y.Z: stable tagged releases
  • vX.Y.Z-<prerelease>: prerelease tags (do not update latest)
  • nightly: latest commit on main

The container exposes port 8080, runs gobuz web --host 0.0.0.0 by default, uses $XDG_CONFIG_HOME/gobuz (or $HOME/.config/gobuz if unset) for config.ini and gobuz.db, and stores resized cover thumbnails under $XDG_CACHE_HOME/gobuz/thumbnails (or $HOME/.cache/gobuz/thumbnails if unset). When running as a non-root user, set both XDG_CONFIG_HOME and XDG_CACHE_HOME (or cache_dir in config.ini) to writable mounted paths.

docker run #

docker run -d \
  --name gobuz \
  --user "$(id -u):$(id -g)" \
  -p 8080:8080 \
  -e XDG_CONFIG_HOME=/config \
  -e XDG_CACHE_HOME=/cache \
  -e UMASK=0002 \
  -v /path/to/gobuz-config:/config/gobuz \
  -v /path/to/gobuz-cache:/cache/gobuz \
  -v /path/to/downloads:/downloads \
  -v /path/to/music:/music:ro \
  atcr.io/sullen.net/gobuz:latest

Compose #

services:
  gobuz:
    image: atcr.io/sullen.net/gobuz:latest
    container_name: gobuz
    restart: unless-stopped
    user: "1000:1000"
    ports:
      - "8080:8080"
    environment:
      XDG_CONFIG_HOME: /config
      XDG_CACHE_HOME: /cache
      UMASK: "0002"
      LOG_LEVEL: info
    volumes:
      - ./config:/config/gobuz
      - ./cache:/cache/gobuz
      - /path/to/downloads:/downloads
      - /path/to/music:/music:ro
      # Optional playlist sync directories (must be separate from music folders)
      # - /path/to/playlists/gonic:/playlists/gonic
      # - /path/to/playlists/lms:/playlists/lms

Create the initial admin account inside the running container:

docker exec -it gobuz gobuz user add --admin <username>

To build the image locally from source:

docker build -t gobuz .

Release binaries #

Static Linux release tarballs (linux/amd64, linux/arm64) and SHA256SUMS are published on the tags page:

tar -xzf gobuz-vX.Y.Z-linux-amd64.tar.gz
cd gobuz-vX.Y.Z-linux-amd64
./gobuz --version

Building from source #

git clone https://tangled.org/sullen.net/gobuz
cd gobuz
make build

This compiles the gobuz binary to the project root.

User management #

Manage web portal user accounts using the user subcommand. Passwords require a minimum of 12 characters.

Create an initial administrator account before signing into the web interface:

./gobuz user add --admin <username>

Additional user management commands:

# Add a regular user (prompts for password)
./gobuz user add <username>

# Update a user's password (prompts for new password and invalidates sessions)
./gobuz user password <username>

# Delete a user and their sessions, staged downloads, and playlists (--yes skips confirmation)
./gobuz user delete [--yes] <username>

# Change roles
./gobuz user promote <username>
./gobuz user demote <username>

# Link external services (omit value to clear)
./gobuz user listenbrainz <username> [lb_username]
./gobuz user gonic <username> [gonic_user_id]
./gobuz user lms <username> [true|false]

# List users
./gobuz user list
  • gonic maps a gobuz user to a Gonic user ID for per-user bidirectional .m3u playlist sync (each Gonic user ID can belong to one gobuz user).
  • lms designates the gobuz user whose playlists sync with Lyrion Music Server (at most one user).
  • listenbrainz associates a ListenBrainz handle with a gobuz user.

Running the web interface #

Start the server:

./gobuz

By default, the server binds to 127.0.0.1:8080. Sign in as an administrator in the web portal and click connect in the top banner to link your Qobuz account via OAuth (credentials are stored in gobuz.db).

Options:

  • --host: Bind address (default: 127.0.0.1)
  • --port: Port number (default: 8080)
  • --dev: Reload templates and static assets from disk on change
  • --debug: Enable debug logging and admin-only /debug diagnostic routes (/debug/runtime, /debug/pprof/*, and raw upstream JSON inspection)

Example:

./gobuz web --host 0.0.0.0 --port 8080

Configuration #

Optional runtime settings are loaded from config.ini (defaults are used when absent):

  • Linux: ~/.config/gobuz/config.ini
  • macOS: ~/Library/Application Support/gobuz/config.ini

If XDG_CONFIG_HOME is set to an absolute path, it takes precedence on all platforms ($XDG_CONFIG_HOME/gobuz/config.ini and $XDG_CONFIG_HOME/gobuz/gobuz.db).

Rebuildable resized cover thumbnails (thumbnails/, bounded to 128 MiB) are persisted under cache_dir when set, otherwise $XDG_CACHE_HOME/gobuz (if absolute) or the OS cache directory (~/.cache/gobuz on Linux, ~/Library/Caches/gobuz on macOS).

config.ini uses plain key = value lines (optional [section] headers and # or ; comments are ignored).

Downloads & library #

Setting Default Description
download_dir (none) Target directory for downloads (created automatically if absent)
aux_dir (none) Comma-separated additional library folders (path[:ro|:rw], defaults to :ro; must exist and be disjoint from download_dir)
cache_dir (OS cache dir) Directory for rebuildable cache files such as resized cover thumbnails (thumbnails/, bounded to 128 MiB)
default_quality 6 Requested audio quality tier (5, 6, 7, or 27)
workers 3 Concurrent track download workers per release
embed_art false Embed cover art directly into downloaded audio files
og_cover false Save full-resolution uncompressed cover art instead of standard 600px JPEG
folder_format {artist} - {album} ({year}) [{bit_depth}B-{sampling_rate}kHz] Release folder naming template (supports / subdirectories)
track_format {tracknumber}. {tracktitle} Track filename template (path separators are not allowed)

Integrations & playlists #

Setting Default Description
spotify_client_id (none) Spotify Web API client ID for importing public user playlists
spotify_client_secret (none) Spotify Web API client secret for importing public user playlists
gonic_url (none) Gonic (Subsonic) server base URL for automatic post-download library rescans
gonic_user (none) Gonic username for scan triggers
gonic_password (none) Gonic password for scan triggers
gonic_playlist_dir (none) Directory for bidirectional Gonic .m3u playlist sync (must be disjoint from music folders and lms_playlist_dir)
gonic_path_map (none) Optional local:remote path prefix mappings (comma/semicolon/newline-separated) when gobuz and Gonic mount music or playlist folders at different paths
lms_url (none) Lyrion Music Server base URL for automatic post-download library rescans
lms_user (none) Optional LMS username
lms_password (none) Optional LMS password
lms_playlist_dir (none) Directory for bidirectional LMS .m3u playlist sync (must be disjoint from music folders and gonic_playlist_dir)
lms_path_map (none) Optional local:remote path prefix mappings (comma/semicolon/newline-separated) when gobuz and LMS mount music or playlist folders at different paths
goosefoot_url (none) Goosefoot (Beets/MusicBrainz tagging companion) base URL
goosefoot_api_key (none) Optional bearer API key for Goosefoot
goosefoot_path_map (none) Optional local:remote path prefix mappings (comma/semicolon/newline-separated) when gobuz and Goosefoot mount music at different paths
harmony_url (none) Harmony instance base URL for release barcode lookup links

ListenBrainz playlist imports work without any API credentials. Spotify editorial and algorithmic playlists cannot be fetched with client-credentials tokens.

Diagnostics & endpoint overrides #

Setting Default Description
debug false Enable debug logging and admin-only /debug diagnostic routes (/debug/runtime, /debug/pprof/*, and raw upstream JSON inspection; equivalent to --debug)
qobuz_url (Qobuz default) Override Qobuz API base URL (used for devstub or custom proxies)
spotify_url (Spotify default) Override Spotify API/token base URL (used for devstub or custom proxies)

Quality levels #

Value Format
5 MP3 320 kbps
6 Lossless FLAC (16-bit / 44.1 kHz)
7 Hi-Res FLAC (up to 24-bit / 96 kHz)
27 Hi-Res FLAC (up to 24-bit / 192 kHz)

Downloader behavior & format placeholders #

  • Releases are staged in a hidden temporary directory inside download_dir, tagged with embedded Vorbis/ID3 metadata (QOBUZ_*, ISRC, UPC, REQUESTED_BY, and optional cover art), and atomically moved into the final release folder alongside cover.jpg and booklet.pdf (when available).
  • If a track is unavailable at the requested quality tier, the downloader automatically falls back through lower tiers (27 → 7 → 6 → 5).
  • Folder format (folder_format): {artist}, {album}, {year}, {bit_depth}, {sampling_rate}, {format}. Supports / subdirectories; for MP3 releases, templates referencing {bit_depth} or {sampling_rate} automatically fall back to {artist} - {album} ({year}) [MP3].
  • Track format (track_format): {tracknumber}, {tracktitle}, {artist}, {albumartist}, {bit_depth}, {sampling_rate}, {version}.

Environment variables #

Variable Default Description
XDG_CONFIG_HOME (OS config dir) Absolute path overriding the config and gobuz.db root ($XDG_CONFIG_HOME/gobuz)
XDG_CACHE_HOME (OS cache dir) Absolute path overriding the cache root ($XDG_CACHE_HOME/gobuz) when cache_dir is unset
UMASK (process default) Octal umask applied at startup for created files and directories (e.g. 0002)
LOG_LEVEL info (debug with --debug) Minimum log level: debug, info, warn, or error
FORCE_COLOR false Set to 1 or true to force ANSI color log output in non-TTY logs

Command-line options #

Usage: gobuz [options] <command> [args]

Commands:
  web           Start the web portal (default if no command given)
  user          Manage web portal user accounts (run 'gobuz user -h' for subcommands)

Options:
  -p, --purge   Clear cached library metadata
  -v, --version Print version and exit

Development #

make build    # Compile binary
make test     # Run tests with race detector
make bench    # Run benchmarks
make vet      # Run go vet
make dev      # Run devstub and server with live asset reloading
make devstub  # Run standalone devstub companion server
make clean    # Remove build artifacts

Credits #

Influenced by vitiko98/qobuz-dl, Aeneaj/qobuz-dl-go, and vicrodh/qbz.

License #

Licensed under the GNU General Public License v3.0.