Deploy OpenEMS Edge to Docker
This chapter explains how OpenEMS can be deployed using our official Docker image.
Prerequisites:
-
A amd64 or arm64 device running Linux. You need the IP address and SSH access.
-
A working docker environment. To setup follow instruction from docs.docker.com.
1. Prepare system
1.2. Check docker installation
admin@raspi5:~$ docker --version
Docker version 27.3.1, build ce12230
if not already installed, follow Setup docker
1.3. Setup docker
To setup docker follow the instuctions from docs.docker.com.
2. Start Container
2.1. Create a Docker compose
Paste content into a docker-compose.yml
services:
openems-edge:
image: openems/edge:latest
container_name: openems_edge
hostname: openems_edge
restart: unless-stopped
volumes:
- openems-edge-conf:/var/opt/openems/config:rw
- openems-edge-data:/var/opt/openems/data:rw
ports:
- 8080:8080 # Apache-Felix
volumes:
openems-edge-conf:
openems-edge-data:
3. OpenEMS Edge UI
If you want to add the OpenEMS Edge UI to your setup, you can do so by adjusting your docker-compose.yml
file to look like this:
services:
openems-edge:
image: openems/edge:latest
container_name: openems_edge
hostname: openems_edge
restart: unless-stopped
volumes:
- openems-edge-conf:/var/opt/openems/config:rw
- openems-edge-data:/var/opt/openems/data:rw
ports:
- 8080:8080 # Apache-Felix
- 8085:8085 # UI-Websocket
openems-ui:
image: openems/ui-edge:latest
container_name: openems_ui
hostname: openems_ui
restart: unless-stopped
volumes:
- openems-ui-conf:/etc/nginx:rw
- openems-ui-log:/var/log/nginx:rw
environment:
- UI_WEBSOCKET=ws://<hostname>:8085
ports:
- 80:80
- 443:443
volumes:
openems-edge-conf:
openems-edge-data:
openems-ui-conf:
openems-ui-log:
summary of the changes:
-
Open a Port for UI Websocket (8085) on the
openems-edge
service -
Added a new service
openems-ui
to the docker-compose file -
Added the volumes
openems-ui-conf
andopenems-ui-log
The UI_WEBSOCKET environment variable must be set to the hostname of the OpenEMS Edge container. This URL is used by the UI to connect to the OpenEMS Edge Websocket. Make sure it is reachable from any device you want to use the UI on.
|