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
-
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 -
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 -
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. SetDRIVE_WORKER_TOKENandPOSTGRES_PASSWORD(openssl rand -hex 32), andDRIVE_DOCUMENTS_LOCATION=/unused. -
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 -
Create your account
Open
http://<mini-name>.local:5173. In Settings > Library, set the source path to/documentsand the share address tosmb://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.