A Docker-based SMB scan server for network printers that automatically uploads scanned PDF files to a Nextcloud instance via WebDAV.
Designed for Raspberry Pi, homelab environments, and small business deployments.
Pull the latest image:
docker pull pascalbott/scan2nextcloud:latest
Docker Hub repository:
https://hub.docker.com/r/pascalbott/scan2nextcloud
Clone the repository:
git clone https://github.com/pascalbott/scan2nextcloud.git
cd scan2nextcloud
Create your environment configuration:
cp .env.example .env
Edit the .env file and configure your values.
Start the container:
docker compose up -d
View logs:
docker logs -f scan2nextcloud
version: "3.8"
services:
scan2nextcloud:
image: pascalbott/scan2nextcloud:latest
container_name: scan2nextcloud
ports:
- "445:445"
volumes:
- ./data/scan:/scan
- ./data/uploaded:/uploaded
env_file:
- .env
restart: unless-stopped
This project uses environment variables via a .env file.
Example .env.example:
SMB_USER=scanner
SMB_PASS=ChangeMeSecurePassword
NEXTCLOUD_URL=https://cloud.example.com
NEXTCLOUD_USER=nextcloud_user
NEXTCLOUD_PASS=NEXTCLOUD_APP_PASSWORD
NEXTCLOUD_FOLDER=Documents/Scans
Important:
.env file.NEXTCLOUD_USER.You can also run the container directly:
docker run -d -p 445:445 -v $(pwd)/data/scan:/scan -v $(pwd)/data/uploaded:/uploaded --env-file .env pascalbott/scan2nextcloud:latest
WebDAV endpoint format:
https://DOMAIN/remote.php/dav/files/USERNAME/FOLDER/PATH
Example:
https://cloud.example.com/remote.php/dav/files/nextcloud_user/Documents/Scans
Server:
192.168.0.150
Share:
scan
Username:
scanner
Password:
YourSMBPassword
Network path:
\\192.168.0.150\scan
Example filename:
20260220_153012_scan.pdf
For production deployments:
Printer → SMB → Docker Container → WebDAV → Nextcloud
MIT License recommended for open source distribution.
Content type
Image
Digest
sha256:5d0b493d1…
Size
131.9 MB
Last updated
7 months ago
docker pull pascalbott/scan2nextcloud