Configuration
Configuring your self hosted Papra allows you to customize the application to better suit your environment and requirements. This guide covers the key environment variables you can set to control various aspects of the application, including port settings, security options, and storage configurations.
Configuration variables
Here is the complete list of configuration variables that you can use to configure Papra. You can set these variables in the .env
file or pass them as environment variables when running the Docker container.
SERVER_BASE_URL
The base URL of the server.
- Path:
server.baseUrl
- Environment variable:
SERVER_BASE_URL
- Default value:
http://localhost:1221
PORT
The port to listen on when using node server.
- Path:
server.port
- Environment variable:
PORT
- Default value:
1221
SERVER_API_ROUTES_TIMEOUT_MS
The maximum time in milliseconds for a route to complete before timing out.
- Path:
server.routeTimeoutMs
- Environment variable:
SERVER_API_ROUTES_TIMEOUT_MS
- Default value:
20000
SERVER_CORS_ORIGINS
The CORS origin for the api server.
- Path:
server.corsOrigins
- Environment variable:
SERVER_CORS_ORIGINS
- Default value:
http://localhost:3000
SERVER_SERVE_PUBLIC_DIR
Whether to serve the public directory.
- Path:
server.servePublicDir
- Environment variable:
SERVER_SERVE_PUBLIC_DIR
- Default value:
false
DATABASE_URL
The URL of the database.
- Path:
database.url
- Environment variable:
DATABASE_URL
- Default value:
file:./db.sqlite
DATABASE_AUTH_TOKEN
The auth token for the database.
- Path:
database.authToken
- Environment variable:
DATABASE_AUTH_TOKEN
- Default value:
undefined
CLIENT_BASE_URL
The URL of the client.
- Path:
client.baseUrl
- Environment variable:
CLIENT_BASE_URL
- Default value:
http://localhost:3000
CLIENT_OAUTH_REDIRECT_URL
The URL to redirect to after OAuth.
- Path:
client.oauthRedirectUrl
- Environment variable:
CLIENT_OAUTH_REDIRECT_URL
- Default value:
http://localhost:3000/confirm
DOCUMENTS_DELETED_DOCUMENTS_RETENTION_DAYS
The retention period in days for deleted documents.
- Path:
documents.deletedDocumentsRetentionDays
- Environment variable:
DOCUMENTS_DELETED_DOCUMENTS_RETENTION_DAYS
- Default value:
30
DOCUMENT_STORAGE_MAX_UPLOAD_SIZE
The maximum size in bytes for an uploaded file.
- Path:
documentsStorage.maxUploadSize
- Environment variable:
DOCUMENT_STORAGE_MAX_UPLOAD_SIZE
- Default value:
10485760
DOCUMENT_STORAGE_DRIVER
The driver to use for document storage.
- Path:
documentsStorage.driver
- Environment variable:
DOCUMENT_STORAGE_DRIVER
- Default value:
filesystem
DOCUMENT_STORAGE_FILESYSTEM_ROOT
The root directory to store documents in.
- Path:
documentsStorage.drivers.filesystem.root
- Environment variable:
DOCUMENT_STORAGE_FILESYSTEM_ROOT
- Default value:
./local-documents
DOCUMENT_STORAGE_S3_ACCESS_KEY_ID
The AWS access key ID for S3.
- Path:
documentsStorage.drivers.s3.accessKeyId
- Environment variable:
DOCUMENT_STORAGE_S3_ACCESS_KEY_ID
- Default value:
undefined
DOCUMENT_STORAGE_S3_SECRET_ACCESS_KEY
The AWS secret access key for S3.
- Path:
documentsStorage.drivers.s3.secretAccessKey
- Environment variable:
DOCUMENT_STORAGE_S3_SECRET_ACCESS_KEY
- Default value:
undefined
DOCUMENT_STORAGE_S3_BUCKET_NAME
The S3 bucket name.
- Path:
documentsStorage.drivers.s3.bucketName
- Environment variable:
DOCUMENT_STORAGE_S3_BUCKET_NAME
- Default value:
undefined
DOCUMENT_STORAGE_S3_REGION
The AWS region for S3.
- Path:
documentsStorage.drivers.s3.region
- Environment variable:
DOCUMENT_STORAGE_S3_REGION
- Default value:
auto
DOCUMENT_STORAGE_S3_ENDPOINT
The S3 endpoint.
- Path:
documentsStorage.drivers.s3.endpoint
- Environment variable:
DOCUMENT_STORAGE_S3_ENDPOINT
- Default value:
undefined
AUTH_SECRET
The secret for the auth.
- Path:
auth.secret
- Environment variable:
AUTH_SECRET
- Default value:
change-me-for-god-sake
AUTH_IS_REGISTRATION_ENABLED
Whether registration is enabled.
- Path:
auth.isRegistrationEnabled
- Environment variable:
AUTH_IS_REGISTRATION_ENABLED
- Default value:
true
AUTH_IS_PASSWORD_RESET_ENABLED
Whether password reset is enabled.
- Path:
auth.isPasswordResetEnabled
- Environment variable:
AUTH_IS_PASSWORD_RESET_ENABLED
- Default value:
true
AUTH_IS_EMAIL_VERIFICATION_REQUIRED
Whether email verification is required.
- Path:
auth.isEmailVerificationRequired
- Environment variable:
AUTH_IS_EMAIL_VERIFICATION_REQUIRED
- Default value:
true
AUTH_PROVIDERS_GITHUB_IS_ENABLED
Whether Github OAuth is enabled.
- Path:
auth.providers.github.isEnabled
- Environment variable:
AUTH_PROVIDERS_GITHUB_IS_ENABLED
- Default value:
false
AUTH_PROVIDERS_GITHUB_CLIENT_ID
The client id for Github OAuth.
- Path:
auth.providers.github.clientId
- Environment variable:
AUTH_PROVIDERS_GITHUB_CLIENT_ID
- Default value:
set-me
AUTH_PROVIDERS_GITHUB_CLIENT_SECRET
The client secret for Github OAuth.
- Path:
auth.providers.github.clientSecret
- Environment variable:
AUTH_PROVIDERS_GITHUB_CLIENT_SECRET
- Default value:
set-me
AUTH_PROVIDERS_GOOGLE_IS_ENABLED
Whether Google OAuth is enabled.
- Path:
auth.providers.google.isEnabled
- Environment variable:
AUTH_PROVIDERS_GOOGLE_IS_ENABLED
- Default value:
false
AUTH_PROVIDERS_GOOGLE_CLIENT_ID
The client id for Google OAuth.
- Path:
auth.providers.google.clientId
- Environment variable:
AUTH_PROVIDERS_GOOGLE_CLIENT_ID
- Default value:
set-me
AUTH_PROVIDERS_GOOGLE_CLIENT_SECRET
The client secret for Google OAuth.
- Path:
auth.providers.google.clientSecret
- Environment variable:
AUTH_PROVIDERS_GOOGLE_CLIENT_SECRET
- Default value:
set-me
DOCUMENTS_HARD_DELETE_EXPIRED_DOCUMENTS_ENABLED
Whether the task to hard delete expired "soft deleted" documents is enabled.
- Path:
tasks.hardDeleteExpiredDocuments.enabled
- Environment variable:
DOCUMENTS_HARD_DELETE_EXPIRED_DOCUMENTS_ENABLED
- Default value:
true
DOCUMENTS_HARD_DELETE_EXPIRED_DOCUMENTS_CRON
The cron schedule for the task to hard delete expired "soft deleted" documents.
- Path:
tasks.hardDeleteExpiredDocuments.cron
- Environment variable:
DOCUMENTS_HARD_DELETE_EXPIRED_DOCUMENTS_CRON
- Default value:
0 0 * * *
DOCUMENTS_HARD_DELETE_EXPIRED_DOCUMENTS_RUN_ON_STARTUP
Whether the task to hard delete expired "soft deleted" documents should run on startup.
- Path:
tasks.hardDeleteExpiredDocuments.runOnStartup
- Environment variable:
DOCUMENTS_HARD_DELETE_EXPIRED_DOCUMENTS_RUN_ON_STARTUP
- Default value:
true
Coming soon.