PocketBase™ is an open source backend consisting of embedded database (SQLite) with realtime subscriptions, built-in auth management, convenient dashboard UI and simple REST-ish API.
The recommended way to get the PocketBase™ Docker Image is to pull the prebuilt image from the Docker Hub Registry.
To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.
When you start the PocketBase™ image, you can adjust the configuration of the instance by passing one or more environment variables either on the docker-compose file or on the docker run command line. If you want to add a new environment variable:
-
For docker-compose add the variable name and value under the application section in the
docker-compose.ymlfile present in this repository:pocketbase: ... environment: - USER_DEFINED_KEY=custom_value ...
-
For manual execution add a
--envoption with each variable and value:$ docker run -d --name pocketbase -p 80:8090 \ --env USER_DEFINED_KEY=custom_value \ --network pocketbase_network \ --volume /path/to/pocketbase-persistence:/pocketbase \ adrianmusante/pocketbase:latest
Available environment variables:
POCKETBASE_DEBUG: Verbose mode. Default: falsePOCKETBASE_PORT_NUMBER: PocketBase™ server port number. Default: 8090POCKETBASE_OPTS: Additional options for bootstrap server. No defaults.POCKETBASE_ADMIN_EMAIL: Admin user email. No defaults.POCKETBASE_ADMIN_PASSWORD: Admin user password. It is possible to use Docker secrets to define the value or set thePOCKETBASE_ADMIN_PASSWORD_FILEvariable which will contain the path where the value is stored. No defaults.POCKETBASE_ADMIN_UPSERT: If set totrue, the admin user always is set from environment variables before the server starts. Otherwise, set tofalsefor only create in the first startup. Default: true
POCKETBASE_ENCRYPTION_KEY: The variable is used to encrypt the applications settings in PocketBase's database. By default, these settings are stored as plain JSON text, which may not be suitable for production environments where security is a concern. When you set this variable to a value, PocketBase will use it to encrypt the settings before storing them in the database. This provides an additional layer of protection against unauthorized access to your application's sensitive data, such as OAuth2 client secrets and SMTP passwords. (ref.: pocketbase.io)POCKETBASE_ENCRYPTION_KEY_FILE: Alternative toPOCKETBASE_ENCRYPTION_KEYenvironment variable. If Docker manages the secret, this variable is used to reference the name with which the secret was created. An absolute path can also be specified if the secret was mounted as a file using a volume. Default: POCKETBASE_ENCRYPTION_KEY
POCKETBASE_WORKDIRPersistence base directory. Default: /pocketbasePOCKETBASE_DATA_DIRPocketBase data directory. Default: ${POCKETBASE_WORKDIR}/dataPOCKETBASE_MIGRATION_DIRThe directory with the user defined migrations. Default: ${POCKETBASE_WORKDIR}/migrationsPOCKETBASE_PUBLIC_DIRThe directory to serve static files. Default: ${POCKETBASE_WORKDIR}/publicPOCKETBASE_HOOK_DIRThe directory with the JS app hooks. Default: ${POCKETBASE_WORKDIR}/hooks