A lightweight Docker container that acts as an SMB receiver for network scanners (Brother, OKI, Ricoh, etc.) and automatically uploads scanned documents to a WebDAV destination such as Nextcloud, ownCloud, or any WebDAV-compatible server.
Scanner (Brother, OKI…) ──► SMB share ──► scan-gateway ──► WebDAV (Nextcloud…)
- Your scanner sends scanned files to an SMB share exposed by this container
- The container detects new files and uploads them via WebDAV to your destination
- Files appear instantly in Nextcloud (or any WebDAV server) without any manual action
Most entry-level and mid-range network scanners (Brother MFC, OKI MB…) support SMB but not WebDAV natively. This container bridges the gap, allowing you to send scans directly to Nextcloud or any WebDAV server without exposing your Nextcloud data folder over SMB.
- Docker & Docker Compose
- A network scanner with SMB/CIFS scan-to-folder support
- A WebDAV destination (Nextcloud, ownCloud, Apache, etc.)
The container needs its own IP on your LAN to avoid port 445 conflicts with the host (e.g. TrueNAS).
docker network create -d macvlan \
--subnet=192.168.1.0/24 \
--gateway=192.168.1.1 \
-o parent=br0 \
scan-gateway-netReplace
subnet,gatewayandparentinterface (br0,eth0…) to match your network.
Useip link showto find your network interface.
git clone https://github.com/YOUR_USERNAME/scan-gateway-for-nextcloud.git
cd scan-gateway-for-nextcloud
docker build -t scan-gateway:latest .Copy the example compose file and edit it:
cp docker-compose.yml.example docker-compose.ymlEdit docker-compose.yml:
| Variable | Description |
|---|---|
SMB_USER |
Username for the SMB share (used by the scanner) |
SMB_PASSWORD |
Password for the SMB share |
POLL_INTERVAL |
How often (seconds) to check for new files (default: 3) |
DESTINATIONS |
Comma-separated list of destinations (see format below) |
ipv4_address |
A free IP address on your LAN for the container |
smb_folder|webdav_url|webdav_user|webdav_password
Multiple destinations (one SMB share per destination):
office|https://nextcloud.example.com/remote.php/dav/files/admin/Scans/Office/|admin|app-password,
reception|https://nextcloud.example.com/remote.php/dav/files/admin/Scans/Reception/|admin|app-password2
Tip: Use a Nextcloud app password instead of your main password.
https://YOUR_NEXTCLOUD/remote.php/dav/files/USERNAME/Path/To/Folder/
For Group Folders, the path is:
https://YOUR_NEXTCLOUD/remote.php/dav/files/USERNAME/__groupfolders/FOLDER_NAME/
docker compose up -d
docker logs -f scan-gateway| Field | Value |
|---|---|
| Server / Host | IP address of the container (e.g. 192.168.1.250) |
| Share name | The smb_folder name from your DESTINATIONS |
| Username | Value of SMB_USER |
| Password | Value of SMB_PASSWORD |
| Authentication | NTLMv2 |
On TrueNAS SCALE, the physical interface is typically bridged (br0). Use br0 as the parent interface for the macvlan network.
If TrueNAS already uses SMB on port 445, the macvlan approach gives the container its own dedicated IP — no port conflict.
- Brother MFC-J5345DW
- OKI MB492
- Nextcloud AIO (Docker)
- TrueNAS SCALE 24.10 (Electric Eel)
Pull requests welcome! Feel free to open an issue if you have tested with other scanner models or WebDAV servers.
MIT