VMoreCloud›Networking›NetAlertX›Docker Compose Installation
NETWORKING • DOCKER • NETWORK MONITORING

Deploy NetAlertX on a Linux server using a single docker-compose.yml file. This guide covers the folders, the Compose file, first start, updates and common fixes.

Author: Khurram Shahzad
Platform: Linux + Docker
Method: Docker Compose
Level: Beginner
Setup Time: About 15 minutes
Reading Time: 9 minutes

Run NetAlertX the Clean Way: One Compose File, Persistent Data

Docker Compose keeps your NetAlertX settings in a single file you can read, back up and reuse. Start, stop and update the whole stack with one command.

YAMLCOMPOSE
What this tutorial covers You will prepare a Docker host, create the data folders, write a docker-compose.yml for NetAlertX, start it, open the web interface on port 20211 and learn how to update and back it up. New to the tool? Read our overview first: What Is NetAlertX? Features, Setup, and Network Monitoring Guide.
01

One-Command Deploy

Start the container with docker compose up -d.

02

Persistent Data

Config and database live on the host, so upgrades keep your settings.

03

Easy Updates

Pull the new image and recreate the container in two commands.

Introduction

NetAlertX scans your network, keeps an inventory of connected devices and alerts you when something new appears. The project’s quick start uses a long docker run command. That works, but a Docker Compose file is easier to maintain: every option is written down in one place, you can store it in version control and you can recreate the container exactly the same way after an update.

This guide turns the official quick-start command into a Compose file and walks through the full installation. If you want to understand what the tool can detect first, see our NetAlertX features and network monitoring guide.

Check the official docs for your versionThe NetAlertX project has changed its Docker setup between releases. The Compose file below is a direct translation of the current official docker run quick start. Compare it with the project’s Docker installation guide before you deploy, and read the migration guide if you upgrade an older install.

Requirements

  • A Linux host on the network you want to scan, such as a mini PC, a VM or a Raspberry Pi
  • Docker Engine with the Compose plugin (see Docker’s installation guide)
  • Administrator (sudo) access on the host
  • Port 20211 free on the host, or another port you choose
  • A modern browser: the project supports Chrome and Firefox

New to Linux administration? Browse our Linux tutorials for server basics, and our networking guides for IP addressing and VLAN background.

docker run optionCompose equivalent
--network=hostnetwork_mode: host
--restart unless-stoppedrestart: unless-stopped
--cap-add=NET_RAW (and others)cap_add: list
-v /local_data_dir:/datavolumes: entry
--tmpfs /tmp:...tmpfs: entry
-e PORT=20211environment: entry

Step 1: Check Docker and Compose

1

Confirm both tools are installed

Run these commands on the host:

docker --version docker compose version

Both should print a version number. If docker compose is not found, install the Compose plugin from Docker’s documentation.

Step 2: Create the Project and Data Folders

2

Make a folder for the stack

The official notes say the data directory should contain a config and a db folder. Create them next to your Compose file:

mkdir -p ~/netalertx/data/config ~/netalertx/data/db cd ~/netalertx

Everything NetAlertX saves, including its settings and device database, will live in ~/netalertx/data, so it survives container updates.

Step 3: Create the docker-compose.yml File

3

Write the Compose file

Create the file:

nano docker-compose.yml

Paste this content:

services: netalertx: container_name: netalertx image: ghcr.io/netalertx/netalertx:latest network_mode: host restart: unless-stopped cap_add: - NET_RAW - NET_ADMIN - NET_BIND_SERVICE volumes: - ./data:/data - /etc/localtime:/etc/localtime:ro tmpfs: - /tmp:uid=20211,gid=20211,mode=1700 environment: PORT: "20211" APP_CONF_OVERRIDE: '{"GRAPHQL_PORT":"20214"}'

Save and close the file (Ctrl+O, Enter, then Ctrl+X in nano).

What each setting does

SettingPurpose
imageThe official NetAlertX image from the GitHub Container Registry
network_mode: hostLets the container see your LAN so scans can discover devices
restart: unless-stoppedStarts NetAlertX again after a reboot or a crash
cap_addGrants the network permissions needed for low-level scans such as ARP
./data:/dataStores config and database on the host
/etc/localtimeKeeps the container time the same as the host (read-only)
tmpfsA temporary in-memory /tmp owned by user 20211
PORTThe port of the web interface
APP_CONF_OVERRIDEOverrides an app setting, here the GraphQL port

Want a different web port? Change the PORT value, and make sure nothing else on the host uses it.

Step 4: Validate and Start NetAlertX

4

Check the file for mistakes

docker compose config

This prints the final configuration, or an error that points to the problem line. YAML is sensitive to spaces, so indent with spaces, not tabs.

5

Start the container

docker compose up -d

Docker downloads the image and starts NetAlertX in the background.

6

Verify that it is running

docker compose ps docker logs -f netalertx

The status should show the container as running. Press Ctrl+C to leave the log view.

Step 5: Open the Web Interface

7

Browse to NetAlertX

From another computer on the same network, open:

