Installing Clam Antivirus on Ubuntu 14.04 Server

Here is how you can install ClamAV on Ubuntu 14.04 server:

root@server:~# apt-get install clamav clamav-daemon -y
root@server:~# freshclam
root@server:~# service clamav-freshclam start
root@server:~# service clamav-daemon start

Perform a test scan:

root@server:~# clamscan /home

----------- SCAN SUMMARY -----------
Known viruses: 3497984
Engine version: 0.98.1
Scanned directories: 1
Scanned files: 0
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 9.583 sec (0 m 9 s)

Logs are located in /var/log/clamav/

Verify via the netstat command that the clamd daemon is properly running and the address of the socket (inet/unix) on which it binds.

root@server:~# netstat -lnp | grep clam

Output should be

tcp        0      0 127.0.0.1:3310          0.0.0.0:*         LISTEN   25726/clamd

or

unix  2      [ ACC ]     STREAM     LISTENING     243718 25495/clamd     /var/run/clamav/clamd.sock

Check the version

root@server:~$ sudo clamdscan -V
ClamAV 0.98.1/19025/Sat May 24 10:04:32 2014