Run on TrueNAS
Run Drive on a Linux host with your documents on a TrueNAS SMB share.
Drive runs on a Linux Docker host and mounts the TrueNAS share over SMB. On a Mac mini, see Mac mini with TrueNAS.
Prepare TrueNAS
-
Create the share
Create the dataset
tank/documents(Generic preset), owned by your own TrueNAS user. Add an SMB share nameddocumentswith no guest access. -
Add snapshots
Add an hourly and a daily snapshot task on the dataset.
Mount the share on the Drive host
-
Write the credentials file
sudo install -m 600 /dev/null /etc/drive-smb.cred printf 'username=YOUR_TRUENAS_USER\npassword=THE_PASSWORD\n' | sudo tee /etc/drive-smb.cred >/dev/null -
Mount at boot
Add one line to
/etc/fstab://truenas.local/documents /mnt/truenas/documents cifs credentials=/etc/drive-smb.cred,vers=3.0,uid=0,gid=0,file_mode=0664,dir_mode=0775,_netdev,nofail,x-systemd.automount,x-systemd.requires=network-online.target 0 0sudo mkdir -p /mnt/truenas/documents && sudo systemctl daemon-reload && sudo mount /mnt/truenas/documents -
Start Docker after the mount
Run
sudo systemctl edit docker.serviceand add[Unit]andRequiresMountsFor=/mnt/truenas/documents. -
Check it
docker run --rm -v /mnt/truenas/documents:/d alpine ls /d | head
Start Drive
-
Set the paths
In
deploy/.env, setDRIVE_DOCUMENTS_LOCATION=/mnt/truenas/documents. PointDRIVE_APP_DATA_LOCATION,DRIVE_DB_DATA_LOCATION,DRIVE_TRANSLATION_DATA_LOCATIONandDRIVE_EMBEDDING_DATA_LOCATIONat folders on the host’s own disk, for example under/srv/drive/. Never put them on the share. -
Start the stack
Follow Run on a server. Then, in Settings > Library, set the source path to
/documentsand the share address tosmb://truenas.local/documents. -
Connect Finder
On your Mac, choose Finder > Go > Connect to Server, enter
smb://truenas.local/documents, and add it to Login Items.
Keep SMB on your LAN and never forward port 445 to the internet. Back up Drive’s database too: see Back up and restore.
If something is wrong
Drive shows an empty folder after a reboot
Run docker compose restart worker api once the share is mounted.