Skip to content

Installation

MyDrive ships as a container image and is installed with Docker Compose. This guide covers a single-server deployment; for high-availability setups see the admin guide.

1. Requirements

  • Docker Engine 24+ and the Docker Compose plugin (docker compose version).
  • A domain pointed at your server’s IP address, if you want HTTPS.
  • At least 10GB of free disk for the application and database; plan additional space for the files your users will store.

2. Get the Compose file

Create a directory for your deployment and add a docker-compose.yml:

services:
mydrive:
image: ghcr.io/iiaanloopez/mydrive:latest
restart: unless-stopped
depends_on:
- db
ports:
- "8080:8080"
environment:
MYDRIVE_DOMAIN: drive.example.com
MYDRIVE_DEFAULT_QUOTA: 5GB
MYDRIVE_PAYMENTS_ENABLED: stripe,manual
MYDRIVE_DATABASE_URL: postgres://mydrive:mydrive@db:5432/mydrive
volumes:
- mydrive_data:/data
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: mydrive
POSTGRES_PASSWORD: mydrive
POSTGRES_DB: mydrive
volumes:
- mydrive_db:/var/lib/postgresql/data
volumes:
mydrive_data:
mydrive_db:

Replace drive.example.com with your domain, and use a real password for POSTGRES_PASSWORD before going to production.

3. Start the stack

Terminal window
docker compose up -d

MyDrive will be reachable on port 8080. Check the logs while it initializes:

Terminal window
docker compose logs -f mydrive

4. Put it behind a reverse proxy with TLS

For production, put MyDrive behind Nginx, Caddy, or Traefik so it’s served over HTTPS. A minimal Caddy example:

drive.example.com {
reverse_proxy localhost:8080
}

Caddy will request and renew a Let’s Encrypt certificate automatically.

5. Create the first admin account

On first boot, MyDrive prints a one-time setup link in the container logs:

Terminal window
docker compose logs mydrive | grep "setup link"

Open that link to create the administrator account, then continue to configuration to set up quotas and payment methods.

Upgrading

Terminal window
docker compose pull
docker compose up -d

Always back up the mydrive_data and mydrive_db volumes before upgrading across major versions — see security & backups.