Sorry, your browser does not support JavaScript!
Sign In

Self-Hosted Energy Monitoring with Docker

Self-Hosted Energy Monitoring with Docker

A self-hosted energy monitoring system keeps the monitoring server and electricity data under your control. Instead of sending every reading to a public cloud, the energy meter uploads data to a Docker container running on a local server, NAS, Raspberry Pi or compatible router.

IAMMETER-Docker provides a ready-to-run local energy monitoring server for electricity consumption and solar PV systems. It can collect measurements, display real-time and historical data, expose APIs and optionally operate as an offline datalogger.

IAMMETER energy meter
        │
        │ Wi-Fi / local network
        ▼
IAMMETER-Docker
        │
        ├── Local web dashboard
        ├── Historical energy data
        ├── REST API
        ├── MQTT
        ├── CSV datalogger
        └── Optional forwarding

IAMMETER-Docker is a practical self-hosted option, but it does not reproduce every feature and report in IAMMETER-Cloud. If you are still choosing an architecture, compare the options on the self-hosted energy monitoring solutions page.

🎬 Watch the IAMMETER-Docker video tutorial

1. When Should You Use a Self-Hosted Energy Monitoring System?

IAMMETER-Docker is suitable when you want to:

  • keep energy data on a server you manage;
  • monitor electricity on a LAN without depending on Internet access;
  • deploy a local solar monitoring dashboard;
  • collect data at a remote site using an offline datalogger;
  • access measurements through a local REST API or MQTT;
  • forward selected data to another platform;
  • build a private dashboard or integration around stored energy data.

Typical installations include:

  • home electricity and solar PV monitoring;
  • workshops, offices and small commercial sites;
  • remote solar systems and equipment rooms;
  • development and testing environments;
  • projects where a local data path is required.

If you only need direct meter readings for Home Assistant, Node-RED, a PLC or custom software, deploying a complete server may be unnecessary. See local and self-hosted integration options before choosing.

2. What You Need

Before deployment, prepare:

  • a device that can run Docker, such as a Linux server, NAS, Raspberry Pi or compatible router;
  • persistent storage for the application database;
  • TCP port 5050 available for the web application and API;
  • TCP port 1883 if the built-in MQTT service will be used;
  • a stable IP address or DHCP reservation for the Docker host;
  • an IAMMETER energy meter, or another data source that can submit the supported API format.

The Docker host and meter should be able to reach each other over the local network. For offline operation, Internet access is not needed after the image and required software have been installed.

3. Deploy IAMMETER-Docker

The current Docker Hub release is IAMMETER-Docker V2.4.

3.1 Option A: Docker run

Create a working directory and run the container with persistent storage:

docker run -d \
  --name myiammeter \
  --restart always \
  -p 5050:5050 \
  -p 1883:1883 \
  -e TZ=Etc/UTC \
  -v "$PWD/data:/app/data" \
  iammeter/iammeter

Change TZ=Etc/UTC to the correct timezone for the monitoring site. Energy reports depend on the local date and time, so set this before collecting production data.

3.2 Option B: Docker Compose

Create compose.yaml:

services:
  iammeter:
    image: iammeter/iammeter
    container_name: myiammeter
    restart: always
    ports:
      - "5050:5050"
      - "1883:1883"
    environment:
      TZ: Etc/UTC
    volumes:
      - ./data:/app/data

Start the service:

docker compose up -d

Check its status:

docker compose ps
docker compose logs --tail=100 iammeter

3.3 Open the local dashboard

Open the following address from a browser on the same network:

http://<docker-host-ip>:5050

Default credentials:

Username: testuser
Password: 123456

Change the default password immediately. Do not expose port 5050 or 1883 directly to the public Internet without an appropriate firewall, authentication and secure network design.

IAMMETER-Docker login

4. Initial Configuration

After signing in:

  1. Create a Place for the home, solar site or monitored facility.
  2. Add a Meter.
  3. Enter the meter serial number (SN).
  4. Select the correct single-phase or three-phase meter type.
  5. Assign each phase or channel as Grid, Inverter or Load.
  6. Confirm the site timezone and measurement structure before evaluating reports.

Configure a meter in IAMMETER-Docker

Correct channel assignment is especially important for solar monitoring. The system needs to know which measurement represents the grid, inverter or load before it can display meaningful energy-flow results.

5. Connect an IAMMETER Energy Meter

IAMMETER meters can upload directly to the local Docker server.

In the meter's WebUI, configure third-party HTTP upload and use the Docker host address:

<docker-host-ip>:5050/api/v1/sensor/uploadsensor

The Docker host IP must be reachable from the meter's Wi-Fi network. Use the same meter SN that was added to IAMMETER-Docker.

Configure HTTP upload to IAMMETER-Docker

After saving the meter configuration:

  1. wait for the first upload;
  2. confirm that the meter appears online in IAMMETER-Docker;
  3. compare voltage, power and energy values with the meter's local data;
  4. verify the direction and channel assignment before relying on solar or import/export calculations.

Use IAMMETER-Cloud at the same time

IAMMETER-Docker can optionally forward meter data to IAMMETER-Cloud. Enable forwarding only when you want both local storage and IAMMETER-Cloud services.

Forward local data to IAMMETER-Cloud

For an offline or cloud-independent installation, leave cloud forwarding disabled.

