Skip to main content

Environment Configuration

Audiobookshelf is configured via environment variables. You can pass them to your Docker container using:

-e VARIABLE=VALUE

Or set them in /etc/default/audiobookshelf if you install Audiobookshelf via packages.

Below is a list of all available options, grouped by category.


Filesystem

VariableDefaultDescription
CONFIG_PATH./configPath to the config directory. Contains the database (users/books/libraries/settings). This location must not be mounted over the network.
METADATA_PATH./metadataPath to the metadata directory. Contains cache, streams, covers, downloads, backups, and logs.
BACKUP_PATH./metadata/backupsPath to where backups are stored. Backups include the database and images/metadata.

External Tools

VariableDefaultDescription
FFMPEG_PATHffmpegPath to the ffmpeg binary. If unset, Audiobookshelf assumes it exists in the system path.
FFPROBE_PATHffprobePath to the ffprobe binary. If unset, Audiobookshelf assumes it exists in the system path.

Network

VariableDefaultDescription
HOSTThe host Audiobookshelf binds to. Use 127.0.0.1 for localhost only, or leave unset for all interfaces.
PORTThe TCP port Audiobookshelf will listen on.
EXP_PROXY_SUPPORTExperimental: Respects HTTP_PROXY and HTTPS_PROXY environment variables. Disables SSRF request filter.

Security

VariableDefaultDescription
JWT_SECRET_KEYSecret for generating JSON Web Tokens. If not provided, a secure random token is generated. Do NOT change after deployment. If you do, all clients need to reauthenticate.
ACCESS_TOKEN_EXPIRY43200Access token expiration in seconds
REFRESH_TOKEN_EXPIRY604800Refresh token expiration in seconds
RATE_LIMIT_AUTH_WINDOW600000Rate limiting window in milliseconds
RATE_LIMIT_AUTH_MAX40Maximum auth attempts per window. Use 0 to disable
ALLOW_CORS'0'Allow Cross-Origin Resource Sharing if set to '1'.
DISABLE_SSRF_REQUEST_FILTER'0'Disables the "Server Side Request Forgery" filter. May be needed for self-hosted podcasts.
SSRF_REQUEST_FILTER_WHITELISTComma-separated whitelist of domains to exclude from the SSRF filter.
ALLOW_IFRAME'0'Allow use of iframes. Can also be managed at the reverse proxy level.

Other

VariableDefaultDescription
SOURCEInstallation source (e.g., docker, debian, rpm). Shown in the web client.
NODE_ENVproductionType of deployment. Should be production unless developing.
PODCAST_DOWNLOAD_TIMEOUT30 secondsTimeout to wait for a podcast to start downloading.
MAX_FAILED_EPISODE_CHECKS24Maximum number of failed episode checks before disabling the RSS feed. Disable with 0
QUERY_LOGGINGDebug SQL queries. Use log to log queries, benchmark to also log runtime.
QUERY_PROFILINGExperimental profiling of specific database queries. Not implemented on most queries.
SQLITE_MMAP_SIZESet the mmap_size pragma for the SQLite database.
SQLITE_CACHE_SIZESet the cache_size pragma for the SQLite database.
SQLITE_TEMP_STORESet the temp_store pragma for the SQLite database.

Security Note

If you are self-hosting a podcast from the same server, you may need to disable the SSRF filter using:

-e DISABLE_SSRF_REQUEST_FILTER=1
Default Values

If a variable is not set, Audiobookshelf will use its default value as shown above.