Setting up a home instance of AudioBookShelf

Setting up a home instance of AudioBookShelf
Edmonton Alberta Oct 26, 2023 - Edmonton 1st snow fall of the Autumn

Ah audiobooks the best of worlds for someone who has trouble readying and doesn't really want to have physically books take up precious floor space in an limited apartment. You even get, usually, a professional whispering in your ears the book. I've been a fan of audiobooks since I heard of them through my local library. The downside of using library audiobooks is your usually limited by the amount of time you have to listen to the book before someone else has a digital hold on the book. To resolve this problem I had with limited time I sought to selfhost a instance library of my own audiobooks.

My server hosting my docker lab only has 512gb of NVMe storage, however I do have another server that has roughly 12TB of storage. So this will be a how to host a AudioBookShelf docker app that has volumes on a different server and is behind a Nginx Proxy Manager service. Lets get on with it and as as always what works for me may not work for you.


The first step is to setup the Nginx proxy manager and for me, I personally prefer to have two networks that either expose dockers or not: a frontend and backend network. I wont be going though that on this post but the steps are here.

the next step would be to setup the external server storage for the audiobooks and/or podcasts since AudioBookShelf is capable of that.

You do not have to do this if your audiobookshelf docker server has plenty of room.

Make Sure you have the volume mounted and shared. We'll also throw a little bit of security to the mounted drive in Ubuntu. Using a text editor, create a file for your remote servers logon credential

nano ~/.smbcredentials

Now we are going to enter the windows login credentials for your server that has the drive you would like to mount.

username=msusername
password=mspassword

Save the file, exit the editor. You can change the permissions of the file to prevent unwanted access to your credentials for more protection.

chmod 600 ~/.smbcredentials

Then edit your /etc/fstab file (with root privileges) to add this line:

sudo nano /etc/fstab

Now add the following into the end of the file:

//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8 0 0 

"sharename" is what windows reports it, and "windowsshare" should be changed to what you want to call it in Ubuntu

Finally save the file and test the configuration by mounting the network drive with:

sudo mount -a

For the purpose of this post well also do the following to add the right folders in the newly mounted share.

cd /media/windowsshare
mkdir {audiobooks,podcasts}

Next will the the actual setup of the docker container for AudioBookShelf. I used the following docker-compose.yml, configured to reflect the steps above.

version: "3.7"

networks:
  frontend:
    external: true

services:
  audiobookshelf:
    container_name: audiobookshelf-app
    image: ghcr.io/advplyr/audiobookshelf:latest
    #ports:
    #  - 13378:80
    # ports not used in this configuration because app is beind a nginx proxy manager
    volumes:
      - /media/windowsshare/audiobooks:/audiobooks
      # audiobook media is on another device
      - /media/windowsshare/podcasts:/podcasts
      # podcast media is on another device
      - /home/username/docker/audiobookshelf/config:/config
      - /home/username/docker/audiobookshelf/metadata:/metadata
    networks:
      - frontend

We have disabled the ports 13378 from the default docker-compose.yml and have adjusted the the audiobook and podcast volumes. With the container being a part of the frontend network Nginx can now properly see the container and expose it to the internet. Once this is saved and docker compose up -d you should be able to reach through Nginx once you have set up your proxy host for the container. Make sure you enable websocket since the container/image requires it.


Once you have the container up and running you should be able to add media to the two folders audiobooks and podcasts and then scan them. This guide was more about how I did it with the network configuration I have more thank anything. I would go to the official site: https://www.audiobookshelf.org/ to get more documentation and see what options you have at your disposal.

Take care.


Update Dec 17, 2023: I've added a docker compose that does not need to access a mounted volume for extra storage. Just make sure the docker-compose.yml is nested in its own folder before you docker compose up -d and you have the Audiobookshelf behind a properly configured reverse proxy such as Nginx Proxy Manager.

version: "3.7"

networks:
  frontend:
    external: true

services:
  audiobookshelf:
    container_name: audiobookshelf-app
    image: ghcr.io/advplyr/audiobookshelf:latest
    #ports:
    #  - 13378:80
    # ports not used in this configuration because app is beind a nginx proxy manager
    volumes:
      - ./audiobooks:/audiobooks
      - ./podcasts:/podcasts
      - ./config:/config
      - ./metadata:/metadata
    networks:
      - frontend
My Cat: Queen Aurora