Self-Hosted Energy Monitoring with Docker
Run IAMMETER-Docker on a server, NAS, Raspberry Pi or compatible router to track electricity use and solar production. The meter sends readings over your LAN. Your host stores the history and serves the dashboard, even when the internet is unavailable.
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
5050available for the web application and API; - TCP port
1883if 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
Choose one of the two methods below. Both use the same image and mount a host directory at /app/data so your records survive a container replacement. The examples publish port 1883 for MQTT. For HTTP-only installations, omit that port mapping.
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
5050or1883directly to the public Internet without an appropriate firewall, authentication and secure network design.
4. Initial Configuration
After signing in:
- Create a Place for the home, solar site or monitored facility.
- Add a Meter.
- Enter the meter serial number (SN).
- Select the correct single-phase or three-phase meter type.
- Assign each phase or channel as Grid, Inverter or Load.
- Confirm the site timezone and measurement structure before evaluating reports.
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
First register the meter’s serial number in Docker. Then open the meter’s own LAN address in a browser to set its upload destination.
- Open Settings → Basic Settings and select http under Run Mode.
- In Address, enter your Docker host’s LAN address, published HTTP port and upload path. For example, if the host is
192.168.1.50and you used the port mapping above, enter the value below. Omit thehttp://prefix in this field for plain HTTP.
192.168.1.50:5050/api/v1/sensor/uploadsensor
- Set the Upload Interval in seconds, then select Save. If local admin security is enabled, sign in with the meter’s administrator credentials when prompted.

For other upload modes, see the meter WebUI reference. For firmware downloads and model compatibility, see firmware updates.
Verify the first reading in Docker
- wait for the first upload;
- confirm that the meter appears online in IAMMETER-Docker;
- compare voltage, power and energy values with the meter's local data;
- 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. In the Docker dashboard, open Devices → Meters, edit the meter, enable Forward data to IAMMETER cloud platform and save. The meter continues to upload to Docker.
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
On the local API page, open the upload operation, inspect the request schema and send one sample using the test SN. Check the response, then open that meter in the dashboard and compare the stored reading with your sample. 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.

For a site visit or temporary installation, PocketLog displays readings on its LCD and records them on microSD for CSV export.
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:
- stop the container to finish writes before copying the database;
- copy the complete mounted
datadirectory to backup storage; - include the
dataloggerdirectory when CSV logging is enabled; - restart the container, then retain more than one backup generation;
- 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:
- record the existing ports, timezone and volume mounts;
- pull the new image;
- stop and remove the old container;
- create the container again with the same persistent volume;
- 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 psordocker compose ps. - Check whether host port
5050is 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
localhostas 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/datawas 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:
- Self-hosted monitoring options for an architecture-level comparison;
- Open-source energy monitoring platforms for Home Assistant, Node-RED and other platforms;
- Develop your own energy monitoring system for APIs and receiver-side development;
- Use an energy meter without Internet for local data paths and offline scenarios.
13. Deployment Checklist
- Docker host has a stable LAN address.
-
/app/datais mounted to persistent storage. - The timezone matches the monitoring site.
- Default passwords have been changed.
- Ports
5050and1883are 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.