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
| Variable | Description | Default |
|---|---|---|
MYDRIVE_DOMAIN | Public domain the instance is served from | — (required) |
MYDRIVE_DATABASE_URL | PostgreSQL connection string | — (required) |
MYDRIVE_SECRET_KEY | Random string used to sign sessions | — (required) |
MYDRIVE_ALLOW_SIGNUP | Whether new users can self-register | false |
Storage quotas
| Variable | Description | Default |
|---|---|---|
MYDRIVE_DEFAULT_QUOTA | Quota assigned to new users with no explicit plan | 5GB |
MYDRIVE_MAX_UPLOAD_SIZE | Largest single file allowed | 2GB |
MYDRIVE_ALLOWED_FILE_TYPES | Comma-separated extensions, or * for all | * |
MYDRIVE_TRASH_RETENTION_DAYS | Days deleted files stay recoverable | 30 |
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.
MYDRIVE_PAYMENTS_ENABLED=stripe,paypal,manualEach enabled provider needs its own credentials:
Stripe
| Variable | Description |
|---|---|
MYDRIVE_STRIPE_SECRET_KEY | Secret API key from your Stripe dashboard |
MYDRIVE_STRIPE_WEBHOOK_SECRET | Used to verify incoming webhook events |
PayPal
| Variable | Description |
|---|---|
MYDRIVE_PAYPAL_CLIENT_ID | Client ID from your PayPal developer app |
MYDRIVE_PAYPAL_CLIENT_SECRET | Client secret from the same app |
Crypto
| Variable | Description |
|---|---|
MYDRIVE_CRYPTO_WALLET_ADDRESS | Address funds are sent to |
MYDRIVE_CRYPTO_NETWORK | btc, 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
| Variable | Description | Default |
|---|---|---|
MYDRIVE_ENCRYPTION_KEY | Key used to encrypt files at rest | — (required in production) |
MYDRIVE_BACKUP_TARGET | s3, local, or none | none |
MYDRIVE_BACKUP_SCHEDULE | Cron expression for automatic backups | 0 3 * * * |
See security & backups for a full walkthrough of key rotation and restore procedures.