Installation
LibreDrive ships as a container image plus a ready-to-use docker-compose.yml in the repository. This guide covers a single-server deployment; for multi-organization 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. Clone the repository and configure .env
git clone https://github.com/iiaanloopez/LibreDrive.gitcd LibreDrivecp .env.example .envEdit .env and set at minimum:
LIBREDRIVE_DOMAIN— the public hostname LibreDrive will be served from.POSTGRES_PASSWORD— a long random password for the bundled Postgres container.LIBREDRIVE_SECRET_KEY— at least 32 random characters; signs JWT access tokens.LIBREDRIVE_ENCRYPTION_KEY— required. Generate withopenssl rand -base64 32.
Everything else in .env.example (quotas, payment providers, storage driver, backups) has a working default — see the configuration reference to change any of it.
The repository’s docker-compose.yml runs two services, libredrive (bound to 127.0.0.1:8080 — a reverse proxy is expected in front of it) and db (Postgres 16), wired together automatically from your .env file. You don’t need to write your own compose file.
3. Start the stack
docker compose up -ddocker compose logs -f libredrive4. Put it behind a reverse proxy with TLS
LibreDrive only listens on loopback (127.0.0.1:8080) by design — put it behind Nginx, Caddy, or Traefik so it’s served over HTTPS. A minimal Caddy example:
drive.example.com { reverse_proxy 127.0.0.1:8080}Caddy will request and renew a Let’s Encrypt certificate automatically.
5. Create the first admin account
On first boot, LibreDrive prints a one-time setup link in the container logs:
No administrator account exists yet. Set one up here: https://drive.example.com/setup?token=...docker compose logs libredrive | grep setupOpen that link to create the administrator account, then continue to configuration to set up quotas and payment methods.
Upgrading
docker compose pulldocker compose up -dAlways back up the libredrive_files, libredrive_backups, and libredrive_db volumes before upgrading across major versions — see security & backups.
Building from source instead of pulling the image
Comment out image: in docker-compose.yml and uncomment the build: block to build the container locally instead of pulling ghcr.io/iiaanloopez/libredrive. For running the API and web app directly on your machine without Docker at all (useful for development), see the development section of the README.