Docs

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

  1. Mount it on the Drive host

    mkdir -p ~/nas/documents
    mount_smbfs //drive@nas.local/documents ~/nas/documents
    

    For NFS: sudo mount -t nfs -o resvport,vers=4,soft,intr nas.local:/mnt/tank/documents ~/nas/documents.

  2. Point Drive at it

    In deploy/.env, set DRIVE_DOCUMENTS_LOCATION to that folder. Keep DRIVE_APP_DATA_LOCATION and DRIVE_DB_DATA_LOCATION on the host’s own disk, never on the share. Then start as in Run on a server.

  3. Check it

    docker compose --env-file deploy/.env -f deploy/docker-compose.yml exec worker ls /documents
    

    Copy 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.

  1. 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
    
  2. Name the sources

    DRIVE_SOURCES=Scans=/sources/scans;Taxes=/sources/taxes
    

    You 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.