Raspberry Pi NUT Server + Windows Client – Step-by-Step Mini Tutorial

1. Flash & Boot your Pi

  1. Flash Raspberry Pi OS Lite (64-bit recommended) to an SD-card.
  2. Enable SSH (create empty ssh file in /boot).
  3. Power up, ssh pi@<local-ip> and update:
    • sudo apt update && sudo apt full-upgrade -y

2. Plug-in & Identify the UPS

Connect the UPS via USB and run:

lsusb

Look for a line like
Bus 001 Device 00X: ID 051d:0002 American Power Conversion …
Note the VendorID (051d) & ProductID (0002).


3. Install NUT on the Pi

sudo apt install nut nut-server nut-client

4. Configure the UPS driver

Edit /etc/nut/ups.conf:

sudo nano /etc/nut/ups.conf

Paste (adjust IDs if different):

[myups]
    driver = usbhid-ups
    port   = auto
    desc   = "APC Back-UPS 950VA"
    vendorid = 051d
    productid = 0002

Save (Ctrl+O, Enter, Ctrl+X).


5. Create NUT users

Edit /etc/nut/upsd.users:

sudo nano /etc/nut/upsd.users

[admin]
    password = secret
    actions  = SET
    instcmds = ALL

6. Tell NUT to act as a server

Edit /etc/nut/nut.conf:

sudo nano /etc/nut/nut.conf

Change:

MODE=netserver

7. Allow LAN clients

Edit /etc/nut/upsd.conf:

sudo nano /etc/nut/upsd.conf

Add:

LISTEN 0.0.0.0 3493

8. Start services

sudo systemctl restart nut-driver@myups
sudo systemctl restart nut-server
sudo systemctl enable nut-server

9. Firewall (optional)

Open port 3493:

sudo ufw allow 3493/tcp

10. Quick smoke-test from Pi itself

upsc myups@localhost

You should see a long list of UPS variables.


11. Install Windows client

  1. Download WinNUT-Client from
    https://github.com/gawindx/WinNUT-Client/releases
    (choose the .exe installer).
  2. Run the installer → reboot if needed.

12. Configure WinNUT

  1. Launch WinNUT-Client.
  2. Connection tab:
    • Host: <ip-of-your-pi>
    • Port: 3493
    • Username: admin
    • Password: secret
    • UPS Name: myups
  3. Shutdown tab → set battery %, runtime, etc.
  4. Click Save & Connect; status should turn green.

13. Pull-the-plug test

  1. Unplug the UPS from mains (keep USB cable).
  2. Within seconds WinNUT should show On Battery.
  3. After your configured thresholds, Windows will gracefully shut down.

14. (Optional) Pretty web dashboard on the Pi

sudo apt install apache2 nut-cgi
sudo nano /etc/nut/hosts.conf

Add:

MONITOR myups@localhost "APC on Pi"

Restart Apache:

sudo systemctl restart apache2

Visit http://<pi-ip>/cgi-bin/nut/upsstats.cgi


15. Done!

Your Pi is now the NUT master and Windows the client.


One-line Service Restart

sudo systemctl restart nut-driver@myups && sudo systemctl restart nut-server

Leave a Reply

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