[Docker] Feature Request: Add the ability to set the UID/GID of the docker container #130

Closed
opened 2026-04-24 22:59:14 +02:00 by adam · 4 comments
Owner

Originally created by @tvories on GitHub (Dec 15, 2021).

I have a shared directory for my book files. I would love to be able to set the docker container to run as a specific UID/GID so I can match my directory permissions for my central book storage.

I know the LinuxServer containers offer this ability, but I don't know how to add this to the docker container.

Originally created by @tvories on GitHub (Dec 15, 2021). I have a shared directory for my book files. I would love to be able to set the docker container to run as a specific UID/GID so I can match my directory permissions for my central book storage. I know the [LinuxServer](https://github.com/linuxserver/docker-bookstack#docker-compose-recommended-click-here-for-more-info) containers offer this ability, but I don't know how to add this to the docker container.
adam closed this issue 2026-04-24 22:59:15 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 16, 2021):

You can set them when running the docker container.

docker run -d \
    -e AUDIOBOOKSHELF_UID=99
    -e AUDIOBOOKSHELF_GID=100
    -p 1337:80 \
    -v </path/to/audiobooks>:/audiobooks \
    -v </path/to/config>:/config \
    -v </path/to/metadata>:/metadata \
    --name audiobookshelf \
    --rm advplyr/audiobookshelf

The docs still have a way to go

@advplyr commented on GitHub (Dec 16, 2021): You can set them when running the docker container. ``` docker run -d \ -e AUDIOBOOKSHELF_UID=99 -e AUDIOBOOKSHELF_GID=100 -p 1337:80 \ -v </path/to/audiobooks>:/audiobooks \ -v </path/to/config>:/config \ -v </path/to/metadata>:/metadata \ --name audiobookshelf \ --rm advplyr/audiobookshelf ``` The docs still have a way to go
Author
Owner

@advplyr commented on GitHub (Dec 16, 2021):

Just updated the docs on the site https://www.audiobookshelf.org/install#docker
Let me know how it goes

@advplyr commented on GitHub (Dec 16, 2021): Just updated the docs on the site https://www.audiobookshelf.org/install#docker Let me know how it goes
Author
Owner

@tvories commented on GitHub (Dec 16, 2021):

Thanks for the info! I was digging around for that. For my own knowledge, where is that set in the code to respect that env?

@tvories commented on GitHub (Dec 16, 2021): Thanks for the info! I was digging around for that. For my own knowledge, where is that set in the code to respect that env?
Author
Owner

@advplyr commented on GitHub (Dec 16, 2021):

At the entry point https://github.com/advplyr/audiobookshelf/blob/master/index.js#L21

The only place UID/GID are used right now is when uploading audiobooks through the upload form, and when backups are created. This will need to be extended to include setting the file owner for cache and cover metadata as well.

@advplyr commented on GitHub (Dec 16, 2021): At the entry point https://github.com/advplyr/audiobookshelf/blob/master/index.js#L21 The only place UID/GID are used right now is when uploading audiobooks through the upload form, and when backups are created. This will need to be extended to include setting the file owner for cache and cover metadata as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#130