Configuration
Everything in LibreDrive is configured through environment variables, read at container startup. Set them in .env next to docker-compose.yml — no code changes or forking required. .env.example in the repository is a ready-to-edit template with every variable below.
Core settings
| Variable | Description | Default |
|---|---|---|
LIBREDRIVE_DOMAIN | Public hostname, used to build links (setup, checkout redirects) | — (required) |
LIBREDRIVE_DATABASE_URL | PostgreSQL connection string | — (required) |
LIBREDRIVE_SECRET_KEY | Signs JWT access tokens. Minimum 32 characters | — (required) |
LIBREDRIVE_ALLOW_SIGNUP | Whether new users can self-register (POST /api/auth/register) | false |
Storage quotas and uploads
| Variable | Description | Default |
|---|---|---|
LIBREDRIVE_DEFAULT_QUOTA | Quota assigned to users with no plan/override | 5GB |
LIBREDRIVE_MAX_UPLOAD_SIZE | Largest single file allowed, instance-wide | 5GB |
LIBREDRIVE_ALLOWED_FILE_TYPES | Comma-separated extensions/MIME types, or * for all | * |
LIBREDRIVE_TRASH_RETENTION_DAYS | Days a trashed file stays recoverable before permanent purge | 30 |
Plans with custom quotas (Free, Pro, Team, or your own names) are created from the admin panel once the instance is running; the variables above only set the fallback for accounts without a plan.
Storage backend
LibreDrive stores encrypted file blobs either on local disk or in an S3-compatible bucket.
| Variable | Description | Default |
|---|---|---|
LIBREDRIVE_STORAGE_DRIVER | local or s3 | local |
LIBREDRIVE_STORAGE_LOCAL_PATH | Path for the local driver, mounted from the libredrive_files volume | /data/files |
LIBREDRIVE_STORAGE_S3_BUCKET | Bucket name (S3 driver) | — |
LIBREDRIVE_STORAGE_S3_REGION | Bucket region | — |
LIBREDRIVE_STORAGE_S3_ENDPOINT | Custom endpoint, for MinIO or other S3-compatible stores | — |
LIBREDRIVE_STORAGE_S3_ACCESS_KEY_ID / LIBREDRIVE_STORAGE_S3_SECRET_ACCESS_KEY | Credentials for the bucket | — |
Payment methods
Enable one or more providers with LIBREDRIVE_PAYMENTS_ENABLED, a comma-separated list drawn from stripe, paypal, crypto, manual.
LIBREDRIVE_PAYMENTS_ENABLED=stripe,paypal,manualRegardless of which providers are enabled, an administrator can always mark any invoice as paid by hand from the admin panel (POST /api/admin/invoices/:id/mark-paid). Each enabled provider needs its own credentials:
Stripe
| Variable | Description |
|---|---|
LIBREDRIVE_STRIPE_SECRET_KEY | Secret API key from your Stripe dashboard |
LIBREDRIVE_STRIPE_WEBHOOK_SECRET | Verifies incoming events at POST /api/payments/webhooks/stripe |
PayPal
| Variable | Description |
|---|---|
LIBREDRIVE_PAYPAL_CLIENT_ID | Client ID from your PayPal developer app |
LIBREDRIVE_PAYPAL_CLIENT_SECRET | Client secret from the same app |
LIBREDRIVE_PAYPAL_MODE | sandbox or live — defaults to live |
Crypto
| Variable | Description |
|---|---|
LIBREDRIVE_CRYPTO_WALLET_ADDRESS | Address shown on the checkout screen |
LIBREDRIVE_CRYPTO_NETWORK | Network label shown alongside the address (e.g. BTC, ETH) |
Crypto payments are confirmed manually by an administrator — LibreDrive doesn’t watch the chain for you.
Manual transfer
No credentials required — invoices can be marked as paid by hand from the admin panel. Useful for bank transfers or informal arrangements.
Encryption and backups
| Variable | Description | Default |
|---|---|---|
LIBREDRIVE_ENCRYPTION_KEY | Base64, 32 raw bytes (openssl rand -base64 32). Encrypts every file’s data key | — (required) |
LIBREDRIVE_ENCRYPTION_KEY_NEW | Set only while rotating keys; see security & backups | — |
LIBREDRIVE_BACKUP_TARGET | s3, local, or none | none |
LIBREDRIVE_BACKUP_SCHEDULE | Cron expression for the automatic backup | 0 3 * * * |
LIBREDRIVE_BACKUP_S3_BUCKET | Bucket for backup archives (S3 target) | — |
LIBREDRIVE_BACKUP_LOCAL_PATH | Path for backup archives (local target), mounted from the libredrive_backups volume | /data/backups |
See security & backups for a full walkthrough of key rotation and restore procedures.