LXC installers for Proxmox VE built on the community-scripts engine.
They use the same menu, defaults, and update command as the official scripts, but are served from this repo.
ct/<app>.sh # runs on the PVE host: LXC specs, creates the container, update logic
install/<app>-install.sh # runs inside the new LXC: installs and configures the app
<app> is APP from the ct script, lowercased with spaces removed (APP="NetAlertX" → netalertx).
# on the PVE host
export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/bitwire-it/pve-scripts/main
bash -c "$(curl -fsSL $COMMUNITY_SCRIPTS_URL/ct/<app>.sh)"
# inside the LXC, to upgrade
updateCOMMUNITY_SCRIPTS_URLis mandatory. Without it the engine looks for the install script in the upstream repo and fails with exit 115.- The URL is saved into
/usr/bin/updatein the LXC, so updates also come from this repo. - The repo must stay public (raw URLs, no token).
Network discovery and new-device alerts. Upstream: https://github.com/netalertx/NetAlertX
| Defaults | Debian 13, unprivileged, 2 vCPU, 1 GB RAM, 6 GB disk |
| URL | http://<ip>:20211 |
| Service | netalertx.service, which runs the backend as www-data (python, :20212 local only), plus nginx and php8.4-fpm |
Install steps (install/netalertx-install.sh)
- Install apt packages: nginx, php8.4-fpm/sqlite3/curl, arp-scan, nmap, fping, nbtscan, snmp, avahi, sqlite3, python3, build-essential, cron
setup_uv, thenfetch_and_deploy_gh_releaseputs the latest GitHub release in/opt/netalertx. The version is recorded in~/.netalertxand/opt/netalertx/.VERSION.- Create the Python venv
/opt/netalertx-venv(system python3) and installrequirements.txt - Symlink
/app→/opt/netalertx(the PHP frontend hardcodes/app) - Write the env file
/etc/netalertx/netalertx.envwith paths,PYTHONPATHandPATH - Create
/usr/local/bin/netalertx-prepare, which runs as root before every service start:- creates
/run/netalertx/{log,api}(tmpfs, rebuilt on each boot) - on first run only, copies
back/app.confto/opt/netalertx_data/config/and builds the DB fromserver/db/schema/app.sql
- creates
- Set
SCAN_SUBNETSto every IPv4 subnet the LXC's NICs are on at install time. Turn on the web login (SETPWD_enable_password=True) with a random password, stored inapp.confas a SHA256 hash. The plain password is saved in/root/netalertx.creds. - Create a PHP-FPM pool
/etc/php/8.4/fpm/pool.d/netalertx.conf(socket/run/php/netalertx.sock, env passed through) - Create the nginx site
/etc/nginx/sites-available/netalertx: :20211,/server/proxied to :20212 with a same-origin check, PHP via the pool - Create the systemd unit
netalertx.servicewithAmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN - Create
/etc/cron.d/netalertx:- every minute,
netalertx-cronrestarts the backend when the UI asks for it - every 6 h, the IEEE OUI vendor database is refreshed
- every minute,
- Do the first vendor DB update, then the standard
motd_ssh,customizeandcleanup_lxc
Upgrade method (update_script() in ct/netalertx.sh)
check_for_gh_releasecompares the latest release with~/.netalertxand stops if they match- Stop
netalertx CLEAN_INSTALL=1 fetch_and_deploy_gh_releasewipes and redeploys/opt/netalertxuv pip install -r requirements.txtinto the existing venv- Rewrite
.VERSIONandbuildtimestamp.txt, thenchown -R www-data /opt/netalertx - Start
netalertxand reload nginx
Kept across upgrades: /opt/netalertx_data (config, DB, OUI file), /opt/netalertx-venv, /etc/netalertx/, the nginx/php/systemd/cron files.
Not touched by upgrades: if a release changes paths or env vars, edit /etc/netalertx/netalertx.env or netalertx-prepare by hand.
Notes
- Multiple VLANs: add one NIC per VLAN, then extend
SCAN_SUBNETSin Settings:Then addpct set <id> -net1 name=eth1,bridge=vmbr0,tag=20,ip=10.20.0.5/24
'10.20.0.0/24 --interface=eth1'. - Whitelist the LXC's IP in the firewall's scan detection and with the MDR/SOC. arp-scan and nmap will trigger alerts.
- Logs:
journalctl -u netalertx,/run/netalertx/log/app.log - Login: one password, no username. Change it in Settings → Set Password, or from the CLI:
Locked out? Set
H=$(printf '%s' 'NewPass' | sha256sum | cut -d' ' -f1) sed -i "s|^SETPWD_password=.*|SETPWD_password='$H'|" /opt/netalertx_data/config/app.conf
SETPWD_enable_password=Falsein the same file. - The backend API on :20212 listens on all interfaces but requires
API_TOKEN(Bearer). For extra hardening, allow only :20211 in the Proxmox firewall for the LXC.
- Copy
ct/netalertx.shtoct/<app>.sh, then setAPP, thevar_*defaults,update_script()and the URL echo at the end. - Create
install/<app>-install.sh. Keep the header block (source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"…update_os) and the footer (motd_ssh,customize,cleanup_lxc). - Keep data out of
/opt/<app>so thatCLEAN_INSTALL=1can safely wipe the app dir on update. - Run
bash -non both files, then test-install on a lab PVE. Add a section above using the same three parts: Install steps, Upgrade method, Notes.