How to Share a Scanner on the Network (SANE and scanservjs: Scan from Any Browser to Paperless)

Scan from any device, no drivers: scanservjs puts the USB scanner on a web page — straight into Paperless.

CUPS (151) shared the printer. The scanner half of a multifunction — or a standalone flatbed — can be shared too: SANE is Linux's scanner layer, and scanservjs puts it behind a web page. Anyone in the house opens a URL, sets paper size and colour, presses Scan, and gets a PDF — on a phone, a Chromebook, a locked-down work laptop. Point its output at Paperless-ngx's consume folder (76) and every scan files itself.

Quick reference

TaskWhat
Does SANE see it?sudo apt install sane-utils -y && scanimage -L
Web appsbs20/scanservjs in Docker with the USB bus passed through
Webhttp://server-ip:8087
Network scanners (AirScan/eSCL)the sane-airscan backend, usually automatic
Output./scans → mount as Paperless's ./consume
Multi-pagescan page by page, the UI collates into one PDF

1. Check the scanner works

Plug it in, then:

sudo apt install sane-utils -y
scanimage -L

device 'genesys:libusb:001:004' is a Canon LiDE 220 flatbed scanner — found. If nothing: many Brother and Epson models need the vendor's SANE backend (brscan4, epsonscan2, from their sites); HP works via hplip. Network scanners that support AirScan/eSCL (most made since 2018) appear through sane-airscan with no driver at all.

sudo usermod -aG scanner $USER
scanimage --format=png -o /tmp/test.png

A test scan to prove it before Docker.

2. scanservjs

mkdir -p ~/docker/scanservjs/{config,scans} && cd ~/docker/scanservjs
nano compose.yaml

services:
scanservjs:
image: sbs20/scanservjs:latest
container_name: scanservjs
ports:
- "8087:8080"
volumes:
- /var/run/dbus:/var/run/dbus
- ./scans:/app/data/output
- ./config:/app/config
devices:
- /dev/bus/usb:/dev/bus/usb
privileged: true
restart: unless-stopped

For a network scanner, privileged and devices aren't needed but network_mode: host helps discovery.

docker compose up -d
sudo ufw allow from 192.168.1.0/24 to any port 8087

Open http://192.168.1.50:8087. The scanner is listed at the top; Preview draws the bed, drag the selection, choose Colour / 300 dpi / A4 / PDF, Scan.

3. Multi-page documents

Set Batch: Manual. Scan page one, swap the sheet, Scan again; repeat; Finish produces one PDF. For a document feeder (ADF), choose the ADF source and it feeds the stack itself.

4. Straight into Paperless

Make scanservjs's output folder Paperless's consume folder. In the Paperless compose file (76), change the consume mount to the same host path:

- /home/john/docker/scanservjs/scans:/usr/src/paperless/consume

(or the other way round — one shared folder). Every scan then appears in Paperless within a minute, OCR'd and tagged. scanservjs can also run a pipeline per scan (config/config.local.js): OCR with Tesseract, deskew, compress, or a post-scan script that copies to a Nextcloud folder.

5. From the phone

The page works on a phone. Add it to the home screen. For "scan from the printer's own button", scanservjs can't catch that — but a phone camera via the Paperless Mobile app covers the away-from-home case.

6. Profiles

Save presets (Settings → Profiles): "Receipt (grey, 200 dpi, PDF, auto-crop)", "Photo (colour, 600 dpi, JPEG)", "Document (grey, 300 dpi, PDF)". One click each.

Troubleshooting

scanimage -L finds it but the container doesn't. USB passthrough missing, or the device's group; privileged: true is the blunt fix. Replug after the container starts if the scanner was asleep.

Scanner busy / "Device busy". Another SANE process (the host's scanimage, or saned) holds it. Only one user at a time.

Blank or black scans. Wrong backend or the lid-open flatbed; try the vendor backend, and the --mode option.

Network scanner not found. airscan-discover lists eSCL devices; add it to /etc/sane.d/airscan.conf by URL if discovery is blocked across VLANs (143).

Wrapping up

SANE sees the scanner, one container exposes it as a web page, the output folder is Paperless's consume folder. Scanning stops needing a particular computer, the phone can do it, and the paperwork files itself.

Call us