Skip to content

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

VariableDescriptionDefault
LIBREDRIVE_DOMAINPublic hostname, used to build links (setup, checkout redirects)— (required)
LIBREDRIVE_DATABASE_URLPostgreSQL connection string— (required)
LIBREDRIVE_SECRET_KEYSigns JWT access tokens. Minimum 32 characters— (required)
LIBREDRIVE_ALLOW_SIGNUPWhether new users can self-register (POST /api/auth/register)false

Storage quotas and uploads

VariableDescriptionDefault
LIBREDRIVE_DEFAULT_QUOTAQuota assigned to users with no plan/override5GB
LIBREDRIVE_MAX_UPLOAD_SIZELargest single file allowed, instance-wide5GB
LIBREDRIVE_ALLOWED_FILE_TYPESComma-separated extensions/MIME types, or * for all*
LIBREDRIVE_TRASH_RETENTION_DAYSDays a trashed file stays recoverable before permanent purge30

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.

VariableDescriptionDefault
LIBREDRIVE_STORAGE_DRIVERlocal or s3local
LIBREDRIVE_STORAGE_LOCAL_PATHPath for the local driver, mounted from the libredrive_files volume/data/files
LIBREDRIVE_STORAGE_S3_BUCKETBucket name (S3 driver)
LIBREDRIVE_STORAGE_S3_REGIONBucket region
LIBREDRIVE_STORAGE_S3_ENDPOINTCustom endpoint, for MinIO or other S3-compatible stores
LIBREDRIVE_STORAGE_S3_ACCESS_KEY_ID / LIBREDRIVE_STORAGE_S3_SECRET_ACCESS_KEYCredentials for the bucket

Payment methods

Enable one or more providers with LIBREDRIVE_PAYMENTS_ENABLED, a comma-separated list drawn from stripe, paypal, crypto, manual.

Terminal window
LIBREDRIVE_PAYMENTS_ENABLED=stripe,paypal,manual

Regardless 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

VariableDescription
LIBREDRIVE_STRIPE_SECRET_KEYSecret API key from your Stripe dashboard
LIBREDRIVE_STRIPE_WEBHOOK_SECRETVerifies incoming events at POST /api/payments/webhooks/stripe

PayPal

VariableDescription
LIBREDRIVE_PAYPAL_CLIENT_IDClient ID from your PayPal developer app
LIBREDRIVE_PAYPAL_CLIENT_SECRETClient secret from the same app
LIBREDRIVE_PAYPAL_MODEsandbox or live — defaults to live

Crypto

VariableDescription
LIBREDRIVE_CRYPTO_WALLET_ADDRESSAddress shown on the checkout screen
LIBREDRIVE_CRYPTO_NETWORKNetwork 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

VariableDescriptionDefault
LIBREDRIVE_ENCRYPTION_KEYBase64, 32 raw bytes (openssl rand -base64 32). Encrypts every file’s data key— (required)
LIBREDRIVE_ENCRYPTION_KEY_NEWSet only while rotating keys; see security & backups
LIBREDRIVE_BACKUP_TARGETs3, local, or nonenone
LIBREDRIVE_BACKUP_SCHEDULECron expression for the automatic backup0 3 * * *
LIBREDRIVE_BACKUP_S3_BUCKETBucket for backup archives (S3 target)
LIBREDRIVE_BACKUP_LOCAL_PATHPath 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.