6. Upload Data from Another Device or Application

IAMMETER-Docker can also receive supported energy data through its REST API. This is useful for simulators, gateways or customer applications that do not use an IAMMETER meter.

Create a meter with a custom SN, then use that same SN in each API request.

The interactive API documentation is available on the local server:

http://<docker-host-ip>:5050/docs

IAMMETER-Docker API documentation

Test an IAMMETER-Docker API request

Test the API on a non-production meter first. Keep the SN, phase count, field order and units consistent so that historical data remains usable.

7. Run an Offline Energy Datalogger

IAMMETER-Docker V2.4 can save data to CSV when a datalogger directory is mounted. This is useful for a remote solar site, factory or equipment room with no reliable Internet connection.

Docker run with datalogger storage

docker run -d \
  --name myiammeter \
  --restart always \
  -p 5050:5050 \
  -p 1883:1883 \
  -e TZ=Etc/UTC \
  -v "$PWD/data:/app/data" \
  -v "$PWD/datalogger:/app/datalogger" \
  iammeter/iammeter

For Docker Compose, add this volume:

volumes:
  - ./data:/app/data
  - ./datalogger:/app/datalogger

Open the datalogger page at:

http://<docker-host-ip>:5050/datalogger

The datalogger page initially uses:

Username: admin
Password: admin

Change this password as part of deployment. For the complete router-based and CSV-export workflow, see Offline Energy Datalogger with IAMMETER-Docker.

8. MQTT and Other Advanced Features

Port 1883 is used by the IAMMETER-Docker MQTT service. A meter or another application can publish supported measurement data to IAMMETER-Docker, and MQTT clients can subscribe to real-time values.

IAMMETER-Docker also supports features such as:

  • MySQL instead of the default local database for larger datasets;
  • MQTT publishing and subscription;
  • PVOutput forwarding;
  • compatible Tasmota energy data;
  • real-time alarms and one-second datalogger scenarios.

These features are intentionally kept out of the basic deployment path. Configure and test the core container first, then continue with the advanced IAMMETER-Docker guide.

9. Back Up Your Energy Data

The /app/data volume contains persistent application data. Back up the corresponding host directory regularly.

A safe basic process is:

  1. stop or pause writes to the container;
  2. copy the complete mounted data directory to backup storage;
  3. include the datalogger directory when CSV logging is enabled;
  4. retain more than one backup generation;
  5. test restoration on a separate container before depending on the backup plan.

Do not treat the container filesystem as permanent storage. If /app/data is not mounted, removing the container may remove the monitoring database with it.

10. Upgrade IAMMETER-Docker

Before upgrading, back up the persistent data directory.

For Docker Compose:

docker compose pull
docker compose up -d
docker compose logs --tail=100 iammeter

For a container created with docker run:

  1. record the existing ports, timezone and volume mounts;
  2. pull the new image;
  3. stop and remove the old container;
  4. create the container again with the same persistent volume;
  5. verify login, meter status and historical data.
docker pull iammeter/iammeter
docker stop myiammeter
docker rm myiammeter

Then repeat the original docker run command. Removing a container is safe only when the application data has been stored in a correctly mounted and backed-up host directory.

11. Troubleshooting

The web page does not open

  • Confirm the container is running with docker ps or docker compose ps.
  • Check whether host port 5050 is already in use.
  • Review container logs.
  • Confirm that the firewall permits access from the local network.

The meter does not appear online

  • Confirm that the meter can reach the Docker host IP.
  • Check the upload URL and port.
  • Confirm that the SN in IAMMETER-Docker matches the meter SN.
  • Avoid using localhost as the server address in the meter; it refers to the meter itself, not the Docker host.
  • Confirm that client isolation or a guest Wi-Fi network is not blocking LAN traffic.

Solar data looks incorrect

  • Verify CT direction and wiring.
  • Confirm which channel is assigned to Grid and which is assigned to Inverter.
  • Check the sign of active power during import and export.
  • Confirm the timezone before comparing daily energy totals.

Data disappears after recreating the container

  • Confirm that /app/data was mounted to a persistent host directory.
  • Check directory permissions.
  • Restore the latest verified backup if the original volume is unavailable.

12. IAMMETER-Docker, IAMMETER-Cloud or a Custom System?

Option Best for Data location Setup effort Main trade-off
IAMMETER-Docker A ready-made local monitoring server Your Docker host Low to medium Fewer managed cloud features
IAMMETER-Cloud Ready-made monitoring, reports and remote access IAMMETER-Cloud Low Uses a hosted cloud service
Home Assistant / Node-RED Smart-home entities and custom automation Your own platform Medium You design the dashboard and workflows
Custom server A product, EMS or specialized data pipeline Your infrastructure High You develop and maintain the system

Continue with:

13. Deployment Checklist

  • Docker host has a stable LAN address.
  • /app/data is mounted to persistent storage.
  • The timezone matches the monitoring site.
  • Default passwords have been changed.
  • Ports 5050 and 1883 are not unnecessarily exposed to the Internet.
  • Meter SN and channel assignments are correct.
  • Local upload has been verified with live measurements.
  • Cloud forwarding is enabled only when required.
  • Backup and upgrade procedures have been tested.
  • The datalogger volume is mounted if CSV export is required.

Last updated: July 17, 2026.

Top