<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ups on rHomelab</title><link>https://rhomelab.com/tags/ups/</link><description>Recent content in Ups on rHomelab</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 12 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://rhomelab.com/tags/ups/index.xml" rel="self" type="application/rss+xml"/><item><title>Sizing a UPS for Your Homelab (and Setting Up NUT for Automatic Shutdown)</title><link>https://rhomelab.com/hardware/ups-sizing-and-nut-setup/</link><pubDate>Sat, 12 Sep 2026 00:00:00 +0000</pubDate><guid>https://rhomelab.com/hardware/ups-sizing-and-nut-setup/</guid><description>How to size a UPS correctly for your actual homelab load, and how to wire up Network UPS Tools (NUT) so your hosts shut down cleanly instead of just going dark when the power fails.</description><content:encoded><![CDATA[<p>A UPS without a way to talk to your hosts is just an expensive surge protector with a battery in it. It&rsquo;ll keep the lights on for a few minutes, but the moment that battery runs out, every VM and container you&rsquo;re running goes down exactly as hard as it would have without a UPS at all, just a little later. The part that actually protects you, a UPS that tells your hosts &ldquo;power&rsquo;s out, shut down now while you still can,&rdquo; is a separate piece of software most people never get around to setting up. Here&rsquo;s how to size the UPS itself, and how to wire up Network UPS Tools (NUT) so an outage ends in a clean shutdown instead of a dirty one.</p>
<h2 id="what-a-ups-is-actually-protecting-you-from">What a UPS is actually protecting you from</h2>
<p>Two different failure modes get lumped together as &ldquo;power problems,&rdquo; and they call for different responses.</p>
<p>The first is a <strong>true outage</strong>: the grid goes down and stays down. A UPS here buys you time, nothing more. Once the battery&rsquo;s spent, everything goes off unless something shuts it down first. This is the case NUT solves.</p>
<p>The second is <strong>dirty power</strong>: brownouts, voltage sag, a bad surge from a nearby lightning strike, a compressor kicking on and dipping the whole circuit for a second. A decent UPS conditions this transparently, switching to battery for a few seconds or just correcting the voltage, and you never notice. This is the case the UPS solves by just existing, no software involved.</p>
<p>Sizing and NUT matter for the first case. The second case is why you buy a UPS instead of a cheap power strip in the first place, even if you never lose grid power for more than a few seconds a year.</p>
<h2 id="what-actually-breaks-in-an-unclean-shutdown">What actually breaks in an unclean shutdown</h2>
<p>It&rsquo;s worth being specific about why a dirty shutdown is worse than &ldquo;the server was off for a while,&rdquo; because that&rsquo;s the part that justifies spending money and time on this.</p>
<ul>
<li><strong>Filesystem and database corruption.</strong> ZFS is resilient to power loss by design (copy-on-write, no fsck needed), but that protects the filesystem, not necessarily every application on top of it. A database mid-write when power cuts can end up with a corrupted table or a WAL file that won&rsquo;t replay cleanly. Most of the time it recovers. Sometimes it doesn&rsquo;t, and you find out the day you actually need that data.</li>
<li><strong>Proxmox cluster and storage state.</strong> A node that vanishes mid-write to shared storage (Ceph, an NFS-backed datastore) can leave things in a state the rest of the cluster has to work out on its own. Clean shutdowns avoid that entirely.</li>
<li><strong>RAID/array rebuild risk.</strong> An array that was mid-resync or mid-scrub when power dropped has to restart that operation, and a marginal read on a second drive during the restart is how a single power event turns into a lost array. Rare, but it&rsquo;s the scenario every data-hoarder&rsquo;s nightmare starts with.</li>
<li><strong>Silent restart failures.</strong> Some consumer boards and mini PCs default to &ldquo;stay off&rdquo; after a hard power loss unless you&rsquo;ve explicitly set &ldquo;restore last state&rdquo; in the BIOS. A dirty outage plus that one setting equals a homelab that&rsquo;s still dark when you notice, hours or days later.</li>
</ul>
<p>None of this is guaranteed on any single outage. All of it gets more likely the more outages you have, which is exactly the kind of risk that&rsquo;s cheap to eliminate up front and expensive to discover after the fact.</p>
<h2 id="sizing-watts-va-and-runtime">Sizing: watts, VA, and runtime</h2>
<p>UPS capacity is sold two ways, watts and VA (volt-amps), and they aren&rsquo;t the same number. VA is voltage times current; watts account for power factor, which for modern switching power supplies (basically everything in a homelab) runs around 0.9-0.99. A UPS rated &ldquo;1500VA / 900W&rdquo; is telling you the real ceiling is 900W, not 1500. Always size against the watt rating, not the VA number on the box.</p>
<p><strong>Step 1: add up your real load.</strong> Don&rsquo;t guess, measure. A Kill A Watt-style meter or a UPS&rsquo;s own live load reporting (most mid-range and better units expose this through a web UI or management software) will tell you what your gear actually draws, which is usually lower than the sum of every PSU&rsquo;s rated max. A Proxmox host with a handful of VMs and LXCs pulling 100-150W is typical for a single mini-PC or small tower build; a NAS with 6-8 spinning drives adds another 60-100W, more at spin-up. Add your switch, any USB drives, and anything else on the same circuit.</p>
<p><strong>Step 2: pick a runtime target, not a capacity number.</strong> The right question isn&rsquo;t &ldquo;how big a UPS can I afford,&rdquo; it&rsquo;s &ldquo;how many minutes do I actually need.&rdquo; If the goal is a clean, automated shutdown and nothing else, 5-10 minutes of runtime at your real load is plenty, NUT can trigger a shutdown in under a minute of detecting an outage and most hosts finish shutting down well inside that window. If the goal is riding out short outages without shutting down at all (common if you&rsquo;re on a grid that dips for a few minutes but rarely goes fully dark for long), size for 15-30 minutes instead. Don&rsquo;t size for hours unless you have a specific reason, that&rsquo;s a generator-and-transfer-switch problem, not a UPS problem, and a UPS battery big enough to matter at that scale gets expensive and heavy fast.</p>
<p><strong>Step 3: leave headroom, then check runtime at your real load, not the rated load.</strong> Manufacturer runtime numbers are almost always quoted at a much lower load than a unit&rsquo;s max rating, because runtime-per-watt isn&rsquo;t linear, a UPS run near its ceiling drains dramatically faster than the same unit at half load. If you measured 150W of real draw, check the manufacturer&rsquo;s runtime chart at 150W specifically, not the headline &ldquo;up to X minutes&rdquo; figure, which is usually quoted at 20-30% load. As a rule of thumb, sizing for roughly double your actual load gets you into the flat part of the runtime curve and leaves room to add gear later.</p>
<p><strong>A concrete example:</strong> a Proxmox mini PC plus a small NAS pulling a measured 180W combined. A 900W-class UPS (the &ldquo;1500VA&rdquo; line most vendors sell at that tier) run at ~20% load will typically deliver well past the 10-minute mark, more than enough for an automated shutdown with margin. Sizing to roughly double your measured load, not your nameplate load, is what actually gets you predictable runtime instead of a guess.</p>
<h2 id="connectivity-get-a-ups-with-a-data-connection">Connectivity: get a UPS with a data connection</h2>
<p>The sizing above is wasted without a way for a host to know the power&rsquo;s out. Buy a UPS with a USB (or network) management port, not a battery-backup-only model. USB is the simplest and most common path for a home setup, plug it into whichever host will run the NUT server, no extra network config needed. Network-managed UPS units (with their own IP and SNMP/web card) are nicer in a multi-host setup, since NUT can poll the UPS directly over the network, but they cost more and are overkill for a single-rack homelab.</p>
<h2 id="network-ups-tools-nut-the-piece-that-actually-protects-you">Network UPS Tools (NUT): the piece that actually protects you</h2>
<p>NUT is the standard open-source way to monitor a UPS and trigger shutdowns across Linux, BSD, and most hypervisors, including Proxmox. It runs in a client-server model:</p>
<ul>
<li><strong><code>upsd</code></strong> (the server) runs on whichever host is physically connected to the UPS (usually via USB) and talks to it through a driver specific to that UPS&rsquo;s protocol (<code>usbhid-ups</code> covers most modern APC, CyberPower, and Eaton consumer/prosumer units).</li>
<li><strong><code>upsmon</code></strong> (the client) runs on every host that needs to react to a power event, including the same host running <code>upsd</code>. It watches the server and triggers a local shutdown when told to.</li>
</ul>
<p><strong>The basic setup on the host with the USB connection:</strong></p>
<ol>
<li>Install NUT (<code>apt install nut</code> on Debian-based systems, including the Proxmox host shell itself).</li>
<li>Identify the UPS with <code>nut-scanner</code> or check vendor documentation for the right driver name, then set it in <code>/etc/nut/ups.conf</code>:
<pre tabindex="0"><code>[myups]
    driver = usbhid-ups
    port = auto
