How to Configure and Test UPS Shutdown for a Home Lab
The failure mode is usually discovered the hard way. Power goes out, the UPS kicks in, and your servers keep running on battery. Nothing tells them to…

Research updated Sep 8, 2026
Key topics
The failure mode is usually discovered the hard way. Power goes out, the UPS kicks in, and your servers keep running on battery. Nothing tells them to stop. The battery drains, the lab dies mid-write anyway, and when power returns you are left with a hypervisor that will not come back cleanly or storage that needs a long filesystem check.
A UPS that only keeps gear running is a longer power strip. Turning it into a coordinated shutdown system requires three things to work together: detection, coordination, and recovery. This tutorial walks through each stage, then shows you how to validate the chain with a controlled test so you know it works before a real outage forces the issue.
We will assume you already have a UPS with a management interface—USB, network, or both—and that your main concern is making it shut your lab down safely. If you are still choosing a UPS, sizing comes first; this article focuses on configuration and validation.
What Graceful UPS Shutdown Actually Requires
A UPS buys time. It does not protect data. The moment the battery can no longer hold the load, your servers lose power exactly as if you had pulled the plug—unless something monitored the battery state and triggered an orderly shutdown before that point.
Graceful shutdown for a home lab needs three components working together:
- Detection. The UPS must communicate its state—on battery, battery percentage, estimated runtime—to at least one host. This happens over USB or over the network.
- Coordination. A monitoring agent must decide when to act. That decision is usually a battery percentage threshold, an estimated-runtime floor, or a fixed elapsed time on battery.
- Action. The agent must trigger an orderly OS shutdown, not just cut power. On a multi-host lab, it must trigger shutdowns in the right order.
Recovery matters just as much. When mains power returns, the lab should come back on its own or with a predictable manual step. A setup that shuts down cleanly but hangs on recovery has a different problem than one that never shuts down at all.
If something goes wrong during testing, the failure will fall into one of three classes:
- Configuration errors. Hosts shut down out of order, or not at all.
- Runtime or load problems. The battery dies before the lab finishes shutting down.
- Insufficient power protection. The UPS cannot hold the load even briefly, or the battery is failing.
Each class has a different fix. The controlled test at the end of this tutorial is how you tell them apart.
Choose Your UPS Connection and Monitoring Path
Before configuring anything, decide how the UPS will communicate its battery state to your lab. The right choice depends on your lab layout, not on which option sounds most capable.
USB direct connection. This is the common default. One host—often the NAS or primary server—reads the UPS over USB and acts as the coordinator. That host runs a monitoring agent in server mode, and every other machine on the UPS connects to it over the network. The tradeoff: the coordinator is a single point of failure. If it is down when an outage starts, nothing else learns the UPS is on battery.
Network management card or network-enabled UPS. A UPS with its own network interface lets multiple hosts query it independently. This is useful when no single always-on host should own the shutdown decision, or when you want the UPS itself reachable even if every server is off. The tradeoff is cost and setup complexity. Network cards add expense, and you still need a monitoring agent somewhere to act on the UPS state.
USB host acting as a UPS server. This is the hybrid most home labs end up with: one host owns the USB connection and runs a server daemon, and other hosts run clients that poll it. It works well when you have one machine that is genuinely always on and can be trusted to stay up longest.
The coordinator host matters more than the connection method. It must be the machine that shuts down last, because it is the one telling everything else when to stop. If your NAS is the most reliable always-on box, it is often the right coordinator—but only if it can be configured to shut down after the hosts that depend on it.
For software, you have two viable paths. Vendor tools like APC PowerChute, CyberPower PowerPanel, or Eaton software work well when you run a single-vendor stack and want the bundled option. Network UPS Tools (NUT) is the open-source alternative that spans mixed hardware—an APC UPS protecting a Proxmox host and a TrueNAS box, for example. NUT is the primary example in this tutorial because it does not care which vendor made the UPS, but the same workflow applies to vendor software.
Set Up a UPS Monitor on the Coordinator Host
This tutorial assumes a Linux host—Proxmox, Debian, or similar—with the UPS connected over USB, running NUT in server mode. The exact driver names and configuration directives vary by NUT version and UPS model, so verify against the current documentation for your specific unit. The workflow, however, is consistent.
Step 1: Confirm the OS sees the UPS. Before touching NUT, check that the kernel detected the device. On Linux, look for a USB device node after plugging in the UPS. A missing device node is a common first failure—the cable is bad, the port is dead, or the UPS needs a different cable entirely. If the OS does not see the UPS, no monitoring software will either.
Step 2: Configure the NUT driver. NUT uses a driver per UPS model or family. The driver configuration lives in ups.conf and must match your specific unit. This is where model identification matters: the wrong driver will either fail to start or report nonsense values.
Step 3: Verify the daemon reads real values. Once the driver is running, query the UPS status with the NUT monitor command. You want to see battery percentage, estimated runtime, and line status. A UPS that reports nothing, or reports static defaults, is a configuration problem—not a hardware one. If the values change when you unplug the UPS from the wall, the detection path works.
This is also the point where vendor software earns its keep. If you run a single-vendor stack and the bundled tool detects the UPS automatically, the setup burden is lower. The tradeoff is that vendor software usually only talks to that vendor's hardware. NUT's advantage appears when your lab mixes vendors or when you want one monitoring tool across everything.
Coordinate Shutdown Across Multiple Hosts
A single-host shutdown is straightforward. The real work starts when the UPS protects a NAS, hypervisor nodes, and network gear, and each needs to stop in the right order.
The coordinator runs the UPS server. Every other host runs a client that polls it and triggers its own shutdown when the UPS reports low battery. That is the basic model. The complexity is in the ordering.
Order matters. Storage and hypervisors that host VMs should shut down before the host that tells them to stop. The coordinator should be last. If your NAS holds the VM images and your hypervisor boots from them, the NAS must flush and shut down before the hypervisor loses power—but the hypervisor needs to shut down its guests first. The dependency chain runs from the most dependent service to the least.
On a hypervisor like Proxmox, guests receive a shutdown notification when the host powers off. Whether they shut down cleanly depends on two things: guest agent support inside each VM, and the shutdown timeout configured on the host. A guest without the agent installed will be killed when the timeout expires, which defeats the purpose of graceful shutdown. Check that every VM you care about has the agent running before you trust the sequence.
Network gear—switches, routers, firewalls—usually has no graceful shutdown need. Losing power to a switch mid-outage is fine as long as nothing depends on the network staying up during the shutdown sequence. The one exception is if your shutdown coordination itself runs over the network. If the coordinator tells clients to shut down over the LAN, and the switch powering that LAN is on the same UPS, the switch needs to stay up long enough for the shutdown messages to arrive.
A common mistake: pointing every client at the UPS but leaving the coordinator with no shutdown trigger of its own. The clients shut down, the coordinator keeps running, and the battery drains to empty anyway. The coordinator needs its own trigger, configured to fire after the clients have had time to finish.
Set Shutdown Thresholds That Match Your Runtime
The trigger condition determines when shutdown starts. Three options exist, and each has a failure mode.
Battery percentage. Simple and easy to reason about: shut down at 20 percent, for example. The problem is that percentage is not linear with runtime, and it drifts as the battery ages. A battery at 20 percent may have two minutes of runtime left or ten, depending on its condition and the load.
Estimated runtime. The UPS reports minutes remaining, and you trigger when that number drops below a floor. This is more directly tied to what you actually need—enough time for the slowest host to finish—but runtime estimates are exactly that: estimates. They drift with load and battery age.
Elapsed time on battery. Trigger shutdown after the UPS has been on battery for a fixed period, say 60 seconds. This is predictable and ignores load entirely. It is the right choice when you want to ride out brief blips without shutting down, but it does not account for how fast the battery is actually draining.
Choose by your outage goal and load profile:
- Use elapsed time when your main goal is riding through brief blips and your load is stable. A 60-second delay means a 30-second flicker never triggers a shutdown.
- Use estimated runtime when you have measured your shutdown duration and the UPS reports credible runtime figures under your real load. Set the floor at your measured shutdown time plus generous headroom.
- Use battery percentage only when you know the model's calibration and accept that percentage is a rough proxy. Add a conservative margin—do not trigger at 20 percent if your shutdown takes several minutes and the battery is aging.
The slowest host in the chain sets the floor. If your NAS takes three minutes to flush and shut down cleanly, the trigger must fire at least three minutes before the battery dies. That means you need to know two things: how long the full shutdown sequence takes, and how much runtime the UPS actually provides under your real load.
Test the shutdown duration once, then set the threshold with headroom. If the sequence takes three minutes, do not trigger at five minutes of estimated runtime remaining. Trigger at ten. Batteries lose capacity as they age, and a threshold that worked at install may be dangerously aggressive a year later.
Run a Controlled Outage Test
A controlled test is the only way to know the configuration works. Do not wait for a real outage to find out. But do not make the full battery test your first validation step—a hidden client, guest-agent, or ordering error can turn it into an uncontrolled outage.
Stage 1: Validate each layer without removing power. Confirm the UPS reports live values to the coordinator. Confirm each client can reach the coordinator and sees the UPS state. Then test the shutdown path on one expendable host by invoking its shutdown action manually, without triggering the UPS. This proves the hooks work before you involve the battery.
Stage 2: Run a one-host battery test. If you have a host you can afford to take down, pull mains power to the UPS and confirm that one host receives the on-battery state, triggers its shutdown, and completes it within the expected time. Restore power and confirm recovery. This validates the detection-to-action chain on a small scale.
Stage 3: Run the full integration test. Only after the earlier stages pass should you test the whole lab.
Before the full test, verify the prerequisites. Every host should have its shutdown client configured. The coordinator should have its own trigger, set to fire last. Guest agents should be running inside every VM you expect to shut down cleanly. Confirm all of this before you pull power.
Pull mains power to the UPS, not the UPS output. You want the lab running on battery exactly as it would in a real outage. Unplugging the UPS from the wall simulates the event. Flipping the UPS output switch does not—it cuts power to the lab instantly, which is the failure you are trying to prevent.
Record what you observe. Note the outage start time, when the UPS reports on-battery state, when each host begins shutdown, when each host completes shutdown, and when the coordinator powers off. Compare the total shutdown duration against the runtime the UPS reported at the trigger point. These numbers are what separate a configuration problem from a runtime problem.
Watch the shutdown order. Each host should log a clean shutdown. The sequence should follow your dependency chain: VMs shut down, then the hypervisor, then storage, and the coordinator last. If you have console or log access to the coordinator, watch it report each client going offline.
Restore mains power. Plug the UPS back in and observe recovery. Each host should come back on its own or with the expected manual step. A lab that hangs after power returns has a recovery problem, not a shutdown problem. Recovery configuration—BIOS power-on settings, NUT's behavior when mains returns, service startup ordering—is a separate layer that needs its own validation.
Repeat the test after any change. Configuration changes, battery replacements, new hosts, or a UPS firmware update can all break a sequence that previously worked. The failure modes are different each time, and the test is cheap compared to a corrupted filesystem.
Diagnose What the Test Reveals
The test results tell you which of the three failure classes you are dealing with. Match the symptom to the fix.
Hosts shut down out of order, or not at all. This is a configuration problem. Check the client on each host, the trigger threshold, and the dependency ordering. A host that never receives the shutdown command has a client or network issue. A host that shuts down before its dependent services have stopped has an ordering problem.
The battery dies before the lab finishes shutting down. This is a runtime problem. Either the load is too high for the battery, or the shutdown sequence is too slow. Compare your recorded shutdown duration against the runtime the UPS reported at the trigger point. If the sequence takes longer than the margin you left, raise the trigger threshold or reduce the load. If the UPS runtime estimate collapses faster than expected under load, the battery may be aging.
The UPS cannot hold the lab even briefly, or reports a failing battery. This is a power protection problem, not a software one. A UPS that drops the load seconds after going on battery, or that reports a battery that will not hold a charge, needs a battery replacement or a larger unit. No amount of configuration will fix it.
The lab shuts down cleanly but never recovers. This points to a recovery configuration issue on the hosts. Check BIOS power-on settings, the coordinator's behavior when mains returns, and service startup ordering. Define what successful recovery looks like for each layer: hosts reach the expected power state, storage pools mount cleanly, hypervisor services start, and critical guests come back in dependency order. If only some layers recover, fix those before re-testing.
Each diagnosis has a concrete next action: fix the configuration, reduce the load or raise the trigger, replace the battery, or revisit UPS sizing. The test results tell you which one applies.
When to Keep, Reconfigure, or Upgrade
Once the test passes, you have a decision to make about whether the current setup is done, needs adjustment, or needs a hardware change.
If the lab shuts down cleanly and recovers, the configuration is done. The remaining question is whether the runtime meets your goal. If you only need to survive brief interruptions and protect against mid-write power loss, a short runtime is acceptable. If you want to ride out longer outages, you need more battery capacity—which is a hardware decision, not a configuration one.
If shutdown works but runtime is short, decide what you actually need. Protecting against a two-minute blip is different from surviving a two-hour outage. The first is solved by a modest UPS. The second requires either a larger unit or a reduced load. Do not buy more runtime than your outage goals require.
If the UPS cannot support the lab's real load, or the battery is aging out, replacement is the honest answer. More software tuning will not fix a battery that will not hold a charge or a UPS that is undersized for the load. A battery swap may extend the life of an otherwise good unit; if the UPS itself is the limit, replace it.
A UPS that only protects one host while the rest of the lab is unprotected is a coverage gap. If your NAS is on the UPS but the hypervisor and switch are not, you have not solved the problem—you have moved it. The shutdown sequence only protects the equipment that is actually on battery.
The practical rule: fix configuration first, then runtime, then hardware. And re-test after every change. A home lab UPS shutdown setup is not a one-time configuration. It is a system that needs validation whenever anything in the chain changes—new host, new UPS, new battery, or new software version.
Run the staged test, record the shutdown order and timing, and confirm recovery at every layer. That is the only way to know the lab will survive a real outage with its data intact.


