VPS Tutorials
OpenVAS on a VPS (2026): Greenbone containers, feeds, scans and backups
Set up Greenbone Community Containers on Ubuntu with Caddy HTTPS. Load feeds, secure accounts, run authorized assessments, review reports, and verify persistent backups and rolling updates.

A reachable server can still have vulnerable web components, exposed management ports, weak TLS settings or missing patches. Checking every asset manually is easy to get wrong. OpenVAS/Greenbone brings discovery, vulnerability tests, risk scoring, reports and follow-up into a single interface.
This complete tutorial uses Ubuntu 24.04, Greenbone Community Containers, Docker Compose and Caddy. It covers resources, the official stack, feed loading, administrator credentials, HTTPS, authorized scanning, result review, persistent backups, updates and troubleshooting.
Greenbone explicitly describes its community-container guide as a way to explore current features and learn the product, not a production deployment guide. Use this setup for a personal lab, internal validation, small authorized assessments or evaluation. Organizations needing SLAs, compliance guarantees, high availability or vendor support should evaluate Greenbone Enterprise Appliance or design a supported architecture using the official source-build and operations guidance.
The complete system is often called OpenVAS, but its components have distinct roles:
- OpenVAS Scanner executes vulnerability tests.
- gvmd manages targets, tasks, users, results and PostgreSQL data.
- GSA/gsad provide the browser interface and its API service.
- Greenbone Community Feed supplies vulnerability tests, CVE/CPE data, scan configurations, port lists and report formats.
- Greenbone Community Edition is the full framework built from those components.
Installing OpenVAS therefore means more than starting a scanner. The official stack includes PostgreSQL, Redis, gvmd, GSA, gsad, Nginx, ospd-openvas, OpenVAS Scanner, Notus functionality and several feed containers. The current Compose also includes a PostgreSQL migrator. Identify whether a failure belongs to the web layer, manager, scanner, database or feed instead of reinstalling the entire stack.
| Tool | Main capability | Question answered | Limitations |
|---|---|---|---|
| OpenVAS / Greenbone | Active vulnerability assessment and reports | Which services and possible vulnerabilities are exposed? | Resource/business impact; authorization required |
| Wazuh | Agents, logs, FIM, configuration and endpoint detection | What security activity is happening on hosts? | Not a general network vulnerability scanner |
| Nmap | Discovery, ports and service identification | Which ports are open, and what serves them? | Not a complete vulnerability-management workflow |
OpenVAS actively probes targets; Wazuh continuously collects host security information. They can complement one another: assess exposure, then use the Wazuh guide to monitor logins, file changes, vulnerability inventory and events.
Scanning connects to many ports and sends probes. It can trigger IDS/WAF alerts, account lockouts, rate limits or service problems. Confirm:
- You own the target or hold explicit written authorization.
- Scope covers IPs, domains, ports, time window and permitted intensity.
- Cloud, hosting and application-provider policies allow the assessment.
- Operations and security teams know the schedule.
- Critical targets have current backups, monitoring and a usable rollback plan.
Do not scan random public addresses, neighboring tenants or unapproved customer systems. This guide concerns defensive assessments within an agreed scope; a vulnerability scan is more intrusive than simply viewing an open port.
The official minimum is 2 CPU cores, 4 GB RAM and 20 GB available disk; the recommendation is 4 cores, 8 GB RAM and 60 GB available disk. Feed loading, concurrent scans and report queries compete for CPU, memory and random I/O. Use at least the recommended resources for a sustained evaluation.
| Scope | Suggested starting resources | Notes |
|---|---|---|
| Feature test, one target | 2 vCPU, 4 GB RAM, 40 GB NVMe | Low concurrency; first feed import may be slow |
| Small team, periodic scans of dozens of hosts | 4 vCPU, 8 GB RAM, 80 GB NVMe | Closer to the official recommendation |
| Several networks or many web services | 8 vCPU, 16 GB RAM or more | Measure and cap concurrent tasks |
A public VPS sees public exposure. An internal scanner or one routed through WireGuard can reach private databases and panels. Use separate nodes/tasks for external and internal perspectives so results retain their network context. Do not colocate scanning with critical workloads on a small VPS; CPU, connections and disk activity can affect websites, databases or mail.
Point a domain such as openvas.example.com to the VPS. Remove incorrect AAAA records if IPv6 is unavailable.
Install basic tools and Caddy:
sudo apt update
sudo apt full-upgrade -y
sudo apt install -y ca-certificates curl caddy
docker --version
docker compose version
Install Docker from its official Ubuntu repository. Membership in the docker group grants effectively root-level control; reserve it for trusted administrators or consistently use sudo docker. Install python3 for the port-only check below.
Check host resources and time:
nproc
free -h
df -h
timedatectl status
Low disk space can break PostgreSQL or feed loading. Keep provider rules limited to SSH/HTTP/HTTPS management traffic; scanning does not require public database or internal API ports.
Community Containers follow rolling releases, and the official guide requires the current compose.yaml. Do not claim all components share a single OpenVAS version. Record download time, Compose hash and exact image identities:
sudo install -d -m 750 -o "$USER" -g "$USER" /opt/greenbone-community-edition
cd /opt/greenbone-community-edition
curl -fL https://greenbone.github.io/docs/latest/_static/compose.yaml \
-o compose.yaml
date -Is | tee compose-downloaded-at.txt
sha256sum compose.yaml | tee compose.yaml.sha256
docker compose -f compose.yaml config --quiet
config --quiet with exit code zero confirms parseable configuration. It does not prove operational health. Avoid stale docker-compose.yml files and unverified all-in-one images.
The current Compose binds Nginx HTTPS to 127.0.0.1:443. Since Caddy needs public 443, make a local copy and move upstream HTTPS to 9443:
cd /opt/greenbone-community-edition
cp compose.yaml compose.production.yaml
sed -i 's/127.0.0.1:443:443/127.0.0.1:9443:443/' \
compose.production.yaml
docker compose -f compose.production.yaml config > compose.rendered.yaml
grep -nE '127\.0\.0\.1.*(9443|9392)' compose.rendered.yaml
Keep the rendered configuration private if it includes credentials. Modern Compose uses structured port output; the original grep can miss a valid binding. Confirm 9443 and 9392 bind only to 127.0.0.1 with the port-only check:
docker compose -f compose.production.yaml config --format json | python3 -c '
import json, sys
data = json.load(sys.stdin)
for port in data["services"]["nginx"].get("ports", []):
assert port.get("host_ip") == "127.0.0.1", "nginx must stay on loopback"
assert str(port.get("published")) in ("9443", "9392"), "unexpected nginx port"
print(port.get("host_ip"), port.get("published"), port.get("target"))
'
Check the actual published-port inventory too. A future layout change can prevent sed matching, even when the command exits successfully. Ordinary UFW input rules do not necessarily filter Docker-published ports, so enforce private bindings and test externally.
Pull and start:
cd /opt/greenbone-community-edition
docker compose -f compose.production.yaml pull
docker compose -f compose.production.yaml up -d
docker compose -f compose.production.yaml ps
docker compose -f compose.production.yaml images --digests \
| tee images-with-digests.txt
The source's docker compose images --digests option is not provided by the current Compose images command. Use actual running image IDs and repository digests instead:
docker compose -f compose.production.yaml images -q | sort -u | xargs -r docker image inspect --format '{{.Id}} {{json .RepoDigests}}' > images-with-digests.txt
This records actual builds, while rolling stable or latest tags can change. Keep older images or exported image archives when a recovery plan requires them; a recorded digest does not guarantee the registry will retain the image.
Feed/configuration helpers may finish successfully or remain running after copying files. A completed helper alone does not mean failure. Focus on pg-gvm, gvmd, ospd-openvas, gsad, nginx and redis-server:
docker compose -f compose.production.yaml ps
docker compose -f compose.production.yaml logs --tail=100 pg-gvm
docker compose -f compose.production.yaml logs --tail=100 gvmd
docker compose -f compose.production.yaml logs --tail=100 ospd-openvas
docker compose -f compose.production.yaml logs --tail=100 nginx
curl -kI https://127.0.0.1:9443/
curl -k is only a local self-signed-upstream diagnostic. Do not disable public TLS verification.
Usable scanning requires both downloaded and loaded data:
- Pull updated data-container images.
- Let the scanner and
gvmdload them into memory and databases.
First loading can take minutes to hours. Starting scans early can produce incomplete or incorrect results. Watch:
cd /opt/greenbone-community-edition
docker compose -f compose.production.yaml logs -f ospd-openvas gvmd
Completion messages resemble:
Finished loading VTs. The VT cache has been updated from version X to Y.
Updating VTs in database ... done (X VTs).
update_scap_end: Updating SCAP info succeeded
sync_cert: Updating CERT info succeeded.
Also check feed status in the interface and verify that Full and fast, port lists and report formats exist. Scan configurations require available VT data and a configured Feed Import Owner. Do not use a fixed VT count as proof of completion because feed contents change.
Subsequent container-based feed updates use:
docker compose -f compose.production.yaml pull \
notus-data vulnerability-tests scap-data dfn-cert-data \
cert-bund-data report-formats data-objects
docker compose -f compose.production.yaml up -d \
notus-data vulnerability-tests scap-data dfn-cert-data \
cert-bund-data report-formats data-objects
Background services then import the data. Avoid feed updates during heavy scans or database backups.
The documented initial account is admin / admin. Keep access private and replace it immediately:
cd /opt/greenbone-community-edition
docker compose -f compose.production.yaml exec -u gvmd gvmd \
gvmd --user=admin --new-password='替换为随机强密码'
The preserved password placeholder means “replace with a random strong password”; do not use it literally. Avoid putting a real password in history, Git, screenshots or tickets. A terminal read avoids recording the value in the command line typed into history:
read -r -s -p 'New administrator password: ' gvm_password
printf '\n'
docker compose -f compose.production.yaml exec -u gvmd gvmd gvmd --user=admin --new-password="$gvm_password"
unset gvm_password
The password still exists briefly in the local process arguments; use a trusted administrator terminal. Verify the new login and rejection of old admin. Create individual accounts rather than sharing admin. Protect reports as sensitive data: they reveal software, ports, weaknesses and internal addresses.
Nginx serves internal self-signed HTTPS at 127.0.0.1:9443. Caddy provides trusted external HTTPS. Edit /etc/caddy/Caddyfile:
openvas.example.com {
encode zstd gzip
reverse_proxy https://127.0.0.1:9443 {
transport http {
tls_insecure_skip_verify
}
}
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains"
X-Content-Type-Options "nosniff"
Referrer-Policy "no-referrer"
}
}
tls_insecure_skip_verify skips only the loopback upstream verification. Browsers still verify Caddy's certificate. For stronger verification, trust the internal CA and use the matching upstream server name. Review HSTS includeSubDomains before applying it.
Validate and reload:
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl reload caddy
curl -I https://openvas.example.com/
For personal use, prefer VPN or fixed administrative IP access. A public interface needs strong credentials, individual accounts and additional access controls. See the VPS hardening guide.
PostgreSQL, Redis, gvmd sockets, scanner and internal APIs do not need Internet publication. Allow only management ports:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status numbered
If administrators have stable addresses, restrict 443 by source. Keep an SSH session and provider recovery access while changing UFW. For a listening but unreachable service, use the port/firewall troubleshooting guide.
Inspect listeners:
sudo ss -lntup | grep -E ':80|:443|:9392|:9443'
9443 and 9392 should use 127.0.0.1; public 443 should belong to Caddy.
Start with one noncritical test VPS, not a production database or large subnet.
- Open Configuration → Targets.
- Enter an authorized IP/domain.
- Select a small port list within scope.
- Choose Alive Test based on permitted ICMP, TCP ACK or ARP reachability; ARP is local-network discovery.
- Open Scans → Tasks after saving the target.
- Create a task with
Full and fastand low concurrency. - Start and watch both scanner and target health.
If ping is blocked, the default alive test can misclassify a reachable host. Use an appropriate TCP test or consider the host alive, recognizing the added time and connections. Do not start with /16, all ports and every asset. Validate report accuracy, false positives, performance and notifications on one host first.
Unauthenticated scans observe network exposure, TLS, web services and remotely identifiable software. They cannot inspect many package, patch or local-configuration facts.
For credentialed scans:
- Use a dedicated scanning account.
- Grant only privileges needed for the checks.
- Protect SSH private keys with passphrases and controlled storage.
- Do not store production root credentials in a shared scanner.
- Record creation, rotation, revocation and access.
- Limit credentials so scanner compromise cannot control every host.
For Linux, configure limited SSH access and only the elevation the selected checks require. Validate on a test host first, watching PAM lockouts, Fail2Ban and bastion policies.
CVSS severity is one input, not the complete repair order. For each serious result, check:
- The asset and port belong to the current inventory.
- Software identification is accurate.
- Authentication, configuration and interaction prerequisites.
- Whether the network permits the attack path.
- Distribution backported patches despite an older-looking version.
- Compatibility impact and maintenance window for remediation.
Track confirmed issues, false positives, accepted risk, planned fixes and fixes awaiting retest. Do not share reports publicly or uninstall production components merely because a finding says High. Retest after remediation and verify business functionality. Scanning is a point-in-time view; patch management, logs and configuration baselines remain necessary.
- Avoid backup, deployment, accounting and peak-traffic windows.
- Scan networks and business groups in batches.
- Cap concurrent hosts before expanding ports/tests.
- Observe scanner and target CPU, RAM, connections and latency.
- Alert on aborts, unreachable targets and timeouts.
- Avoid overlapping duplicate tasks against one target.
Duration depends on scope, latency, responses, tests and concurrency. Do not promise every full scan finishes in a fixed number of minutes.
Targets, tasks, accounts, reports and configuration live in PostgreSQL and persistent volumes. compose.yaml alone cannot restore them; volumes on the same disk are not offsite backups.
The source records:
cd /opt/greenbone-community-edition
docker compose -f compose.production.yaml config --volumes \
| tee persistent-volumes.txt
docker compose -f compose.production.yaml images --digests \
| tee images-with-digests.txt
Use the supported image-inspection alternative above in place of its unsupported digest flag. The source's cold-backup example is preserved below. Its hard-coded project prefix can select the wrong volume, and Docker can create an empty volume for a mistaken name:
GVM_DIR=/opt/greenbone-community-edition
GVM_BACKUP_DIR="/srv/backups/greenbone/$(date +%F_%H%M%S)"
sudo install -d -m 700 -o "$USER" -g "$USER" "$GVM_BACKUP_DIR"
cd "$GVM_DIR"
docker compose -f compose.production.yaml down
docker compose -f compose.production.yaml config --volumes \
| while read -r volume; do
full_volume="greenbone-community-edition_${volume}"
docker run --rm \
--mount "type=volume,src=${full_volume},dst=/source,readonly" \
--mount "type=bind,src=${GVM_BACKUP_DIR},dst=/backup" \
alpine:3.22 \
sh -c "tar -C /source -czf /backup/${volume}.tar.gz ."
done
cp compose.yaml compose.production.yaml compose.yaml.sha256 \
compose-downloaded-at.txt images-with-digests.txt "$GVM_BACKUP_DIR"/
sha256sum "$GVM_BACKUP_DIR"/* > "$GVM_BACKUP_DIR/SHA256SUMS"
docker compose -f compose.production.yaml up -d
Use the reviewed cold-backup procedure instead. Pre-pull alpine:3.22 before maintenance; stop new scans and feed updates. It discovers existing volumes from all project containers, validates them before mounting, saves configuration/image identities privately, stops writers and attempts to restart only services that were running:
sudo bash <<'BACKUP'
set -Eeuo pipefail
umask 077
cd /opt/greenbone-community-edition
compose=(docker compose -f compose.production.yaml)
docker image inspect alpine:3.22 >/dev/null
mapfile -t container_ids < <("${compose[@]}" ps -a -q)
mapfile -t running_services < <("${compose[@]}" ps --status running --services)
test "${#container_ids[@]}" -gt 0
test "${#running_services[@]}" -gt 0
install -d -m 0700 /srv/backups/greenbone
backup_dir=$(mktemp -d "/srv/backups/greenbone/$(date -u +%Y%m%dT%H%M%SZ)-XXXXXX")
docker inspect --format '{{range .Mounts}}{{if eq .Type "volume"}}{{println .Name}}{{end}}{{end}}' "${container_ids[@]}" | sed '/^$/d' | sort -u > "$backup_dir/volume-names.txt"
test -s "$backup_dir/volume-names.txt"
while IFS= read -r volume; do docker volume inspect "$volume" >/dev/null; done < "$backup_dir/volume-names.txt"
docker inspect --format '{{.Name}} {{.Config.Image}} {{.Image}}' "${container_ids[@]}" > "$backup_dir/container-images.txt"
docker inspect --format '{{.Name}} {{json .Mounts}}' "${container_ids[@]}" > "$backup_dir/mounts.txt"
mapfile -t image_ids < <(docker inspect --format '{{.Image}}' "${container_ids[@]}" | sort -u)
docker image inspect --format '{{.Id}} {{json .RepoDigests}}' "${image_ids[@]}" > "$backup_dir/image-digests.txt"
"${compose[@]}" config > "$backup_dir/compose.resolved.yaml"
cp -p compose.yaml compose.production.yaml "$backup_dir/"
for file in .env compose.yaml.sha256 compose-downloaded-at.txt; do
if test -f "$file"; then cp -p "$file" "$backup_dir/"; fi
done
cp -p /etc/caddy/Caddyfile "$backup_dir/Caddyfile"
resume_stack() { "${compose[@]}" start "${running_services[@]}" >/dev/null || true; }
trap resume_stack EXIT
"${compose[@]}" stop
while IFS= read -r volume; do
docker run --rm --pull never --network none \
--mount "type=volume,src=$volume,dst=/source,readonly" \
--mount "type=bind,src=$backup_dir,dst=/backup" \
alpine:3.22 tar -czf "/backup/$volume.tar.gz" -C /source .
done < "$backup_dir/volume-names.txt"
(cd "$backup_dir" && sha256sum -- * > SHA256SUMS && sha256sum -c SHA256SUMS)
printf 'Backup directory: %s\n' "$backup_dir"
BACKUP
This covers the default named-volume stack, including PostgreSQL and internal certificates. Add any custom external bind mounts shown in the private mount manifest. Verify services after maintenance even if the restart trap ran. Keep compatible image artifacts; an optional docker image save archive can preserve images that a rolling registry might later remove, with additional disk cost. Store such an archive before calculating its checksum.
Encrypt and copy the entire backup offsite. Restore only to an isolated or confirmed empty destination. Verify relative checksums inside the backup directory, load/select matching images, create destination volumes without starting writers, map each archived source volume to the destination's actual existing volume and restore ownership. Identical logical names do not guarantee identical full names when the project changes. Never unpack over a running PostgreSQL volume. Start with the matched stack and verify login, feed, targets, tasks and historical reports before exposing it. Test rollback as a data-and-image restore when migrations make old images incompatible. See the VPS backup strategy.
- Complete an offsite backup and sample restore before maintenance.
- Download the new
compose.yamlto a separate file. - Compare layouts and reapply the
9443loopback change. - Run
docker compose config --quietagainst the production file using-f compose.production.yaml, then inspect effective ports. - Pull images and record exact identities using the supported inspection command.
- Start and wait for feed loading/migrations.
- Check login, targets, tasks, reports and a test scan.
- Inspect PostgreSQL, gvmd and scanner logs.
Do not run docker compose down -v. -v deletes named volumes; the official guide describes it as starting over with all data removed.
curl -kI https://127.0.0.1:9443/
docker compose -f /opt/greenbone-community-edition/compose.production.yaml ps
docker compose -f /opt/greenbone-community-edition/compose.production.yaml logs --tail=100 nginx gsad gvmd
sudo journalctl -u caddy -n 100 --no-pager
If local 9443 fails, inspect Nginx, GSA, gsad and bindings. If local access works, examine Caddy, DNS, certificates and provider rules.
The official procedure recommends restarting the scanner to rediscover tests:
cd /opt/greenbone-community-edition
docker compose -f compose.production.yaml restart ospd-openvas
docker compose -f compose.production.yaml logs -f ospd-openvas gvmd
Then wait for cache/database completion rather than repeatedly interrupting loading.
Use the official rebuild command:
docker compose -f /opt/greenbone-community-edition/compose.production.yaml \
exec -u gvmd gvmd gvmd --rebuild-gvmd-data=all
Scan configurations require VTs already loaded and the Feed Import Owner configured. Rebuilding repeatedly during synchronization does not fix missing prerequisites.
Check ospd-openvas and inspect after restart:
docker compose -f /opt/greenbone-community-edition/compose.production.yaml \
restart ospd-openvas
docker compose -f /opt/greenbone-community-edition/compose.production.yaml \
logs --tail=200 ospd-openvas gvmd
gvmd may fail to reach PostgreSQL or its socket. The official guide suggests restarting gvmd, then checking database logs:
docker compose -f /opt/greenbone-community-edition/compose.production.yaml restart gvmd
docker compose -f /opt/greenbone-community-edition/compose.production.yaml \
logs --tail=200 gvmd pg-gvm
Check address, DNS, alive test, target firewall and scanner egress. ICMP may be blocked while TCP works, or a private target may be unreachable from the public scanner. Do not disable every target firewall rule to test reachability.
df -h
docker system df
docker volume ls | grep greenbone-community-edition
Distinguish database, feed, logs and images. Do not delete unfamiliar volumes; back up, identify their purpose, then adjust report retention, frequency or storage.
- Only owned or explicitly authorized targets are scanned.
- Compose download time, hash and exact image identities are recorded.
-
9443/9392bind only to127.0.0.1. - Default
admin / adminno longer works. - Trusted HTTPS and restricted administrative sources.
- Initial feed download and database loading complete.
- Noncritical target scan, review and retest verified.
- Dedicated minimum-privilege scan credentials.
- Reports protected as sensitive data.
- Offsite backup successfully restored in isolation.
- Compose compared before updates, without
down -v. - Scanner and target resources/business health monitored.
OpenVAS Scanner executes tests. Community Edition includes scanner, manager, web layer, database and feed. “Install OpenVAS” commonly means deploying the full framework.
Not recommended: the minimum is 4 GB RAM and the recommendation 8 GB. Feed imports, scanning and queries can exhaust a 2 GB host.
After download, ospd-openvas and gvmd must load VT, SCAP, CERT, lists and configurations. Judge completion from logs and feed status, not elapsed time alone.
Only reachable systems you own or are authorized to assess, within hosting/provider policy. Unapproved scans can trigger complaints, suspension or legal consequences.
No. Active periodic assessments and continuous agent/log/FIM monitoring serve different purposes.
Remote identification uses banners or behavior, and distributions backport fixes. Verify packages, advisories, prerequisites and network paths.
Rolling releases require a saved Compose/image baseline, backup, configuration comparison and verification of feed, login, tasks and reports. pull alone does not establish compatibility.
Ordinary down preserves named volumes; down -v deletes them and their data. With or without -v, offsite backups and restore drills are necessary.
Save the official Compose snapshot, restrict the web ports, replace defaults, wait for the feed and scan one authorized test host at low concurrency. Review, remediate and retest before expanding assets.
Managing rolling releases, scan scope/load, accurate reports and recoverable data matters as much as startup. Community Containers serve learning and evaluation; formal production requirements need a matching supported product and architecture.
Official references: