# Power Outage Problems and Solutions: UPS NUT SERVER SETUP & WEBNUT UI with Docker

We have 1 ups so far.

root@rack2:~# lsusb

```bash
lsusb
```

  
Bus 002 Device 002: ID 8087:8002 Intel Corp. 8 channel internal hub  
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  
Bus 001 Device 004: ID 413c:a001 Dell Computer Corp. Hub  
Bus 001 Device 005: ID 051d:0003 American Power Conversion UPS  
Bus 001 Device 002: ID 8087:800a Intel Corp. Hub  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@rack2:~# sudo apt install nut nut-client nut-server

```bash
sudo apt install nut nut-client nut-server
```

root@rack2:~# sudo nut-scanner -U

```bash
sudo nut-scanner -U
```

  
Scanning USB bus.  
\[nutdev1\]  
 driver = "usbhid-ups"  
 port = "auto"  
 vendorid = "051D"  
 productid = "0003"  
 product = "Smart-UPS SRT FW:UPS 05.3 / ID=1010"  
 serial = "AS1841190039"  
 vendor = "American Power Conversion"  
 bus = "001"

root@rack2:~# sudo cp /etc/nut/ups.conf /etc/nut/ups.example.conf

```bash
sudo cp /etc/nut/ups.conf /etc/nut/ups.example.conf
```

  
root@rack2:~# sudo nano /etc/nut/ups.conf

```bash
sudo nano /etc/nut/ups.conf
```

```bash
pollinterval = 1
maxretry = 3

[apc-ups]
    driver = usbhid-ups
    port = auto
    desc = "APC Smart-UPS"
    vendorid = 051D
    productid = 0003
    serial = AS1841110039
```

```bash
sudo nano /etc/nut/upsmon.conf
```

```bash
RUN_AS_USER root
MONITOR apc-ups@localhost 1 admin secret master
```

```bash
sudo nano /etc/nut/upsd.conf
```

```bash
LISTEN 0.0.0.0 3493 
```

```bash
sudo nano /etc/nut/nut.conf
```

```bash
MODE=netserver
```

```bash
sudo nano /etc/nut/upsd.users
```

```bash
[monuser]
  password = secret
  admin master
```

root@rack2:~# sudo service nut-server restart  
root@rack2:~# sudo service nut-client restart  
root@rack2:~# sudo systemctl restart nut-monitor  
root@rack2:~# sudo upsdrvctl stop  
root@rack2:~# sudo upsdrvctl start

```bash
sudo service nut-server restart
sudo service nut-client restart
sudo systemctl restart nut-monitor
sudo upsdrvctl stop
sudo upsdrvctl start
```

root@rack2:~# upsc [apc-ups@localhost](mailto:apc-ups@localhost)

```
 upsc apc-ups@localhost 
```

```bash
upsc apc-ups@localhost battery.charge
```

Now proceed to install client web ui on other machine:

here is the docker compose file:

```yaml
services:
  nut:
    image: edgd1er/webnut
    container_name: webnut
    environment:
      - UPS_HOST=your-host.local.lan
      - UPS_PORT=3493
      - UPS_USER=admin
      - UPS_PASSWORD=secret
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - nginxproxymanager_default
    ports:
      - 6543:6543
networks:
  nginxproxymanager_default:
    external: true
```

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-02/scaled-1680-/Rqbimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-02/Rqbimage.png)

[![image.png](https://wiki.kyluat.com/uploads/images/gallery/2025-02/scaled-1680-/iaIimage.png)](https://wiki.kyluat.com/uploads/images/gallery/2025-02/iaIimage.png)

Next step is your programming still with nut client api that you are familiar with like nodejs: