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 |
How each backend behaves
Section titled “How each backend behaves”- Auto runs
clamdscan --ping 1and caches the answer for 60 seconds. - Daemon fails when
clamdis down. - Clamscan has no background service. It forwards the
MaxFileSize,MaxScanSize,MaxRecursion, andMaxFileslimits fromclamd.confas 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--streaminstead, becauseclamdcannotfstattheir descriptors. - The file list is split across up to 16 parallel
clamdscanworkers, bounded byMaxThreadsinclamd.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
clamdone by one, so they are still scanned. Exclusions and original detection paths are kept.
Set up the daemon
Section titled “Set up the daemon”sudo apt install clamav-daemonsudo systemctl enable --now clamav-daemonclamdscan --ping 1sudo dnf install clamdsudo sed -i 's/^#LocalSocket /LocalSocket /' /etc/clamd.d/scan.confsudo systemctl enable --now clamd@scanclamdscan --config-file=/etc/clamd.d/scan.conf --ping 1ClamUI calls clamdscan --config-file=/etc/clamd.d/scan.conf on Fedora. If the daemon runs but is unreachable, check LocalSocketMode and LocalSocketGroup.
sudo pacman -S clamavsudo systemctl enable --now clamav-daemonclamdscan --ping 1sudo zypper install clamavsudo systemctl enable --now clamdclamdscan --ping 1More on clamd: ClamAV usage docs.
Sockets and exit codes
Section titled “Sockets and exit codes”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.
grep LocalSocket /etc/clamav/clamd.conf # Debian / Ubuntu / Archgrep LocalSocket /etc/clamd.d/scan.conf # FedoraBoth 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.