Documents on a NAS
Keep your documents on a NAS share and let Drive read them there.
Drive polls the documents folder every DRIVE_SCAN_INTERVAL (default 30s), so it works on SMB and NFS shares. New files appear after the next scan.
Mount the share
-
Mount it on the Drive host
mkdir -p ~/nas/documents mount_smbfs //drive@nas.local/documents ~/nas/documentsFor NFS:
sudo mount -t nfs -o resvport,vers=4,soft,intr nas.local:/mnt/tank/documents ~/nas/documents. -
Point Drive at it
In
deploy/.env, setDRIVE_DOCUMENTS_LOCATIONto that folder. KeepDRIVE_APP_DATA_LOCATIONandDRIVE_DB_DATA_LOCATIONon the host’s own disk, never on the share. Then start as in Run on a server. -
Check it
docker compose --env-file deploy/.env -f deploy/docker-compose.yml exec worker ls /documentsCopy a file into the share and wait one scan.
To let Drive only read, mount the share read-only and set DRIVE_DOCUMENTS_MODE=:ro and DRIVE_DOCUMENTS_READ_ONLY=true. Uploads in the web app are then refused.
Watch more folders
Mount each extra folder in both api and worker, then name it in DRIVE_SOURCES. Each becomes a top-level folder in Drive.
-
Add the mounts
# deploy/docker-compose.override.yml services: api: volumes: - /mnt/nas/scans:/sources/scans:ro - /mnt/nas/taxes:/sources/taxes:ro worker: volumes: - /mnt/nas/scans:/sources/scans:ro - /mnt/nas/taxes:/sources/taxes:ro -
Name the sources
DRIVE_SOURCES=Scans=/sources/scans;Taxes=/sources/taxesYou can change them later in Settings.
If something is wrong
Files do not appear
Run the ls /documents check above. If it is empty, remount the share, then run docker compose restart worker api. Do the same after the share was down or the Mac slept.