gobuz

sullen.net gobuz

A self-hosted web interface and downloader for Qobuz

0 31 pulls 4 Updated 12m
nightly Source
linux/amd64 linux/arm64 Multi-arch
docker pull seamark.cr/sullen.net/gobuz:nightly
Image Size Layers
14.6 MB 7
Pushed 12m
Vulnerabilities
Loading...
Pulls
31 total
Last pull 5m

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.26+ 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: tagged releases
  • nightly: latest commit on main

The container exposes port 8080, runs gobuz web --host 0.0.0.0 by default, and uses $XDG_CONFIG_HOME/gobuz (or $HOME/.config/gobuz if unset) for config.ini and gobuz.db.

docker run

docker run -d \
  --name gobuz \
  --user "$(id -u):$(id -g)" \
  -p 8080:8080 \
  -e XDG_CONFIG_HOME=/config \
  -e UMASK=0002 \
  -v /path/to/gobuz-config:/config/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
      UMASK: "0002"
      LOG_LEVEL: info
    volumes:
      - ./config:/config/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 -f Containerfile -t gobuz .

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>

# 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

Example:

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

Configuration

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

  • macOS: ~/Library/Application Support/gobuz/config.ini
  • Linux: ~/.config/gobuz/config.ini
  • Windows: %APPDATA%\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).

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)
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 (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)
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 (add, promote, demote, listenbrainz, gonic, lms, list)

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

Development

make build    # Compile binary
make test     # Run tests
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.