Portainer Templates logo

Portainer Templates

NUTS

Container

Network

Network UPS Tools server

Image details

Pulls: 577k
Architecture: amd64, arm64
Image size: 6 MB
Latest: 2.8.0
User: upshift
Created: Aug 04, 2018
Updated: 4 years ago
Status: active

Configuration

Type
Container
Platform
linux
Image
upshift/nut-upsd
Ports
3493:3493/tcp
Volumes
/app : /portainer/Files/AppData/Config/nuts
Restart
always

Template by xneo1

Standalone Install

Select an install method, to see config/commands for deploying NUTS

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select NUTS, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo

More install options in our documentation.

Network UPS Tools server

Docker image for Network UPS Tools server.

Usage

This image provides a complete UPS monitoring service (USB driver only).
Start the container:
# docker run \
	--name nut-upsd \
	--detach \
	--publish 3493:3493 \
	--device /dev/bus/usb/xxx/yyy \
	--env SHUTDOWN_CMD="my-shutdown-command-from-container" \
	upshift/nut-upsd

Auto configuration via environment variables

This image supports customization via environment variables.

UPSNAME

Default value: ups
The name of the UPS.

UPSDESC

Default value: Eaton 5SC
This allows you to set a brief description that upsd will provide to clients that ask for a list of connected equipment.

UPSDRIVER

Default value: usbhid-ups
This specifies which program will be monitoring this UPS.

UPSPORT

Default vaue: auto
This is the serial port where the UPS is connected.

APIUSER

Default vaue: upsmon
This is the username used for communication between upsmon and upsd processes.

APIPASSWORD

Default vaue: secret
This is the password for the upsmon user.

SHUTDOWNCMD

Default vaue: echo 'System shutdown not configured!'
This is the command upsmon will run when the system needs to be brought down. The command will be run from inside the container.

Serve NUTS on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying nuts.example.com to http://nuts:3493

Add this to your Caddyfile

nuts.example.com {
	reverse_proxy http://nuts:3493
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs nuts
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:3493 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :3493
  • Stop the other service, or pick a different host port. In 3493:3493 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:3493. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, nuts can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 3493

Permission denied on volumes

If the logs show "permission denied", the app can't write to its data folder on the host.

  • Fix the ownership: sudo chown -R 1000:1000 /portainer/Files/AppData/Config/nuts

Image won't pull

Test the pull directly on the host: docker pull upshift/nut-upsd

  • "manifest unknown" means the tag no longer exists. This template uses latest, so try pinning a specific version instead.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm64
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The always restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect nuts --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A single container

NUTS runs as one container, the simplest kind of app here. Just the one image to pull and nothing else wired up alongside it.

The app image

An image is the app packed up ready to go, everything NUTS needs bundled into one download. This template pulls upshift/nut-upsd, which Docker fetches once (about 6 MB) and then starts your own copy from.

Where the image comes from

Docker pulls its images from registries, public libraries of ready-built apps. NUTS's comes from Docker Hub, published by upshift.

Version tags

The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Newest right now is 2.8.0. Pin a specific tag if you would rather stay on one version.

Which machines it runs on

Every image is built for particular CPU types. This one ships for amd64, arm64, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.

Ports

A port is the door the app answers on. A mapping like 3493:3493 means it's reachable on port 3493 of your server, where the left number is yours to change and the right one belongs to the app. It opens:

  • 3493:3493

Volumes

A volume is where NUTS keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:

  • /app from /portainer/Files/AppData/Config/nuts on the host

Restart policy

The restart policy here is always, so Docker brings NUTS back up after a crash and again when the server reboots. Good for anything you want running around the clock. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Networking

Nothing custom is set, so NUTS sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.

Container name

Once it's deployed, Portainer names the container nuts. That's what you'll spot in the containers list and use in commands like docker logs nuts.

Platform

The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set NUTS up. Add the template list to Portainer once, then deploying NUTS is a click rather than a wall of config.