Audiobookshelf is a powerful audiobook / podcast streaming server, whose strength lies in its native app support on Android / iOS (Testflight required).
It's helpful to keep environment variables in a separate file, so create /var/data/config/audiobookshelf/audiobookshelf.env, as follows (you may want to customise the UID/GID to match those of your media folder):
AUDIOBOOKSHELF_UID=99
AUDIOBOOKSHELF_GID=100
Audiobookshelf Docker Swarm config
Create a docker swarm config file in docker-compose syntax (v3), something like the example below.. example:
Fast-track with premix! π
"Premix" is a git repository which includes necessary docker-compose and env files for all published recipes. This means that you can launch any recipe with just a git pull and a docker stack deploy π.
π Update: Premix now includes an ansible playbook, enabling you to deploy an entire stack + recipes, with a single ansible command! (more here)
version:'3'services:app:image:advplyr/audiobookshelfenv_file:/var/data/config/audiobookshelf/audiobookshelf.envvolumes:-/var/data/audiobookshelf/config:/config-/var/data/audiobookshelf/metadata:/metadata# Set this next volume to wherever you store your audiobook library. # You can define multiple libraries within this folder, like `/media/audio/podcasts`, `/media/audio/audiobooks`, etc-/var/data/media:/mediadeploy:replicas:1labels:# traefik-traefik.enable=true-traefik.docker.network=traefik_public# traefikv1-traefik.frontend.rule=Host:audiobookshelf.example.com-traefik.port=80# traefikv2-"traefik.http.routers.audiobookshelf.rule=Host(`audiobookshelf.example.com`)"-"traefik.http.routers.audiobookshelf.entrypoints=https"-"traefik.http.services.audiobookshelf.loadbalancer.server.port=80"networks:-traefik_publicnetworks:traefik_public:external:true
Should we use Traefik Forward Auth?
No, because (a) the mobile apps won't work with session/cookie based auth, and (b) the docs indicate that using middleware which alters CORS with Traefik will cause the app to error!
Run Audiobookshelf
Launch the audiobookshelf stack by running docker stack deploy audiobookshelf -c <path -to-docker-compose.yml>
Setup audiobookshelf
Now hit the URL you created for Audiobookshelf, and you'll find yourself presented with the "Initial Server Setup". After creating a user and password, setup your libraries, and then either stream your audio directly in your browser, or fire up the Android / iOS app and listen on the go! 1
Summary
What have we achieved? We can now easily consume our audio books / podcasts via Audiobookshelf, securely over our Traefik-exposed service! 2
Summary
Created:
Audiobookshelf is running, able to access your media libraries, and is streaming books / podcasts to you, wherever you are!
Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! π
Employ your chef (engage) π€
Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.
Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.