http://SERVER-IP:20211

Replace SERVER-IP with the host’s IP address. The device list fills in as the first scans complete, which can take a few minutes.

Step 6: First-Time Configuration

  • Open Settings and enable the discovery method that matches your network. See the list of methods in our NetAlertX discovery methods overview.
  • Set how often scans run.
  • Add a notification service such as Telegram, ntfy or Pushover so new-device alerts reach you.
  • Name your known devices and mark them, so unknown ones stand out.
  • Secure the interface before you rely on it (see the security section below).

Step 7: Update, Stop and Back Up

Update to the latest image

cd ~/netalertx docker compose pull docker compose up -d

Read the release notes first, especially after a major version change.

Stop or remove the container

docker compose stop docker compose down

down removes the container but keeps your data folder.

Back up your data

The project stores its data in the config and db folders, so copy them regularly:

tar -czf netalertx-backup-$(date +%F).tar.gz -C ~/netalertx data

Store the archive on another disk or machine. For broader backup planning, see our backup and disaster recovery guides.

Security Best Practices

NetAlertX holds a list of every device on your network, so treat its dashboard as an admin tool.

  • Do not expose port 20211 directly to the internet
  • Put the interface behind a reverse proxy that requires authentication
  • Limit access with a host or network firewall
  • Keep the image updated for security fixes
  • Only scan networks that you own or are authorized to monitor
PrivacyBy default, scan data stays on your server. Data leaves your network only if you set up cloud-based notifications or integrations.

Troubleshooting

The page does not load

Check that the container is running with docker compose ps, that the host firewall allows the port, and that you used the right IP and port.

No devices are found

Make sure network_mode: host and the network capabilities are present, and that a scan method is enabled in Settings.

Permission errors on the data folder

The container uses user ID 20211 for its temporary folder. If logs show permission problems, check the ownership requirements in the official Docker guide and adjust the data folder accordingly.

Devices on other VLANs are missing

ARP scanning sees only the local segment. Use the project’s remote-network options or Sync Nodes for other subnets.

Port already in use

Change the PORT value in the Compose file and run docker compose up -d again.

YAML errors

Run docker compose config. Use spaces for indentation and keep the JSON value in quotes.

Still stuck? Check the container logs with docker logs netalertx and search the project’s GitHub issues.

Frequently Asked Questions

Why use Docker Compose instead of docker run?

A Compose file records all your options in one readable file. It is easier to back up, share, change and reuse than a long command.

Which port does NetAlertX use?

In this setup the web interface listens on port 20211, set with the PORT variable.

Why does NetAlertX need host networking?

It must see your local network to discover devices, and the project’s quick start uses host networking for that reason.

Will I lose my data when I update?

No, as long as the ./data folder stays mounted. Back it up before major upgrades.

Can I install it without Docker?

Yes. The project documents a bare-metal installation, a Home Assistant add-on and an Unraid app.

Is NetAlertX free?

Yes, it is open source under the GPL-3.0 license.

Conclusion

With one docker-compose.yml, you now have NetAlertX running as a repeatable, easily updated service. Your configuration and device database sit in a single data folder, and you can restart, update or move the stack with a few commands. The next step is to enable a scan method, add notifications and secure the dashboard so you are alerted to unknown devices quickly.

Quick checklistCheck Docker → Create data/config and data/db → Write docker-compose.yml → docker compose up -d → Open port 20211 → Enable scanning and alerts → Secure and back up.

Keep Learning with VMoreCloud

Find more step-by-step tutorials on networking, Linux, Windows Server, Azure and virtualization.

Browse All Tutorials →

Sources & Further Reading

Khurram Shahzad, Hybrid Cloud & Virtualization Engineer and author at VMoreCloud
👤 About the Author
Khurram Shahzad
Hybrid Cloud & Virtualization Engineer
Hybrid Cloud & Virtualization Engineer specializing in VMware (VCF, vSAN, Aria), Microsoft Azure, AWS, Windows Server, Microsoft 365, Entra ID, Intune, Linux, Nutanix, Proxmox, networking, backup & disaster recovery, Cisco and FortiGate. I share practical technical guides, infrastructure projects and insights to help IT professionals build and manage modern IT environments through VMoreCloud.
🖥️ VMware🔷 Azure☁️ AWS🪟 Windows Server🐧 Linux🗄️ Virtualization🛡️ Cybersecurity🔗 Networking💾 Backup & DR✖️ Nutanix🟠 Proxmox
📄
120+
Articles Published
👥
10K+
Readers
🎓
Learning & Sharing
A Stronger Tech Community
View all articles →
“Learn  |  Build  |  Share”
☁️ VMoreCloud|Tech Knowledge for a Better Tomorrow
IT  •  Cloud  •  Virtualization  •  Security  •  Open Source

Technical note: options and image behaviour can change between NetAlertX releases. This Compose file was adapted from the project’s official docker run quick start, so confirm it against the current documentation and test on a non-critical host before you rely on it.

Leave a Reply

Your email address will not be published. Required fields are marked *