When the power fails, a UPS gives the Proxmox host time to shut down before its battery runs out, but the host still needs a signal to begin. ZFS does not turn uncommitted guest or application writes into durable data simply because its storage uses copy-on-write. NUT (Network UPS Tools) carries UPS status into the shutdown path. Start by deciding which system owns the USB connection, then verify that status can reach the host and that the host can stop its guests within the available runtime.

1. Choose the UPS Owner

Start with a supported USB or serial UPS interface and a system that can keep the NUT monitor running until shutdown begins. This guide runs NUT directly on the Proxmox host so it owns that shutdown path. A dedicated Linux VM can also collect UPS status, but it needs a separately planned route from that information to a safe host shutdown.

Not every UPS with a USB port supplies the status fields the selected NUT driver needs. lsusb identifying a device is only the first check: scanner output, driver initialization and an on-battery status test must all work. Test with the actual UPS and cable before trusting it. Finally, shutting down a single host gracefully is different from shutting down a whole rack: if the UPS powers multiple machines, you need a network‑aware monitor, not just a local one.

On Proxmox, the big decision is where to run NUT: directly on the hypervisor host or inside a dedicated VM. A full VM does not have Proxmox’s privileged/unprivileged LXC distinction. Running on the host avoids passthrough and lets upsmon call the host shutdown command directly. A VM can receive the UPS USB device and serve its status, but a VM-owned shutdown command that remotely powers off its own hypervisor has ordering and late UPS-poweroff risks. The working shutdown configuration below is host-owned; treat VM passthrough as an alternative data-collection design that needs its own complete host-monitor plan.

2. Install the Packaged Components

From a root shell on the Debian-based Proxmox host, install the packaged NUT components:

apt install nut

The package provides the driver, data server, and monitor. If the distribution starts them automatically, stop the units while configuring them, then restore normal service operation. Keep package updates available for hardware-support and security fixes rather than holding the installation indefinitely.

All the files you need live under /etc/nut/:

  • nut.conf — selects which NUT layers start
  • ups.conf — driver and device definition
  • upsd.conf — data-server listener settings
  • upsd.users — credentials and monitor role
  • upsmon.conf — monitoring and shutdown behavior

For a driver, upsd, and upsmon on the same machine, /etc/nut/nut.conf is required. Its default is MODE=none, which deliberately starts nothing. Set:

MODE=standalone

The official nut.conf reference[1] defines standalone as the local three-layer configuration.

2.1 Identify the USB Device

Before writing a single config line, confirm the UPS is visible on the USB bus. Plug it in and run:

lsusb

Look for a line like Bus 001 Device 003: ID 0463:ffff MGE UPS Systems UPS. That vendor/product pair (here 0463:ffff) is what you’ll use later for passthrough. Next, run the NUT scanner:

nut-scanner -U

For a compatible device, the scanner suggests a driver section. This is an illustrative result for the IDs above; use the output from your own UPS:

[nutdev1]
    driver = "usbhid-ups"
    port = "auto"
    vendorid = "0463"
    productid = "ffff"

If you see nothing or No suitable USB device found, stop and troubleshoot before proceeding. Possibilities include an unsupported device, USB permissions, passthrough, the selected scanner backend, the cable, or a driver conflict; the message alone does not identify which one.

3. USB Passthrough as an Alternative

The host-owned shutdown path above needs no passthrough. If you put the NUT driver and data server in a VM instead, Proxmox can assign the UPS USB device to that VM. This section explains the passthrough mechanics; it does not turn the VM into a safe host shutdown controller by itself.

Identify the USB device on the Proxmox host with lsusb and note the bus and device numbers, e.g., Bus 001 Device 003. Then read the vendor and product IDs (the second line below is example output, not another command):

lsusb -s 001:003
Bus 001 Device 003: ID 0463:ffff MGE UPS Systems UPS

Now add the device to the VM’s configuration. For VM ID 100:

qm set 100 -usb0 host=0463:ffff

The host= syntax matches the vendor/product ID rather than the current bus address. If two identical devices share that ID, select the physical port instead. Verify the assignment after reboot; a passed-through USB device also constrains VM migration.

Inside the guest, verify the device appears:

lsusb

You should see the same vendor:product line. Install and configure the appropriate NUT driver in the guest if you actually choose this architecture. The host cannot simultaneously own the same USB UPS for the main configuration below.

4. Wiring Up NUT: Driver, upsd, and the First Monitor

For the host-owned shutdown path, connect the UPS USB device to the Proxmox host and start with /etc/nut/ups.conf. Define a UPS named ups using the driver and port from the scanner:

[ups]
    driver = usbhid-ups
    port = auto
    desc = "Basement UPS"

For USB HID, port = auto is a required placeholder rather than a serial-port selection. Use vendorid, productid and, when available, a unique serial to select the intended UPS if more than one device matches. Follow the selected driver’s manual rather than assuming every USB UPS uses usbhid-ups. Next, /etc/nut/upsd.conf—keep it locked down. Listen only on localhost unless you have a network‑wide monitoring setup:

LISTEN 127.0.0.1 3493
LISTEN ::1 3493

Keep upsd on loopback for this single-host design. For remote administration, use a shell reached over a VPN such as Tailscale and run upsc ups@localhost on the host; a network NUT server would require an explicit listener, firewall and separate credentials. Then create a dedicated user in /etc/nut/upsd.users that will run the monitor:

[monuser]
    password = a_long_random_string
    upsmon primary

The upsmon primary privilege allows this monitor to coordinate forced shutdown. Older NUT releases called the roles master and slave; current documentation uses primary and secondary. Protect upsd.users and upsmon.conf because they contain the password.

