Securing VPS/Servers Vulnerability Detection
How to Install OpenVAS (Greenbone Community Edition) on Ubuntu 24.04 LTS
Set up OpenVAS, now part of Greenbone Community Edition, on Ubuntu 24.04 LTS using the official community containers, then load the feed and run a first scan.
OpenVAS is no longer installed as a single openvas package from a PPA. The scanner is now one component of the Greenbone Community Edition, which also contains the manager daemon (gvmd), a PostgreSQL database, the feed data and the Greenbone Security Assistant (GSA) web interface. This guide sets up the whole stack on Ubuntu 24.04 LTS with Greenbone's official community containers, changes the default password, waits for the vulnerability feed to load and opens the web interface so you can run a first scan.
Ubuntu 16.04 and OpenVAS 8 are both long out of support, and the third-party PPA that older tutorials relied on should not be used. Greenbone documents two installation routes: pre-built containers run with Docker Compose, and a build from source. The containers are the quicker route and are what this guide uses. Greenbone lists Ubuntu 24.04 LTS among the distributions it has tested them on; Ubuntu 26.04 LTS is not on that list yet, although Docker publishes packages for it and the same commands apply because everything runs inside containers.
Only scan hosts you own or have written permission to test. A vulnerability scan sends a large amount of probing traffic and can look like an attack to the target and to your provider.
Requirements
- A server running Ubuntu 24.04 LTS and a user with
sudorights (the examples usedeploy). - Greenbone's stated minimum is 2 CPU cores, 4 GB RAM and 20 GB of free disk space; the recommended size is 4 cores, 8 GB RAM and 60 GB.
- Outbound internet access to pull the container images and feed data.
Greenbone describes the community containers as a way to test and learn the software rather than a production deployment, so treat this as a scanner for your own servers, not a hardened appliance.
Install Docker Engine and the Compose plugin
Install Docker from Docker's own apt repository, which provides the docker compose plugin the Greenbone compose file needs. First add the repository key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Add the repository:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
Install the packages:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Add your user to the docker group so you can run the containers without sudo, then start a new shell with the updated group membership:
sudo usermod -aG docker $USER && su $USER
Logging out and back in has the same effect.
Download the Greenbone compose file
Create a working directory and download the current compose file from the Greenbone documentation site:
export DOWNLOAD_DIR=$HOME/greenbone-community-edition && mkdir -p $DOWNLOAD_DIR
curl -f -O -L https://greenbone.github.io/docs/latest/_static/compose.yaml --output-dir "$DOWNLOAD_DIR"
The DOWNLOAD_DIR variable only exists in the current shell. Run the export part again whenever you open a new session before using the commands below. Greenbone updates this file from time to time, so download it again before each upgrade instead of keeping an old copy.
Start the containers
Pull the images, then start the stack in the background:
docker compose -f $DOWNLOAD_DIR/compose.yaml pull
docker compose -f $DOWNLOAD_DIR/compose.yaml up -d
The compose file starts a set of services: data containers that carry the feed (vulnerability tests, SCAP, CERT and other data), Redis, PostgreSQL, gvmd, the OpenVAS scanner with ospd-openvas, the GSA web application and an nginx front end.
Change the admin password
The stack creates a user admin with the password admin. Replace it straight away. Put your own password between the single quotes; they stop the shell from interpreting characters such as $:
docker compose -f $DOWNLOAD_DIR/compose.yaml \
exec -u gvmd gvmd gvmd --user=admin --new-password='<password>'
Wait for the feed to load
A feed synchronization has two parts: downloading the data (done by docker compose pull) and loading it into the scanner and the database, which the daemons do on their own after start. The first load can take from several minutes to hours. Scans started before it finishes return incomplete results. Follow the logs to see the progress:
docker compose -f $DOWNLOAD_DIR/compose.yaml logs -f
Press Ctrl+C to stop following. The data is ready when the logs contain messages like these:
Updating VTs in database ... done (X VTs).
update_scap_end: Updating SCAP info succeeded
sync_cert: Updating CERT info succeeded.
Open the web interface
The nginx container publishes the web interface on the server's loopback address only: 127.0.0.1:443 and 127.0.0.1:9392. On a desktop machine you would open https://127.0.0.1. On a remote server you have to let nginx listen on the public interface. Open compose.yaml in an editor and make two changes. In the gvm-config service, add the server's host name or IP address under environment:
gvm-config:
environment:
ENABLE_NGINX_CONFIG: true
ENABLE_TLS_GENERATION: true
NGINX_HOST: "203.0.113.10"
NGINX_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER: "https://203.0.113.10"
In the nginx service, replace the two loopback port mappings with a public one:
nginx:
ports:
- 443:443
Leave the other keys of both services as they are, then apply the change:
docker compose -f $DOWNLOAD_DIR/compose.yaml up -d
Browse to https://203.0.113.10. The certificate is generated by the stack itself, so expect a browser warning until you install your own certificate. Sign in as admin with the password you set. Because this exposes a security scanner to the network, restrict port 443 to your own IP address in your provider's firewall. Ports published by Docker bypass the usual ufw rules, so do not rely on ufw alone.
Run a first scan
In GSA, open the Scans menu, go to Tasks and start the task wizard. Enter the IP address or host name of a server you control and start the scan. The task appears in the task list with its progress, and the finished report lists findings by severity with detection details and a suggested fix. For regular use, create a target and a task by hand so you can choose the port list, credentials and schedule.
Update the containers and the feed
The feed is delivered as container images, so updating the feed and updating the software are the same operation. Download a fresh compose.yaml, then pull and restart:
curl -f -O -L https://greenbone.github.io/docs/latest/_static/compose.yaml --output-dir "$DOWNLOAD_DIR"
docker compose -f $DOWNLOAD_DIR/compose.yaml pull
docker compose -f $DOWNLOAD_DIR/compose.yaml up -d
If you edited the compose file for remote access, reapply those edits after downloading the new copy. The daemons load the new feed data on their own; watch the logs as before. To remove the installation with all scan data and start again from nothing, run:
docker compose -f $DOWNLOAD_DIR/compose.yaml down -v
Greenbone's community container guide and its workflows page cover further topics such as command-line access with gvm-tools and setting up your own TLS certificate.
Frequently asked questions
Is OpenVAS the same thing as Greenbone?
OpenVAS is the scanner engine. Greenbone develops it together with the manager, the feed and the web interface, and publishes the open source stack as the Greenbone Community Edition. Greenbone's documentation notes that this stack is also known as OpenVAS, which is why both names are used for the same software.
Can I still install it with apt on Ubuntu?
Greenbone's community documentation does not offer apt packages for Ubuntu. It covers the containers, a build from source, and Kali Linux, which packages the stack itself. If you want the services running directly on the host without Docker, follow Greenbone's source build guide; it is considerably longer because each component is compiled separately.
Why does the web interface show no scan configurations?
The feed has not finished loading. Scan configurations, port lists and report formats are part of the feed data, and scan configurations only appear after gvmd has imported the vulnerability tests. Check the logs for the completion messages and wait; the first import is the slowest.
Can I use Podman instead of Docker?
Greenbone mentions Podman as an alternative to Docker, but its instructions and compose commands are written for Docker. Use Docker unless you are prepared to adapt the commands yourself.