How to Add a UPS to an Unraid Server
If you have an Unraid server and you value the hardware and the data it stores, you need to have it plugged into an uninterruptible power supply (UPS). I'm sure its been on your list, but everything is working fine right now... until it isn't.
The purpose of this guide isn't to convince you to do it, but if you're on the fence, its time.
Below I will outline the UPS I use, what outlets to look out for, and the proper Unraid settings. When configured correctly, your server will automatically shut down gracefully in the event of an extended power outage.
Table of Contents
My Favorite UPS
My current go-to UPS is the APC 1500VA BX1500M
- APC Website
- Amazon (Usually cheaper)
Here's why:
1. Replaceable Batteries
The main component of a UPS is a giant rechargeable battery, and all rechargeable batteries wear out. I've owned a number of them over the years, and it drove me crazy every time I threw an entire unit in the garbage (recycled it responsibly). Now I just buy a replacement battery and its like new.
2. High Power Output
When the battery backup kicks in, it will output up to 900 watts. I don't run any combination of equipment off a single UPS that needs that much power, but now I never have to think about it. The older I get, the less I want to micromanage or min/max everything. I have a wife, kids and dogs.
3. Large Power Storage
Since I'm not pushing these to the max, the power bank lasts a long time during an outage. I'm looking at my Unraid stats right now, and it would run for over an hour and a half if I pulled the cord out of the wall.
I currently have two in operation.
Office
This one protects my Unraid server, external backup drives, and a couple networking devices.
Garage
I use the second one in my garage with my mini 3D printer farm. (Farm might be a stretch).
The purpose of highlighting these is to show I actually use these products and speak from experience. So much of the internet today is farm-generated content marketing garbage, but I digress. (I felt a rant coming).
Other UPS Models
If you plan on using a different UPS model with Unraid, make sure you have the following:
- A UPS that provides enough wattage output to run your server and all the other devices you have plugged into the battery backup outlets.
- A data port connector so Unraid and the UPS can talk to each other. If your device supports this, it should have come with your UPS. This functionality is critical for automatic shutdown capabilities in the event of a prolonged power outage. It should look like this:
Battery Backup vs Surge Protection
This isn't going to be a lesson in the difference between battery backup and surge protection, but rather, A WARNING:
READ THE MANUAL! Many UPS devices have battery backup AND surge protection outlets.
That means its possible not all the outlets on your UPS device provide the battery backup protection. Make sure you know which outlets do what.
NOTE: Battery backup outlets will include surge protection. Surge protection outlets WILL NOT include battery backup.
If you're using the same APC BX1500M I showed above, here is what you need to know:
- Green = Battery Backup & Surge Protection
- Red = Surge Protection Only
Unraid UPS Settings
Once you've have your Unraid server running through a battery backup outlet on your UPS, its technically being protected by the battery backup system. What we want to do now is configure Unraid to receive data from the UPS, so it can initiate a graceful shutdown in the event of a prolonged power outage.
1. Connect the Data Port Cable
This is the cable that came with your UPS that I showed above. Mine has a USB plug on one side, and an ethernet plug on the other. Connect the ethernet port to the UPS, and the USB to the Unraid server.
2. Unraid Settings
From the Unraid dashboard, Go to Settings > UPS Settings:
You should see something that looks like this (if its never been enabled before, it may only show the Start option):
The default settings should work for typical setups, so simply changing Start APC UPS Daemon to Yes and hitting Apply should work. If you want a bit more of control over how and when Unraid initiates a shutdown, I suggest toggling the help button in the top-right corner and reading the descriptions of each setting.
3. Confirm its Working
Once enabled, you should see data about the UPS populated at the bottom of this settings page. You can revisit this page anytime to view this. Unraid also gives a quick overview of the UPS status on the dashboard page:
Test Battery Backup
If you're like me and don't trust something you haven't tested, I have a few pointers. First, I need to get this out of the way:
- Buyer Beware
- Use at Your Own Risk
- No Warranty Implied
- I'm just a random guy on the internet
BOTTOM LINE: This is what I've done to test backup systems before, but I was OK if the test went sideways. Make your own decision and don't just follow blindly.
- Battery Charge - Make sure the UPS is fully charged.
- Update Unraid Settings - Change the Battery Level & Runtime Left settings to something high like 90% and 60 minutes. The Runtime Left setting will be dependent on your particular system (battery size, power draw, etc).
- Unplug & Monitor - Unplug the UPS from the wall and babysit the server stats. Verify the server gracefully shuts down when it hits either of those thresholds.
NOTE: Make sure you don't have an SSH connection open or anything else that would typically prevent Unraid from shutting down the array or the system itself before testing.
Final Thoughts
I started my Unraid journey with an old laptop collecting dust. Almost a decade later, its the most expensive collection of hardware in my entire homelab. Not to mention all the data it stores and the services my family relies on daily. I think of my UPS as an insurance policy, and battery replacements are the policy renewals.
If you've had a power failure on an Unraid server before, you know restarting it can be a bit of a puckering experience. Avoid the headaches, and protect it.
Good luck, and feel free to reach out if you have any questions, comments or concerns.