Wiki > Audiobookshelf
Setup
Intro
Audiobookshelf is an open-source self-hosted media server for your audiobooks and podcasts.
The software will be configured in the /home/user/audiobookshelf
directory.
You will need a port number to access Audiobookshelf. Port 15540 has been automatically generated for you, but you may use another 5 digit port between 10000 and 32767.
Pre-requisites
The directions below assume:
- You have a directory of audiobook files in
/home/user/files/audiobooks
- You have a directory of podcast files in
/home/user/files/podcasts
Note: If you do not have directories with existing audiobooks or podcasts create them before starting the installation. Alternatively, you can use your existing folders and change directory paths for your files as needed.
Installation
-
Connect to your slot through SSH
-
Create a directory for audiobookshelf
mkdir -p ~/audiobookshelf
-
Create a compose file.
touch ~/audiobookshelf/docker-compose.yml
-
Edit the compose file
nano ~/audiobookshelf/docker-compose.yml
-
Copy the following adjusting your time zone if desired and changing your directory paths for your files as needed. Paste into the text editor. Once pasted, press
Ctrl+S
thenCtrl+X
services:
audiobookshelf:
image: ghcr.io/advplyr/audiobookshelf:latest
ports:
- 15540:80
volumes:
- /home/user/files/audiobooks:/audiobooks
- /home/user/files/podcasts:/podcasts
- /home/user/audiobookshelf:/config
- /home/user/audiobookshelf:/metadata
environment:
- TZ=UTC
restart: unless-stopped
-
Start the compose file:
podman-compose -f ~/audiobookshelf/docker-compose.yml up -d
Accessing Audiobookshelf
You will now be able to access your files folder using the username and password you defined from http://server.whatbox.ca:15540/
After installation, you will need to immediately access Audiobookshelf and set up your first administrator user.
If you need to stop the container, you can shut it down with podman-compose -f ~/audiobookshelf/docker-compose.yml down -t 300
and wait for it to shut down. If the container does not shut down, run pkill -f index.js
and try the down command again.
Updating Audiobookshelf
This container updates when it is restarted. Shut it down with
podman-compose -f ~/audiobookshelf/docker-compose.yml down -t 300
and wait for it to shut down. Then, run
podman-compose -f ~/audiobookshelf/docker-compose.yml up -d
to start the container again.
Using SSL with a Managed App Link
If you want to access your Audiobookshelf instance with HTTPS access, add a custom app managed link with port 15540 and select Enable websockets (optional)
Auto-restarting Audiobookshel
- Create a file to be used for the script:
touch ~/audiobookshelf_restart.cron
- Edit the file and enter the following text:
nano -w ~/audiobookshelf_restart.cron
#!/bin/bash
if pgrep -fx ".*audiobookshelf_1.*" > /dev/null
then
echo "Audiobookshelf is running."
else
echo "Audiobookshelf is not running, starting Audiobookshelf"
podman-compose -f /home/user/audiobookshelf/docker-compose.yml up -d
fi
exit
- Save the file with Ctrl+x, then press "y" and Enter to accept overwriting.
- Make the script executable:
chmod +x ~/audiobookshelf_restart.cron
- Open your crontab:
EDITOR=nano crontab -e
- Enter the following text:
@reboot /home/user/audiobookshelf_restart.cron >/dev/null 2>&1
*/5 * * * * /home/user/audiobookshelf_restart.cron >/dev/null 2>&1
- Save the file with Ctrl+x, then press "y" and Enter to accept overwriting.
Removing
-
Navigate to the directory containing the
docker-compose.yml
filecd audiobookshelf
-
Remove the services including networks and volumes created
podman-compose down --volumes
-
Remove the directory
rm -r /home/user/audiobookshelf
-
To remove any crontab -e entries open your crontab:
EDITOR=nano crontab -e
and delete or comment out any of the restart/upgrade commands you might have added. Then, save the file with Ctrl+x, then press "y" and Enter to accept overwriting.