Skip to content

Configuration

Everything in MyDrive is configured through environment variables, read at container startup. Set them in docker-compose.yml or in a mounted .env file — no code changes or forking required.

Core settings

VariableDescriptionDefault
MYDRIVE_DOMAINPublic domain the instance is served from— (required)
MYDRIVE_DATABASE_URLPostgreSQL connection string— (required)
MYDRIVE_SECRET_KEYRandom string used to sign sessions— (required)
MYDRIVE_ALLOW_SIGNUPWhether new users can self-registerfalse

Storage quotas

VariableDescriptionDefault
MYDRIVE_DEFAULT_QUOTAQuota assigned to new users with no explicit plan5GB
MYDRIVE_MAX_UPLOAD_SIZELargest single file allowed2GB
MYDRIVE_ALLOWED_FILE_TYPESComma-separated extensions, or * for all*
MYDRIVE_TRASH_RETENTION_DAYSDays deleted files stay recoverable30

Plans with custom quotas (Free, Pro, Team, or your own names) are created from the admin panel once the instance is running; the environment variable above only sets the fallback for accounts without a plan.

Payment methods

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

Terminal window
MYDRIVE_PAYMENTS_ENABLED=stripe,paypal,manual

Each enabled provider needs its own credentials:

Stripe

VariableDescription
MYDRIVE_STRIPE_SECRET_KEYSecret API key from your Stripe dashboard
MYDRIVE_STRIPE_WEBHOOK_SECRETUsed to verify incoming webhook events

PayPal

VariableDescription
MYDRIVE_PAYPAL_CLIENT_IDClient ID from your PayPal developer app
MYDRIVE_PAYPAL_CLIENT_SECRETClient secret from the same app

Crypto

VariableDescription
MYDRIVE_CRYPTO_WALLET_ADDRESSAddress funds are sent to
MYDRIVE_CRYPTO_NETWORKbtc, eth, or a supported stablecoin network

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
MYDRIVE_ENCRYPTION_KEYKey used to encrypt files at rest— (required in production)
MYDRIVE_BACKUP_TARGETs3, local, or nonenone
MYDRIVE_BACKUP_SCHEDULECron expression for automatic backups0 3 * * *

See security & backups for a full walkthrough of key rotation and restore procedures.