Docs

Mac mini with TrueNAS

Run Drive in Docker on a Mac mini with documents on a TrueNAS share.

Docker mounts the TrueNAS share itself, and the mini builds its own images. Set up the share first as in Run on TrueNAS.

Set up

  1. Prepare the mini

    Use OrbStack or Docker Desktop, set to start at login. In System Settings > Energy, turn on “Start up automatically after a power failure”. Then clone the code.

    git clone https://github.com/sunday-studio/driver ~/drive && cd ~/drive
    
  2. Create the share volume

    Use the TrueNAS IP, not truenas.local, which often does not resolve inside Docker.

    docker volume create --driver local --opt type=cifs --opt device=//192.168.1.50/documents \
      --opt o=username=YOUR_TRUENAS_USER,password=THE_PASSWORD,vers=3.0,uid=0,gid=0,file_mode=0664,dir_mode=0775 \
      drive-truenas-docs
    docker run --rm -v drive-truenas-docs:/d alpine ls /d | head
    
  3. Configure

    cp deploy/.env.example deploy/.env && chmod 600 deploy/.env
    mkdir -p ~/drive-data/{app-data,postgres-data,translation-cache}
    

    In deploy/.env, set the app-data, database, translation and embedding folders under /Users/YOU/drive-data/, never on the share. Set DRIVE_WORKER_TOKEN and POSTGRES_PASSWORD (openssl rand -hex 32), and DRIVE_DOCUMENTS_LOCATION=/unused.

  4. Build and start

    make docker-build
    docker compose --env-file deploy/.env -f deploy/docker-compose.yml -f deploy/docker-compose.truenas-share.yml up -d
    
  5. Create your account

    Open http://<mini-name>.local:5173. In Settings > Library, set the source path to /documents and the share address to smb://truenas.local/documents.

Upgrade and back up

Run make backup every night and copy backups/ to TrueNAS. To upgrade, run make backup, git pull, make docker-build, then the same up -d. See Upgrade.