Docker Audiobookshelf

Hello, I’m running Audiobookshelf with Docker, but every time my raspberrypi reboots or performs a backup the Audiobookshelf service ends and I need to run this manually:

docker pull [ghcr.io/advplyr/audiobookshelf](http://ghcr.io/advplyr/audiobookshelf)
docker run -d \
-e AUDIOBOOKSHELF_UID=99 \
-e AUDIOBOOKSHELF_GID=100 \
-p 13378:80 \
-v /mnt/dietpi_userdata/audiobookshelf/config/:/config \
-v /mnt/dietpi_userdata/audiobookshelf/metadata:/metadata \
-v /mnt/shieldtv/srjoaquim/audiobooks:/audiobooks \
-v /mnt/shieldtv/srjoaquim/podcasts:/podcasts \
--name audiobookshelf \
--rm [ghcr.io/advplyr/audiobookshelf](http://ghcr.io/advplyr/audiobookshelf)
docker start audiobookshelf

Any idea how to keep the service alive every time I reboot my system or when the daily backup kicks in?

you need to add an option to restart the container automatically. Start containers automatically | Docker Documentation

as well you need to remove the --rm option as it will automatically remove the container when it exits. docker run | Docker Documentation

docker run -d --restart unless-stopped \
-e AUDIOBOOKSHELF_UID=99 \
-e AUDIOBOOKSHELF_GID=100 \
-p 13378:80 \
-v /mnt/dietpi_userdata/audiobookshelf/config/:/config \
-v /mnt/dietpi_userdata/audiobookshelf/metadata:/metadata \
-v /mnt/shieldtv/srjoaquim/audiobooks:/audiobooks \
-v /mnt/shieldtv/srjoaquim/podcasts:/podcasts \
--name audiobookshelf
1 Like

If you install portainer ce, you can use a webgui to go into the container and manually change the restart policy, if you want a webgui to assist…otherwise it’s pretty much all command line

Install Portainer with Docker on Linux - Portainer Documentation
make sure you click the community edition tab before you copy/paste the command

when i run those commands, I get this error:

docker run" requires at least 1 argument.
See 'docker run --help'.
Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container

Sorry about the delayed response and I’m a n00b in everything about Linux and Docker.

ah name of image was missing. Following should do.

docker run -d --restart unless-stopped \
-e AUDIOBOOKSHELF_UID=99 \
-e AUDIOBOOKSHELF_GID=100 \
-p 13378:80 \
-v /mnt/dietpi_userdata/audiobookshelf/config/:/config \
-v /mnt/dietpi_userdata/audiobookshelf/metadata:/metadata \
-v /mnt/shieldtv/srjoaquim/audiobooks:/audiobooks \
-v /mnt/shieldtv/srjoaquim/podcasts:/podcasts \
--name audiobookshelf \
ghcr.io/advplyr/audiobookshelf
1 Like

It works, thank you so much!!!

Oh man…I have buckets of audiobooks…gonna have to set this up and setup a NGINX reverse proxy to get to it from outside my network without a VPN tunnel

Awesome!!!

I still recommend getting portainer and learning it
docker does have quite a learning curve, but once you figure it out…boy howdy it’s awesome!