OP OpenPrivateDrive
OP OpenPrivateDrive

Installation and Deployment

Step-by-step guide to deploying OpenPrivateDrive on your own private infrastructure.

01 Recommended: Docker Deployment

The fastest and most reliable way to deploy OpenPrivateDrive is using Docker Compose. This ensures all dependencies (LibreOffice, FFmpeg, etc.) are correctly configured.

Quick Start Command
SECRET_KEY='long-random-secret' ADMIN_PASSWORD='strong-admin-password' docker compose up -d --build

Post-Deployment Details

  • URL: http://server-ip:5350
  • Default Admin: admin
  • Password: The value of ADMIN_PASSWORD
  • Persistent Data: ./data/instance, ./data/storage, ./data/logs

02 Manual Deployment

For bare-metal or customized Linux deployments (Ubuntu 22.04+ recommended), follow these steps:

1. Clone & Dependencies
git clone https://github.com/christophe-cremieux/openprivatedrive.git
cd openprivatedrive
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
2. System Dependencies

Required for previews and thumbnails

sudo apt update
sudo apt install libreoffice ffmpeg python3-magic
3. Initialize App
flask db upgrade
# Admin user is auto-bootstrapped on first run using .env
python run.py

4. Production Gunicorn + Nginx

In production, run the app via Gunicorn behind an Nginx reverse proxy with SSL enabled.

gunicorn --workers 3 --bind 127.0.0.1:5100 run:app

03 Environment Config

Create a .env file in the project root to configure the application behavior:

Variable Description
SECRET_KEY Long random string for session signing.
ADMIN_PASSWORD Password for the initial "admin" user.
STORAGE_PATH Absolute path to private file storage.
DATABASE_URL SQLAlchemy connection string (SQLite supported).
FLASK_ENV Set to "production" for live environments.
SESSION_COOKIE_SECURE Set to "True" when running over HTTPS.

04 Backup & Restore

Regular backups are critical. Both the SQLite database and physical storage must be backed up together to maintain consistency.

Docker Docker Backup & Restore

Use these scripts on the host machine to manage your Docker-based data:

Backup bash scripts/docker_backup.sh
Restore bash scripts/docker_restore.sh my_backup.tar.gz

These scripts handle both the SQLite database and physical storage volumes together for consistency.

Manual Manual Backup & Restore

For manual installs, use the generic backup and restore scripts:

bash scripts/backup.sh bash scripts/restore.sh my_backup.tar.gz

05 Security Checklist

  • Change ADMIN_PASSWORD immediately after first login.
  • Force HTTPS via Nginx and set SESSION_COOKIE_SECURE=True.
  • Use strong random strings for SECRET_KEY.
  • Regularly audit "Public Links" from the Admin Dashboard.
  • Set specific upload extension policies in Admin settings.
  • Verify that STORAGE_PATH is not accessible via web server.

06 Troubleshooting & Features

Common Issues

  • Previews missing: Verify libreoffice and ffmpeg are installed.
  • Upload errors: Check MAX_CONTENT_LENGTH and Nginx client_max_body_size.
  • Database locked: Ensure only one process is accessing the SQLite file.

Key Features to Note

  • Admin Bootstrapping: Admin account created on first start.
  • Password Management: Reset links for users and self-service change.
  • Upload Control: Policy-based extension blocking and link limits.
  • Full Encryption: Zero-knowledge folder and file uploads supported.
Open Source & Self-Hosted

Having trouble with installation?

Our team can handle the entire deployment, security hardening, and backup setup for you.