Start NUT through the distribution’s service manager so the components return after a reboot. For packages that install NUT’s systemd driver target, server and monitor units, enable and start those units after all configuration files are in place:

systemctl enable --now nut-driver.target nut-server.service nut-monitor.service
systemctl status nut-driver.target nut-server.service nut-monitor.service

Unit names can differ on older releases; use the units installed by your package rather than leaving manually launched upsdrvctl or upsd processes as the production setup. If the driver reports permissions errors, check the package’s udev rules and that the NUT driver user can access the UPS. Once upsd is running, query the live data:

upsc ups@localhost

The returned variables separate battery estimates from the status flags that drive shutdown:

  • battery.charge — percentage remaining
  • battery.runtime — estimated seconds left
  • ups.status — something like OL (on line) or OB DISCHRG (on battery, discharging)

A missing variable means that field is unavailable through this driver and device; a reported charge of 0 is a value to investigate, not proof of missing support. Check status transitions and driver errors before trusting the readings. A UPS can still publish a usable low-battery status without a runtime estimate. If you need an earlier time-based policy, design and test NUT’s separate upssched timer path; missing telemetry does not justify replacing shutdown coordination with a casual status check.

5. The Host Shutdown Command That Actually Runs

upsmon is the piece that watches the UPS and fires commands when things go wrong. Edit /etc/nut/upsmon.conf and set up the MONITOR line:

MONITOR ups@localhost 1 monuser a_long_random_string primary
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h now"
POWERDOWNFLAG /run/nut/killpower
POLLFREQ 5
POLLFREQALERT 5
FINALDELAY 5

The 1 counts power supplies this UPS feeds on the monitored host, not UPS outlets. With MINSUPPLIES 1, the usual critical condition is OB LB—on battery and low battery—but FSD also requests shutdown. Loss of communication can matter too: after DEADTIME, a UPS last known to be on battery is treated as low battery. The current upsmon.conf reference[2] defines these decisions; an outage and a dead USB cable are not interchangeable test results.

The flag path above is an example that must match your installed late-shutdown integration. NUT recommends a volatile location such as /run; ensure the required directory exists and has the package’s intended permissions. Inspect the installed shutdown hook before enabling the policy: it must recognize the flag, either at the same path or through upsmon -K, and run the appropriate driver shutdown late enough. Do not merely change the path in upsmon.conf while leaving a hook that checks /etc/killpower. Confirm this integration and the UPS’s load-cycle behavior before relying on restart after utility power returns.

The SHUTDOWNCMD above invokes the host’s normal halt path. Configure Proxmox guest startup/shutdown order and timeout settings before testing so the host can stop managed guests. For ordinary local VMs, Proxmox shuts them down in reverse startup order and can stop a VM forcefully if its shutdown timeout expires. Verify that each guest responds to its configured ACPI or guest-agent shutdown path; HA-managed guests require the HA shutdown policy instead of assuming the ordinary boot-order settings apply. Do not replace this with asynchronous qm shutdown commands followed immediately by poweroff. A NUT VM that uses SSH to power off the hypervisor is a different system: it can lose the network or be stopped while the host is still shutting down, and an early UPS load-off command could cut power to guests. Design and test that architecture separately rather than treating a one-line SSH command as a safe substitute. Do not put battery.charge or battery.runtime lines under MONITOR; that syntax is invalid. For the ordinary battery-exhaustion path, upsmon responds to the driver’s critical status rather than accepting arbitrary charge comparisons in MONITOR. Where the device exposes low-battery threshold variables, inspect them with:

upsc ups@localhost battery.charge.low
upsc ups@localhost battery.runtime.low

If the device reports reliable charge/runtime values but its low-battery threshold is unsuitable, NUT supports cautious overrides in the UPS section of ups.conf:

[ups]
    driver = usbhid-ups
    port = auto
    desc = "Basement UPS"
    ignorelb
    override.battery.charge.low = 30
    override.battery.runtime.low = 180

ignorelb ignores the firmware’s LB flag and derives low battery when reported charge or runtime falls below its corresponding threshold. The 30 percent and 180 seconds are the official manual’s illustrative values[3], not a recommended reserve for your host. Use this only with reliable reported values, and set the reserve from the complete shutdown time under representative load, with room for battery aging and estimation error. Keep the original device policy until the replacement has been verified.

Save the working NUT configuration securely and have current guest backups before changing the shutdown policy. A forced-shutdown test is destructive: upsmon -c fsd initiates the real sequence and may turn off the UPS load. Schedule a maintenance window with console access and noncritical workloads; a reassuring USB icon is not a shutdown test.

First verify device persistence after a host reboot, driver startup and upsc status. For an on-battery check, use the UPS manufacturer’s approved test method while maintaining protective earth and keeping the protected equipment connected; do not improvise by pulling a plug whose ground connection the setup requires. Observe the transition from OL to OB without running the battery to exhaustion, and confirm recovery when utility power returns. Check USB or driver faults separately if that transition is missing.

Then, during the planned shutdown test, follow the logs through the monitor’s decision, guest shutdown, host halt and the UPS’s documented load behavior. Proxmox must have enough battery time for the complete guest-and-host sequence, including configured waits, rather than just the slowest guest in isolation. Verify restart after utility power returns as a separate outcome: firmware settings, the UPS driver and late power-off integration all participate. Repeat the relevant acceptance checks after a UPS, cable, package or shutdown-policy change. The useful result is a recorded sequence that completes with reserve, not merely an upsc command that once printed a battery percentage.