Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions ct/clamav.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main"
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")

# Copyright (c) 2021-2026 community-scripts ORG
# Author: cisox
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
# Source: https://www.clamav.net/

APP="ClamAV"
var_tags="${var_tags:-antivirus;security}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-3072}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified

header_info "$APP"
variables
color
catch_errors

function update_script() {
header_info
check_container_storage
check_container_resources

if [[ ! -f /etc/clamav/clamd.conf ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi

msg_info "Updating ClamAV"
apt_update_safe
upgrade_packages_with_retry clamav clamav-daemon clamav-freshclam
msg_ok "Updated ClamAV"
msg_ok "Updated successfully!"
exit
}

start
build_container
description

msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}clamd is listening for scan requests on TCP port 3310:${CL}"
echo -e "${GATEWAY}${BGN}${IP}:3310${CL}"
39 changes: 39 additions & 0 deletions install/clamav-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Copyright (c) 2021-2026 community-scripts ORG
# Author: cisox
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
# Source: https://www.clamav.net/

source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os

msg_info "Installing ClamAV"
echo "clamav-daemon clamav-daemon/TcpOrLocal select TCP" | debconf-set-selections
echo "clamav-daemon clamav-daemon/TCPSocket string 3310" | debconf-set-selections
echo "clamav-daemon clamav-daemon/TCPAddr string 0.0.0.0" | debconf-set-selections
mkdir -p /etc/systemd/system/clamav-daemon.socket.d
cat <<EOF >/etc/systemd/system/clamav-daemon.socket.d/tcp.conf
[Socket]
ListenStream=3310
EOF
$STD apt install -y \
clamav \
clamav-daemon \
clamav-freshclam
msg_ok "Installed ClamAV"

msg_info "Downloading ClamAV Signatures"
systemctl stop clamav-freshclam
$STD freshclam
systemctl enable -q --now clamav-freshclam clamav-daemon
msg_ok "Downloaded ClamAV Signatures"

motd_ssh
customize
cleanup_lxc
36 changes: 36 additions & 0 deletions json/clamav.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "ClamAV",
"slug": "clamav",
"categories": [
6
],
"date_created": "2026-10-30",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": null,
"documentation": "https://docs.clamav.net/",
"website": "https://www.clamav.net/",
"repository": "https://github.com/Cisco-Talos/clamav",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/clamav.webp",
"description": "ClamAV is an open-source antivirus engine for detecting trojans, viruses, malware and other threats. The clamd daemon serves scan requests over the network, so mail servers, Nextcloud, Paperless-ngx and other apps can use it as their virus scanner, while freshclam keeps the signatures up to date.",
"install_methods": [
{
"type": "default",
"script": "ct/clamav.sh",
"config_path": "/etc/clamav/clamd.conf",
"resources": {
"cpu": 2,
"ram": 3072,
"hdd": 8,
"os": "Debian",
"version": "13"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": []
}
Loading