{"id":31029832,"url":"https://github.com/bnhf/nut-plus","last_synced_at":"2026-05-17T00:10:47.525Z","repository":{"id":312282422,"uuid":"1046947985","full_name":"bnhf/nut-plus","owner":"bnhf","description":"Network UPS Tools (NUT) in a Docker container configurable with env vars including e-mail notifications.","archived":false,"fork":false,"pushed_at":"2025-08-29T14:17:53.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T06:07:31.816Z","etag":null,"topics":["docker","nut","ups"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/bnhf/nut-plus","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bnhf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-29T13:42:02.000Z","updated_at":"2025-08-29T14:27:42.000Z","dependencies_parsed_at":"2025-08-29T17:01:50.169Z","dependency_job_id":"8bd37791-7cde-4ee5-8799-aca3c86bb61e","html_url":"https://github.com/bnhf/nut-plus","commit_stats":null,"previous_names":["bnhf/nut-plus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bnhf/nut-plus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhf%2Fnut-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhf%2Fnut-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhf%2Fnut-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhf%2Fnut-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bnhf","download_url":"https://codeload.github.com/bnhf/nut-plus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bnhf%2Fnut-plus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278742508,"owners_count":26037832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","nut","ups"],"created_at":"2025-09-13T22:56:04.741Z","updated_at":"2025-10-07T08:27:27.828Z","avatar_url":"https://github.com/bnhf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nut-plus - Network UPS Tools (NUT) plus E-Mail notifications and WoL support oriented towards use with Portainer\n\nThis Docker implementation of Network UPS Tools is oriented towards use with Portainer via a Docker Compose YAML. Installation can typically be done using only env vars.\n\nThis implementaion includes, e-mail notification support for \"on batt\" and \"online\" UPS events. Integration with bnhf/wolweb is also supported for waking one or more hosts x seconds after power is restored via WoL.\n\nThe YAML below is intended to be self-documenting, and typically requires no editing. The `Environment variables` section of Portainer should be used for all of your installation-specific values:\n\n```yaml\nservices:\n  nut-plus: # This docker-compose typically requires no editing. Use the Environment variables section of Portainer to set your values.\n    # 2025.08.29\n    # GitHub home for this project: https://github.com/bnhf/nut-plus.\n    # Docker container home for this project with setup instructions: https://hub.docker.com/r/bnhf/nut-plus.\n    image: bnhf/nut-plus:${TAG:-latest} # Add the tag like latest or test to the environment variables below.\n    container_name: nut-plus\n    hostname: ${HOSTNAME} # Use a unique hostname here for each NUT instance, and it'll be used instead of the container number in nut-cgi and Email notifications.\n    devices:\n      #- ${NUT_USB:-auto} # This device needs to match what the APC UPS on your APCUPSD_MASTER system uses\n      - ${NUT_SCAN:-/dev/bus/usb} # Parent directory for USB device nodes. Used by nut-scanner to identify connected USB devices.\n    ports:\n      - ${HOST_PORT:-3493}:3493 # The container port number (to the right of the colon) needs to be left as is. Set the environment variable to the same, or change it if there's a conflict.\n    environment:\n      - NUT_MODE=${NUT_MODE:-stanalone} # standalone, netserver or netclient. See https://networkupstools.org/docs/man/nut.conf.html for more info.\n      - NUT_DRIVER=${NUT_DRIVER:-scanner} # Specify a NUT driver to use, or use scanner to let nut-scanner identify the connected UPS.\n      - NUT_USB=${NUT_USB:-auto} # Leave as auto, or specify an override.\n      - MAXAGE=${MAXAGE:-15} # After a UPS driver has stopped updating the data for this many seconds, upsd marks it stale and stops making that information available to clients.\n      - NUT_USER=${NUT_USER:-admin} # The username you'd like to use for this instance of NUT. This user will have full access.\n      - NUT_PASSWORD=${NUT_PASSWORD} # The password you'd like to use for this full access user of NUT.\n      - MASTER_SLAVE=${MASTER_SLAVE} # master if directly connected to the UPS, slave if not.\n      - NUT_SLAVE_USER=${NUT_SLAVE_USER:-upsmon} # The username you'd like to use for slave connections to this instance of NUT. This user will limited access.\n      - NUT_SLAVE_PASSWORD=${NUT_SLAVE_PASSWORD} # The password you'd like to use for this limited access user of NUT.\n      - UPSNAME=${UPSNAME} # Sets a name for the UPS (1 to 8 chars), that will be used by System Tray notifications, apcupsd-cgi and Grafana dashboards\n      - POLLTIME=${POLLTIME} # Interval (in seconds) at which apcupsd polls the UPS for status (default=60)\n      - NOTIFYCMD=${NOTIFYCMD} # upsmon calls this to send messages when things happen.\n      - NOTIFYFLAG_ONBATT=${NOTIFYFLAG_ONBATT} # Leave blank if using LOWBATT shutoff only, EXEC for timed shutoff. Use SYSLOG, WALL or EXEC otherwise. For more than one, join with a plus sign (e.g. SYSLOG+EXEC)\n      - NOTIFYFLAG_ONLINE=${NOTIFYFLAG_ONLINE} # Leave blank if using LOWBATT shutoff only, EXEC for timed shutoff. Use SYSLOG, WALL or EXEC otherwise. For more than one, join with a plus sign (e.g. SYSLOG+EXEC)\n      - NOTIFYFLAG_LOWBATT=${NOTIFYFLAG_LOWBATT} # Leave blank for timed shutoff only. Use SYSLOG or WALL otherwise. For more than one, join with a plus sign (e.g. SYSLOG+WALL)\n      - HOSTSYNC=${HOSTSYNC:-15} # How long upsmon will wait before giving up on another upsmon.\n      - SHUTDOWNCMD=${SHUTDOWNCMD} # upsmon runs this command when the system needs to be brought down.\n      - FINALDELAY=${FINALDELAY:-5} # Last sleep interval before shutting down the system.\n      - CMDSCRIPT=${CMDSCRIPT:-/etc/nut/upssched-cmd} # This script gets called to invoke commands for timers that trigger.\n      - SYSTEM_DELAY_SHUTDOWN=${SYSTEM_DELAY_SHUTDOWN:-90}  # Sets the time in seconds from when a power failure is detected until a system shutdown is initiated (default=120).\n      - UPS_DELAY_SHUTDOWN=${UPS_DELAY_SHUTDOWN:-180} # Sets the time in seconds from when a \"shutdown.return\" is sent to the UPS until it's turned off (default=180).\n      - BATTERY_RUNTIME_LOW=${BATTERY_RUNTIME_LOW} # Sets the threshold in seconds for the UPS to declare \"LB\", resulting in an immediate shutdown being initiated.\n      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc.\n      - UPDATE_CONFIGS=${UPDATE_CONFIGS:-true} # Set this to true to keep all included NUT .conf files updated. Recommended.\n      - SMTP_GMAIL=${SMTP_GMAIL} # Gmail account (with 2FA enabled) to use for SMTP\n      - GMAIL_APP_PASSWD=${GMAIL_APP_PASSWD} # App password for apcupsd from Gmail account being used for SMTP\n      - NOTIFICATION_EMAIL=${NOTIFICATION_EMAIL} # The Email account to receive on/off battery messages and other notifications (Any valid Email will work)\n      - POWER_RESTORED_EMAIL=${POWER_RESTORED_EMAIL} # Set to true if you'd like an Email notification when power is restored after UPS shutdown      \n#      - WOLWEB_HOSTNAMES=${WOLWEB_HOSTNAMES} # Space seperated list of hostnames names to send WoL Magic Packet to on startup\n#      - WOLWEB_PATH_BASE=${WOLWEB_PATH_BASE} # Everything after http:// and before the /hostname required to wake a system with WoLweb e.g. raspberrypi6:8089/wolweb/wake\n#      - WOLWEB_DELAY=${WOLWEB_DELAY} # Value to use for \"sleep\" delay before sending a WoL Magic Packet to WOLWEB_HOSTNAMES in seconds\n    volumes:\n      - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket # Required to support host shutdown from the container\n      - ${HOST_DIR}/nut:/etc/nut # /etc/nut can be bound to a directory or a docker volume\n    restart: unless-stopped\n```\nAnd here's a set of sample env vars, which can be copy-and-pasted into Portainer in `Advanced mode`. In that mode, it's quick-and-easy to modify those values for your use. Refer to the comments in the compose for clarification on how a given variable is used:\n\n```yaml\nTAG=latest\nHOSTNAME=RPi5_nut\nNUT_SCAN=/dev/bus/usb\nHOST_PORT=3493\nNUT_MODE=netserver\nNUT_DRIVER=scanner\nNUT_USB=auto\nMAXAGE=15\nNUT_USER=admin\nNUT_PASSWORD=secret\nMASTER_SLAVE=master\nNUT_SLAVE_USER=\nNUT_SLAVE_PASSWORD=\nUPSNAME=Homelab\nPOLLTIME=15\nNOTIFYCMD=upssched\nNOTIFYFLAG_ONBATT=SYSLOG+EXEC\nNOTIFYFLAG_ONLINE=SYSLOG+EXEC\nNOTIFYFLAG_LOWBATT=\nHOSTSYNC=15\nSHUTDOWNCMD=dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.PowerOff boolean:true\nFINALDELAY=2\nCMDSCRIPT=/etc/nut/upssched-cmd\nSYSTEM_DELAY_SHUTDOWN=120\nUPS_DELAY_SHUTDOWN=200\nBATTERY_RUNTIME_LOW=\nTZ=US/Mountain\nUPDATE_CONFIGS=true\nSMTP_GMAIL=\nGMAIL_APP_PASSWD=\nPOWER_RESTORED_EMAIL=true\nNOTIFICATION_EMAIL=\nHOST_DIR=/data\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnhf%2Fnut-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbnhf%2Fnut-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbnhf%2Fnut-plus/lists"}