Skip to main content

.env configuration

This file configures a Docker installation. Copy the template included with PlexSub, change only the values listed here, and keep the file out of Git.

You do not need to put every integration credential in .env when you configure it in Settings > Services. PlexSub stores those credentials encrypted in its database.

General settings for an example instance, without real data

Basic installation​

VariableWhen to change itExample
COMPOSE_PROJECT_NAMEWhen you want a different name for the Docker installation.plexsub
PORTWhen port 5000 is already in use.5000
APP_IMAGE_REFTo choose the PlexSub image you will run.Image specified by the installed version
PLEXSUB_POSTGRES_IMAGE_REFOnly when following an official PostgreSQL guide.postgres:18.4-alpine
APP_TIMEZONETo use your timezone for dates and notifications.Europe/Madrid

Database​

VariableWhat to enter
POSTGRES_DBThe database name; normally plexsub.
POSTGRES_USERA PostgreSQL user dedicated to PlexSub.
POSTGRES_PASSWORDA long, unique, private password.

Do not change PostgreSQL's major version over the same volume. Back up, restore into a new volume, and validate before replacing the installation.

Security and access​

VariableWhen to use it
APP_SETTINGS_ENCRYPTION_KEYRequired. Use a long key distinct from every other secret. Keep it with your backups.
SESSION_SIGNING_SECRETRequired. Use another long, distinct secret.
PLEXSUB_SETUP_TOKENOptional. A temporary token to protect the initial setup when your installation needs it.
APP_BASE_URLThe URL people will use: https://plexsub.yourdomain.com when public, or the local URL used by your installation.
TRUST_PROXY_LEVELLeave at 0 for direct access. Use 1 only when a trusted reverse proxy or tunnel sits in front of PlexSub.
FORCE_SECURE_COOKIESUse 1 with public HTTPS. Do not enable it for an HTTP-only local-network installation.

Generate secrets with OpenSSL:

openssl rand -base64 48

Generate one value per secret. Do not reuse the PostgreSQL password as an encryption key or session secret.

Variable-based integrations​

The preferred option is adding integrations in Settings > Services. If your installation method uses variables, define only those for the service you use:

ServiceCommon variables
PlexPLEX_SERVER_URL, PLEX_TOKEN
JellyfinJELLYFIN_URL, JELLYFIN_API_KEY
EmbyEMBY_URL, EMBY_API_KEY
Seerr, Overseerr, or JellyseerrOVERSEERR_URL, OVERSEERR_API_KEY
Radarr or SonarrRADARR_URL, RADARR_API_KEY, SONARR_URL, SONARR_API_KEY
qBittorrentQBITTORRENT_URL, QBITTORRENT_USERNAME, QBITTORRENT_PASSWORD
BazarrBAZARR_URL, BAZARR_API_KEY
TautulliTAUTULLI_URL, TAUTULLI_API_KEY
SMTPSMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM

Read Integrations to choose what you need and Integration diagnostics when a connection fails.

Minimal example​

COMPOSE_PROJECT_NAME=plexsub
PORT=5000

POSTGRES_DB=plexsub
POSTGRES_USER=plexsub
POSTGRES_PASSWORD=put_a_long_unique_password_here

APP_SETTINGS_ENCRYPTION_KEY=put_a_long_unique_key_here
SESSION_SIGNING_SECRET=put_another_long_unique_secret_here
APP_BASE_URL=http://localhost:5000
APP_TIMEZONE=Europe/Madrid
TRUST_PROXY_LEVEL=0
FORCE_SECURE_COOKIES=0

When publishing PlexSub over HTTPS, set APP_BASE_URL to your https:// address, set FORCE_SECURE_COOKIES=1, and follow the secure publishing guide.

Never include​

  • Passwords, tokens, or API keys in screenshots or messages.
  • The .env file in Git.
  • Backups or keys in public folders.
  • Undocumented variables “to try”: they are not needed for a normal installation.