Lightweight web interface for Network UPS Tools.

Docker/Podman:
docker run -p 9000:9000 \
-e UPSD_ADDR=10.0.0.1 \
-e UPSD_USER=test \
-e UPSD_PASS=strongpass \
ghcr.io/superioone/nut_webgui:latest
Container image registries: - Codeberg: codeberg.org/superiorone/nut_webgui:latest - GitHub: ghcr.io/superioone/nut_webgui:latest
In order to run
INSTCMDandFSD, make sure the configured user has the proper privileges inupsd.users. See man(upsd.users).
| Arch | Test Hardware | Notes |
|---|---|---|
| amd64 | AM4 CPU | Works across all amd64 platforms. |
| amd64-v3 | AM4 CPU | Snake-oil level optimizations with AVX. It mostly improves response compression, and TLS. |
| amd64-v4 | Intel® SDE | Snake-oil level optimizations with AVX-512. It mostly improves response compression, and TLS. |
| arm64 | Raspberry Pi 4 Model B | |
| armv7 | Qemu emulation | Uses software floating-point. |
| armv6 | Qemu emulation | Uses software floating-point. |
| riscv64 | Qemu emulation |
amd64 v3 and v4 variants require certain CPU feature flags to run. If you are a crackhead min-max enjoyer (like me), you can use
nut_webgui:latest-amd64-v3andnut_webgui:latest-amd64-v4images. See x86-64 Microarchitecture levels for more details.
nut_webgui can be configured via args, environment variables, or config file. All configuration options are merged into single unified config based on their priority.
CLI arguments hold the highest priority in configuration settings.
--allow-env: Allow application to load configuration from environment
variables.--anonymous-metrics: Set anonymous access on /metrics endpoint, ignored
when auth is disabled. Default is false.--base-path: Override HTTP server base path. Default is /.--config-file: config.toml path.--default-theme: Web UI default theme.--listen: Listen address for the HTTP server. Default is 0.0.0.0.--log-level: Log level for the HTTP server. Default is info.--port: Port used by the HTTP server. Default is 9000.--server-key: Set private server key value. Default is auto-generated value.--with-auth: Enable authentication with user.toml file.--worker-count: Set HTTP server worker count.Environment variables have the second-highest priority in configuration settings. Accepts direct values or file paths (automatically reads file contents).
| Name | Alias (Container Only) | Default | Value Type | Description |
|---|---|---|---|---|
NUTWG__CONFIG_FILE |
CONFIG_FILE |
/etc/nut_webgui/config.toml |
File path | Custom config.toml file path. |
NUTWG__DEFAULT_THEME |
DEFAULT_THEME |
None | See config.toml | Web UI default theme. |
NUTWG__LOG_LEVEL |
LOG_LEVEL |
info |
error, warn, info, debug, trace |
Log level. |
NUTWG__SERVER_KEY |
SERVER_KEY |
/etc/nut_webgui/server.key |
File path, UTF-8 string | Server sign key used for signing session tokens. |
NUTWG__AUTH__ALLOW_ANONYMOUS_METRICS |
false |
true 1 false 0 |
Allow access to /metrics endpoint without API key, ignored when auth is disabled. |
|
NUTWG__AUTH__USERS_FILE |
AUTH_USERS_FILE |
None | File path | Enable authentication with the provided users.toml file. |
NUTWG__HTTP_SERVER__BASE_PATH |
BASE_PATH |
/ |
URI path | Override HTTP server base path. |
NUTWG__HTTP_SERVER__LISTEN |
LISTEN |
0.0.0.0 |
IPv4, IPv6 | HTTP server listen address. |
NUTWG__HTTP_SERVER__PORT |
PORT |
9000 |
1-65535 | HTTP server listen port. |
NUTWG__HTTP_SERVER__WORKER_COUNT |
All CPU cores | 1-usize::MAX | HTTP server worker count. |
If you only connect to a single NUT server and want to keep configurations
simple as possible, connection details can be configured via NUTWG__UPSD__*
environment variables.
| Name | Alias (Container Only) | Default | Value Type | Description |
|---|---|---|---|---|
NUTWG__UPSD__ADDRESS |
UPSD_ADDR |
IPv6, IPv4, hostname | UPS daemon address. | |
NUTWG__UPSD__MAX_CONNECTION |
4 |
1-usize::Max | Allowed maximum connection for UPSD client. | |
NUTWG__UPSD__NAME |
default |
Text | Target namespace for the NUTWG__UPSD__* environment variables. |
|
NUTWG__UPSD__PASSWORD |
UPSD_PASS |
None | Text | UPS daemon password. |
NUTWG__UPSD__POLL_FREQ |
POLL_FREQ |
30 |
1-u64::Max | Non-critical ups variables update frequency in seconds. |
NUTWG__UPSD__POLL_INTERVAL |
POLL_INTERVAL |
2 |
1-u64::Max | Critical ups variables (ups.status) update interval in seconds. |
NUTWG__UPSD__PORT |
UPSD_PORT |
3493 |
1-65535 | UPS daemon port. |
NUTWG__UPSD__TLS_MODE |
UPSD_TLS |
disable |
strict, disable, skip |
Configures TLS communication between UPSD and client. |
NUTWG__UPSD__USERNAME |
UPSD_USER |
None | Text | UPS daemon username. |
The following environment variables are available only to container images and do not apply to binary installations.
| Name | Default | Value Type | Description |
|---|---|---|---|
UPSD_ROOT_CA |
None | Path | Path to the Root CA certificate for TLS. |
UID |
1000 | 1-65535 | User UID running the server. Ignored when container already starts with non-root user via --user option. |
GID |
Value of UID |
1-65535 | User GID running the server. Ignored when container already starts with non-root via --user option. |
Config.toml has the least priority, but it's recommended to use the config file as a baseline configuration and use environment variables and command-line arguments to override settings when needed.
version = "1"
log_level = "info"
default_theme = "tokyo-night"
[http_server]
base_path = "/"
listen = "0.0.0.0"
port = 9000
worker_count = 8
[upsd.default]
username = "admin"
password = "where an old man of Aran goes around and around"
address = "localhost"
port = 3493
max_connection = 4
poll_freq = 30
poll_interval = 2
tls_mode = "disable"
[upsd.reactor]
address = "10.0.12.10"
username = "observer"
password = "AbsoluteSecurity"
[auth]
users_file = "/etc/nut_webgui/users.toml"
allow_anonymous_metrics = false
For more detailed config template see ./dist/config.toml.
The current UniFi NUT server supports up to 3 client connections, and when this limit is exceeded, the server restarts itself. To prevent this issue, set the maximum connection limit to 1 using one of the following methods:
NUTWG__UPSD__MAX_CONNECTION environment variable if you are using
a single NUT servermax_connection in the config.toml fileA simple JSON-based API is available for general-purpose integrations.
OpenAPI 3.0.0 specification files: json | yaml
Real-time UPS events can read via WebSocket at /events. For more details see
Events API.
nut_webgui has basic probe endpoints to check server health and readiness:
- /probes/health
- /probes/readiness
If you've multiple NUT server connections, you can also probe the individual connection:
/probes/health/<namespace>/probes/readiness/<namespace>UPS metrics can be scraped from /metrics endpoint. For more details see the
OpenMetrics.
$ claude mcp add nut_webgui \
-- python -m otcore.mcp_server <graph>