Skip to main content

Environment Variables

Below are all the environment variables supported by Pocket ID. These should be configured in your .env file.

Be cautious when modifying environment variables that are not recommended to change.

VariableDefault ValueRecommended to changeDescription
PUBLIC_APP_URLhttp://localhostyesThe URL where you will access the app.
TRUST_PROXYfalseyesWhether the app is behind a reverse proxy.
MAXMIND_LICENSE_KEY-yesLicense Key for the GeoLite2 Database. The license key is required to retrieve the geographical location of IP addresses in the audit log. If the key is not provided, IP locations will be marked as "unknown." You can obtain a license key for free here.
PUID and PGID1000yesThe user and group ID of the user who should run Pocket ID inside the Docker container and owns the files that are mounted with the volume. You can get the PUID and GUID of your user on your host machine by using the command id. For more information see this article.
DB_PROVIDERsqlitenoThe database provider you want to use. Currently sqlite and postgres are supported.
DB_CONNECTION_STRINGfile:data/pocket-id.db?_journal_mode=WAL&_busy_timeout=2500&_txlock=immediatenoSpecifies the connection string used to connect to the database. See the Database connection string section below for more details.
UPLOAD_PATHdata/uploadsnoThe path where the uploaded files are stored.
KEYS_PATHdata/keysnoThe path where the private keys are stored.
INTERNAL_BACKEND_URLhttp://localhost:8080noThe URL where the backend is accessible.
GEOLITE_DB_PATHdata/GeoLite2-City.mmdbnoThe path where the GeoLite2 database should be stored.
GEOLITE_DB_URLhttps://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=%s&suffix=tar.gznoThe custom download URL for the Geolite DB (default value should be fine for most users.)
CADDY_PORT80noThe port on which Caddy should listen. Caddy is only active inside the Docker container. If you want to change the exposed port of the container then you should change this variable.
CADDY_DISABLEDfalsenoWhether Caddy should be disabled inside the Docker container. If disabled, you must configure your reverse proxy to correctly map all paths. Refer to the official Caddyfile for guidance.
PORT3000noThe port on which the frontend should listen.
BACKEND_PORT8080noThe port on which the backend should listen
HOST0.0.0.0noThe address on which the backend and frontend should listen.
PUBLIC_UI_CONFIG_DISABLEDfalsenoSee Overriding the UI configuration.
UPDATE_CHECK_DISABLEDfalsenoWhether checking for a new version on github.com should be disabled.

Database connection string

The DB_CONNECTION_STRING environmental variable configures how Pocket ID connects to the database.

When using SQLite (DB_PROVIDER=sqlite, the default), this contains the path to the database file as well as some additional parameters. Most users should not modify the default value file:data/pocket-id.db?_journal_mode=WAL&_busy_timeout=2500&_txlock=immediate.

We do not recommend storing the SQLite database inside a networked filesystem, such as a NFS or SMB share. However, if you absolutely must, and are aware of the risks, you need to modify DB_CONNECTION_STRING and disable journaling, by setting _journal_mode=DELETE. Note that this is not a recommended or supported scenario by the SQLite developers, and you should ensure to have proper backups for your database.

When using PostgreSQL (DB_PROVIDER=postgres), the connection string is a DSN as supported by libpq:

Format:
postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]

Example:
postgres://pocketid:123456@localhost:5432/pocketid

Overriding the UI configuration

You can change additional settings directly in the Pocket ID UI. However, if you prefer to configure them via environment variables, you can do so by setting the following variables.

To enable environment variable overrides, set PUBLIC_UI_CONFIG_DISABLED to true. When PUBLIC_UI_CONFIG_DISABLED is set to true, Pocket ID will use values from the environment variables. If a variable is not set, the system will fall back to its default values.

VariableDefault ValueDescription
APP_NAMEPocket IDThe name of the app.
SESSION_DURATION60The duration of a session in minutes before the user has to sign in again.
EMAILS_VERIFIEDfalseWhether the user's email should be marked as verified for the OIDC clients.
ALLOW_OWN_ACCOUNT_EDITtrueWhether the users should be able to edit their own account details.
SMTP_HOST-SMTP server hostname.
SMTP_PORT-SMTP server port.
SMTP_FROM-Sender email address for outgoing emails.
SMTP_USER-SMTP username for authentication.
SMTP_PASSWORD-SMTP password for authentication.
SMTP_TLSnoneWhich TLS Option to use. Valid values are: none, starttls and tls.
SMTP_SKIP_CERT_VERIFYfalseWhether to skip SMTP certificate verification. This can be useful for self-signed certificates.
EMAIL_LOGIN_NOTIFICATION_ENABLEDfalseSend an email to the user when they log in from a new device.
EMAIL_ONE_TIME_ACCESS_ENABLEDfalseAllows users to sign in with a link sent to their email. This reduces the security significantly as anyone with access to the user's email can gain entry.
LDAP_ENABLEDfalseWhether LDAP authentication is enabled.
LDAP_URL-LDAP server URL.
LDAP_BIND_DN-LDAP bind distinguished name (DN).
LDAP_BIND_PASSWORD-LDAP bind password.
LDAP_BASE-LDAP search base DN.
LDAP_USER_SEARCH_FILTER(objectClass=person)LDAP user search filter.
LDAP_USER_GROUP_SEARCH_FILTER(objectClass=groupOfNames)The Search filter to use to search/sync groups.
LDAP_SKIP_CERT_VERIFYfalseWhether to skip LDAP certificate verification. This can be useful for self-signed certificates.
LDAP_ATTRIBUTE_USER_UNIQUE_IDENTIFIER-LDAP attribute for user unique identifier. The value of this attribute should never change.
LDAP_ATTRIBUTE_USER_USERNAME-LDAP attribute for user username.
LDAP_ATTRIBUTE_USER_EMAIL-LDAP attribute for user email.
LDAP_ATTRIBUTE_USER_FIRST_NAME-LDAP attribute for user first name.
LDAP_ATTRIBUTE_USER_LAST_NAME-LDAP attribute for user last name.
LDAP_ATTRIBUTE_USER_PROFILE_PICTURE-LDAP attribute for the profile picture of a user.
LDAP_ATTRIBUTE_GROUP_MEMBERmemberLDAP attribute to use for querying members of a group.
LDAP_ATTRIBUTE_GROUP_UNIQUE_IDENTIFIER-LDAP attribute for group unique identifier. The value of this attribute should never change.
LDAP_ATTRIBUTE_GROUP_NAME-LDAP attribute for group name.
LDAP_ATTRIBUTE_ADMIN_GROUP-LDAP attribute for admin group. Members of this group will have Admin Privileges in Pocket ID.