Skip to content

Scan backends

Set the backend in Preferences → Scanner or with scan_backend in settings.json.

Backend Startup Idle memory Use it when
Auto (default) Daemon if reachable, otherwise clamscan about 50 MB without daemon Most desktops
Daemon Immediate 500 MB to 1 GB for clamd Frequent, scheduled, or large scans
Clamscan Loads definitions every scan (3 to 10 s) about 50 MB Occasional scans, minimal setup, daemon diagnosis
  • Auto runs clamdscan --ping 1 and caches the answer for 60 seconds.
  • Daemon fails when clamd is down.
  • Clamscan has no background service. It forwards the MaxFileSize, MaxScanSize, MaxRecursion, and MaxFiles limits from clamd.conf as CLI options, so both backends scan with the same limits.
Daemon scan internals
  • Files are passed with --fdpass. Files on user-owned FUSE mounts (squashfuse, AppImage /tmp/.mount_*, sshfs, rclone) are sent with --stream instead, because clamd cannot fstat their descriptors.
  • The file list is split across up to 16 parallel clamdscan workers, bounded by MaxThreads in clamd.conf, the CPU count, and the number of files. Their output is merged into one report.
  • Paths of 1,023 bytes or more and names containing line breaks bypass the file list and are passed to clamd one by one, so they are still scanned. Exclusions and original detection paths are kept.
Terminal window
sudo apt install clamav-daemon
sudo systemctl enable --now clamav-daemon
clamdscan --ping 1

More on clamd: ClamAV usage docs.

ClamUI first uses LocalSocket from the configured clamd.conf, then probes:

  • /var/run/clamav/clamd.ctl
  • /run/clamav/clamd.ctl
  • /run/clamd.scan/clamd.sock
  • /var/run/clamd.scan/clamd.sock

Set daemon_socket_path in settings.json to override it.

Find your socket
grep LocalSocket /etc/clamav/clamd.conf # Debian / Ubuntu / Arch
grep LocalSocket /etc/clamd.d/scan.conf # Fedora

Both backends return the standard ClamAV codes: 0 clean, 1 detection, 2 error. Failures: Troubleshooting.

How clamscan, clamd, freshclam and on-access scanning fit together: How ClamAV actually works on your desktop.