Skip to content
Senan Kelly edited this page Dec 15, 2023 · 11 revisions

Note

the default login is admin / admin and should be changed shortly after logging in ⚠️

from source

$ apt install build-essential git sqlite libtag1-dev ffmpeg mpv # for debian like
$ pacman -S base-devel git sqlite taglib ffmpeg mpv             # for arch like
$ go install go.senan.xyz/gonic/cmd/gonic@latest
$ export PATH=$PATH:$HOME/go/bin
$ gonic -h # or see "configuration options below"

note:

  • mpv is only required if you want jukebox mode
  • ffmpeg is only required if you want to transcode audio

note: unfortunately if you do this above, you'll be compiling gonic locally on your machine (if someone knows how I can statically link sqlite3 and taglib, please let me know so I can distribute static binaries)

with docker

the image is available on dockerhub as sentriz/gonic

use the :latest tag for the latest stable release, or :nightly for the experimental nightly builds from master

available architectures are

  • linux/amd64
  • linux/arm/v6
  • linux/arm/v7
  • linux/arm64
# example docker-compose.yml

version: "2.4"
services:
  gonic:
    image: sentriz/gonic:latest
    environment:
      - TZ
      # optionally, see more available env vars in the readme
    ports:
      - 4747:80
    volumes:
      - ./data:/data # gonic db etc
      - /path/to/music:/music:ro # your music
      - /path/to/podcasts:/podcasts # your podcasts
      - /path/to/playlists:/playlists # your playlists
      - /path/to/cache:/cache # transcode / covers / etc cache dir

    # set the following two sections if you've enabled jukebox
    group_add:
      - audio
    devices:
      - /dev/snd:/dev/snd

then start with docker-compose up -d

with systemd

tested on Ubuntu 21.04

  1. install go 1.21 or newer, check version, and install dependencies
$ sudo apt update
$ sudo apt install golang

$ go version
go version go1.21 linux/amd64

$ sudo apt install build-essential git sqlite libtag1-dev ffmpeg mpv

note:

  • mpv is only required if you want jukebox mode
  • ffmpeg is only required if you want to transcode audio
  1. install / compile gonic globally, and check version
$ sudo GOBIN=/usr/local/bin go install go.senan.xyz/gonic/cmd/gonic@latest

$ gonic -version
v0.14.0
  1. add a gonic user, create a data directory, and install a config file
$ sudo adduser --system --no-create-home --group gonic
$ sudo mkdir -p /var/lib/gonic/ /etc/gonic/
$ sudo chown -R gonic:gonic /var/lib/gonic/
$ sudo wget https://raw.githubusercontent.com/sentriz/gonic/master/contrib/config -O /etc/gonic/config
  1. update the config with your music-path, podcast-path, etc
$ sudo nano /etc/gonic/config
music-path        <path to your music dir>
podcast-path      <path to your podcasts dir>
cache-path        <path to cache dir>
  1. install the systemd service, check status or logs
$ sudo wget https://raw.githubusercontent.com/sentriz/gonic/master/contrib/gonic.service -O /etc/systemd/system/gonic.service
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now gonic

$ systemctl status gonic            # check status, should be active (running)
$ journalctl --follow --unit gonic  # check logs

should be installed and running on boot now 👍
view the admin UI at http://localhost:4747

elsewhere

Clone this wiki locally