</code></pre></li>
<li>Configure <code>/etc/nut/upsd.conf</code> to listen (defaults to localhost-only, which is fine for a single-host setup, add <code>LISTEN 0.0.0.0 3493</code> only if other hosts need to poll this one directly over the network).</li>
<li>Set a monitoring user in <code>/etc/nut/upsd.users</code> with a password and the <code>master</code> role.</li>
<li>Point <code>/etc/nut/upsmon.conf</code> at that UPS and user, and set <code>MONITOR myups@localhost 1 monuser password master</code>.</li>
<li>Set <code>MODE=standalone</code> (or <code>netserver</code> if other hosts will poll this one) in <code>/etc/nut/nut.conf</code>, then start and enable <code>nut-server</code> and <code>nut-monitor</code>.</li>
</ol>
<p><strong>For every other host that should shut down on the same outage</strong> (additional Proxmox nodes, a separate NAS, anything sharing the same UPS&rsquo;s circuit), install NUT on each, skip the driver/server config, and set <code>upsmon.conf</code> to <code>MONITOR myups@&lt;server-ip&gt; 1 monuser password slave</code>, with <code>MODE=netclient</code>. When the primary host&rsquo;s <code>upsmon</code> declares the battery critical, every subscribed client shuts itself down too, not just the one physically plugged into the UPS.</p>
<p><strong>Tune the timing, don&rsquo;t leave it on defaults.</strong> <code>upsmon.conf</code>&rsquo;s <code>FINALDELAY</code> and the UPS&rsquo;s own low-battery threshold decide how much warning you get before a forced shutdown. If your runtime budget is 10 minutes, set NUT to initiate shutdown well before the battery actually dies, 3-5 minutes of margin is reasonable so a slow-to-shutdown VM or a container with a stubborn stop hook doesn&rsquo;t get caught out.</p>
<p><strong>Test it before you trust it.</strong> Pull the UPS&rsquo;s input plug (not the battery) with everything running and confirm hosts actually shut down cleanly rather than assuming the config is right. This is the one step people skip and the one that actually matters, a NUT config that&rsquo;s never been tested against a real outage is a guess, not a safety net.</p>
<h2 id="what-this-doesnt-solve">What this doesn&rsquo;t solve</h2>
<p>NUT gets you a clean shutdown, not continued uptime. If keeping services reachable through an outage matters more than avoiding corruption, that&rsquo;s a different, much more expensive problem (a generator, a much larger battery bank, or just accepting the downtime). For almost every home setup, a correctly sized UPS plus a tested NUT shutdown is the right amount of engineering for the actual risk, it turns &ldquo;the power went out and now I&rsquo;m not sure what state my array is in&rdquo; into &ldquo;the power went out and everything shut down exactly the way it would if I&rsquo;d done it by hand.&rdquo;</p>
]]></content:encoded></item></channel></rss>