USV at home

Safe Shutdown for TrueNAS Scale and Proxmox using an APC Back-UPS and NUT Remote Shutdown

Many small businesses and homelabs today operate multiple systems at the same time:
a TrueNAS Scale storage server, a Proxmox virtualization host and several
network devices such as routers or switches.

Even a short power outage can cause unclean shutdowns of virtual machines,
ZFS pools or running services. In this article I demonstrate a simple and
reliable setup where TrueNAS Scale acts as the central UPS master and safely
shuts down a Proxmox host over the network.

Goal of this setup

  • Connect the UPS directly to TrueNAS Scale via USB
  • Use Proxmox as a remote monitoring client
  • Automatically shut systems down during power outages
  • Protect VMs and ZFS pools from sudden power loss
  • Keep routers and network devices online as long as possible

Hardware used

  • APC Back-UPS RS 550G
  • TrueNAS Scale
  • Proxmox VE
  • Standard local network

Architecture

UPS (USB)
   │
   └── TrueNAS Scale (NUT Master)
            │
            └── Network
                    │
                    └── Proxmox VE (NUT Client)
  

Configure TrueNAS Scale

The UPS is connected directly to the TrueNAS system via USB.
TrueNAS then operates as the central NUT server.

Enable the UPS service

  • System Settings → Services → UPS
  • UPS Mode: Master
  • Driver: APC ups 2 Back-UPS Pro USB
  • Port: automatically detected

Recommended settings


Shutdown Mode: UPS goes on battery
Shutdown Timer: 30
Host Sync: 15
Power Off UPS: disabled
  

Enable remote monitoring

Important: enable “Remote Monitor” so that other systems
can access the UPS status over the network.

Optional runtime override

Especially with APC Back-UPS devices, runtime estimation can be inaccurate.
A conservative override is therefore recommended.


override.battery.runtime.low = 60
  

Check UPS status


upsc ups@localhost
  

Important values:


battery.runtime
battery.runtime.low
battery.charge
ups.status
  

Configure Proxmox as NUT client

Install NUT


apt update
apt install nut-client
  

/etc/nut/nut.conf


MODE=netclient
  

/etc/nut/upsmon.conf


MONITOR ups@192.168.178.100 1 upsmon fixmepass slave
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h now"
POWERDOWNFLAG /etc/killpower
  

Where:

  • 192.168.178.100 = IP address of the TrueNAS server
  • ups = UPS name
  • upsmon/fixmepass = monitoring user configured in TrueNAS

Enable the service


systemctl enable nut-client
systemctl restart nut-client
  

Test the connection

Port test


nc -zv 192.168.178.100 3493
  

Read UPS status


upsc ups@192.168.178.100
  

Monitor logs


journalctl -f | grep -Ei "ups|nut|shutdown|fsd"
  

Real-world test

After disconnecting the UPS from mains power,
the following sequence should appear:


UPS on battery
→ Shutdown timer starts
→ FSD (Forced Shutdown)
→ Proxmox shuts down
→ TrueNAS shuts down
  

Important findings

  • Low-cost APC Back-UPS devices often provide inaccurate runtime estimations
  • After replacing the battery, the runtime curve may require recalibration
  • A conservative shutdown timer is usually more reliable than percentage indicators
  • 30 seconds is sufficient for many small environments

Conclusion

For small server environments this setup is surprisingly effective.
Even affordable APC Back-UPS models are capable of safely shutting down
TrueNAS and Proxmox systems while protecting data integrity.

Users who later require advanced monitoring, accurate battery analytics
or SNMP integration can easily upgrade to an APC Smart-UPS system.

For homelabs, small offices and private virtualization environments,
the combination of TrueNAS Scale, Proxmox and NUT already provides
a highly reliable and professional solution.

Real-world shutdown event log

The following log shows the actual shutdown sequence during a simulated power outage.
TrueNAS Scale was connected directly to the UPS via USB and acted as the NUT master.
Proxmox was configured as a secondary NUT client over the network.

Timeline

Time System Event Explanation
14:33:05 Proxmox Temporary UPS communication loss Proxmox briefly lost the connection to the TrueNAS NUT server.
This can happen during service restarts or network polling interruptions.
14:33:10 Proxmox UPS communication restored The NUT connection to TrueNAS was re-established successfully.
Remote monitoring was working again.
14:33:50 Proxmox UPS on battery Proxmox received the ONBATT state from TrueNAS.
This means the UPS had switched from mains power to battery operation.
14:34:10 Proxmox Forced shutdown in progress TrueNAS triggered FSD, short for Forced Shutdown.
As a secondary NUT client, Proxmox immediately started its automatic power-fail shutdown.
14:34:10 Proxmox Battery low received The LOWBATT state was also received from the NUT master.
With inexpensive APC Back-UPS models this value can be conservative,
but in this setup the actual shutdown is controlled by the timer.
14:34:10 Proxmox Automatic shutdown started Proxmox executed the configured shutdown command and began shutting down the host
and its virtual machines.
14:34:15 TrueNAS Automatic power-fail shutdown TrueNAS started its own shutdown sequence after triggering the shutdown event
for connected NUT clients.
14:34:20 TrueNAS System poweroff TrueNAS displayed the final system message:
“The system will power off now!”
This confirms that the shutdown process reached the operating system poweroff stage.

Measured shutdown sequence


14:33:50  Proxmox receives ONBATT
14:34:10  Proxmox receives FSD and starts shutdown
14:34:15  TrueNAS starts automatic power-fail shutdown
14:34:20  TrueNAS announces system poweroff
  

Result

The test confirmed that the NUT master/client setup works correctly:
TrueNAS detects the UPS event, triggers the forced shutdown and Proxmox reacts
as expected as a secondary client.

The Proxmox host started shutting down approximately 20 seconds after the ONBATT event.
TrueNAS followed a few seconds later and reached the final poweroff stage.

This behavior is exactly what is desired in a small homelab or office environment:
the virtualization host shuts down first, followed by the storage system.
Network devices such as a router or switch can remain connected to the UPS
and continue running for some additional time.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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