OCPP 1.6 Charge Point Management System (CSMS) for operating and monitoring EV charging infrastructu
10K+
Charge Point Management System (CSMS) for Charge Point Operators (CPO), based on the OCPP 1.6 protocol.
OCPP CP Admin enables monitoring and managing electric vehicle charging infrastructure: charge point management, user management, charge transactions, real-time alerts, and an analytics dashboard.
π«π· Version franΓ§aiseβ
StatusNotification faults, disconnections (after grace period), heartbeat timeoutsSetChargingProfileChargePointMaxProfile (global station power cap) and TxDefaultProfile (default transaction profile)ClearChargingProfileReserveNowCancelReservationStatusNotification/healthz endpoint for monitoring/metrics endpoint in Prometheus text format (optional bearer token protection)βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser / Mobile β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β HTTP/HTTPS
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β Express Web Server (Port 3000/3001) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β REST API β β
β β Auth, Sites, Users, Charge Points, Transactions β β
β β Notifications, Dashboard β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βββββΌββββββ βββββββΌβββββ ββββββββΌβββββββ
β SQLite β β Sessions β β Real-time β
β (DB) β β (SQLite) β β broadcast β
βββββββββββ ββββββββββββ βββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β OCPP Server (WS Port 9000 / WSS Port 9001) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β OCPP 1.6 RPC β β
β β Authentication (password + client certificate) β β
β β Handlers: Boot, Authorize, Transactions ... β β
β β Remote commands: RemoteStart, ChangeConfig β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β WebSocket OCPP 1.6
ββββββββββΌβββββββββ
β EVSE Stations β
βββββββββββββββββββ
| Component | Technology |
|---|---|
| Runtime | Node.js 22 |
| Web framework | Express 5 |
| Database | SQLite 3 (better-sqlite3, WAL mode) |
| OCPP protocol | ocpp-rpc (OCPP 1.6-J, OCPP 2.0.1 ready) |
| Authentication | Passport.js (local + Google OAuth 2.0) |
| Password hashing | bcryptjs |
| HTTP security | Helmet, express-rate-limit |
| Nodemailer | |
| Web Push | web-push |
| Logging | Winston + daily rotation |
| i18n | i18next |
| Linting | ESLint + Prettier |
# Clone the repository
git clone <repository-url>
cd ocpp-cp-admin
# Install dependencies
npm install
# Copy the sample configuration
cp config/config.sample.json config/config.json
Edit config/config.json according to your needs (see the Configurationβ section).
The image is available on GitHub Container Registry and Docker Hub:
docker pull ghcr.io/wocha-fr/ocpp-cp-admin:latest
# or
docker pull wocha/ocpp-cp-admin:latest
Or build the image locally:
docker build -t ghcr.io/wocha-fr/ocpp-cp-admin .
Four Docker Compose files are available in the docker/ folder, suited for different deployment scenarios:
| File | Description |
|---|---|
docker-compose.http.yml | App only β HTTP + WS (ports 3000/9000) |
docker-compose.https.yml | App only β HTTPS + WSS (ports 3001/9000/9001, certbot included) |
docker-compose.yml | Full stack: Traefik (HTTPS, TLS termination) + App + FTP |
docker-compose.tls.yml | Full stack: Traefik (HTTPS + WSS passthrough) + cert export + App + FTP |
# Example: full stack with Traefik
docker compose -f docker/docker-compose.yml up -d
# Example: app only HTTP
docker compose -f docker/docker-compose.http.yml up -d
Traefik-based stacks include:
cpadmin.local, ws.cpadmin.local)See docker/README.mdβ for details on each compose file.
For servers running without Docker, a ready-to-use systemd unit is provided in scripts/.
1. Create a dedicated user and deploy the application:
sudo useradd --system --no-create-home --shell /usr/sbin/nologin ocpp-cp-admin
sudo mkdir -p /opt/ocpp-cp-admin
sudo cp -r . /opt/ocpp-cp-admin
sudo chown -R ocpp-cp-admin:ocpp-cp-admin /opt/ocpp-cp-admin
cd /opt/ocpp-cp-admin && sudo -u ocpp-cp-admin npm ci --omit=dev
2. Configure environment variables:
# Copy the template and fill in your values
sudo mkdir -p /etc/ocpp-cp-admin
sudo cp scripts/env.example /etc/ocpp-cp-admin/env
sudo nano /etc/ocpp-cp-admin/env
sudo chmod 600 /etc/ocpp-cp-admin/env
# Then uncomment the EnvironmentFile= line in the unit file:
# EnvironmentFile=/etc/ocpp-cp-admin/env
See scripts/env.exampleβ for all available variables.
3. Install and start the service:
sudo cp scripts/ocpp-cp-admin.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now ocpp-cp-admin
# View logs
journalctl -u ocpp-cp-admin -f
Exposed Ports:
| Port | Usage |
|---|---|
| 3000 | Web Interface (HTTP) |
| 3001 | Web Interface (HTTPS, if enabled) |
| 9000 | OCPP Server (WebSocket) |
| 9001 | OCPP Server (WebSocket Secure, if enabled) |
Volumes:
| Volume | Contents |
|---|---|
/app/config | Configuration, database, and certificates (certs/) |
/app/logs | Log files |
/app/public/img | Static images |
/app/locales-custom | Custom locale files (add or override translations) |
The /healthz endpoint is used for Docker health checks (HTTP GET, every 30s). |
The /metrics endpoint exposes Prometheus-format metrics (chargepoints, transactions, connectors by status, uptime, heap). It is accessible without authentication by default; set metrics.bearerToken (or CPADMIN_METRICS_TOKEN) to require a bearer token.
On first startup, if config/config.json does not exist, it is automatically created from config.sample.json.
The entrypoint runs as root to seed default files and fix volume permissions, then drops privileges to a dedicated non-root user (app) via su-exec.
Values from config.json can be overridden by environment variables. The JSON file remains the base configuration; environment variables take precedence when set.
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_PUBLIC_URL | webui.publicUrl | https://cpadmin.example.com |
CPADMIN_HTTP_HOST | webui.httpHost | 0.0.0.0 |
CPADMIN_TRUST_PROXY | webui.trustProxy | true (required behind a reverse proxy) |
CPADMIN_OCPP_WS_URL | ocpp.ocppWsUrl | ws://ws.example.com |
CPADMIN_OCPP_WSS_URL | ocpp.wss.ocppWsUrl | wss://ws.example.com:9001 |
CPADMIN_DIAGNOSTICS_URL | ocpp.diagnosticsLocation | ftp://ftp.example.com |
CPADMIN_SESSION_SECRET | webui.sessionSecret |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_LOGLEVEL | loglevel | debug, info, error |
LOG_CONSOLE | (no JSON equivalent) | true β force console log output (useful for temporary debugging in production) |
CPADMIN_LANGUAGE | language | Any locale code from locales/ folder (e.g. fr, en) |
CPADMIN_CPO_NAME | cpoName | My CPO |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_WEBUI_HTTPS_ENABLED | webui.https.enabled | true (enable native HTTPS on the web interface) |
CPADMIN_OCPP_WSS_ENABLED | ocpp.wss.enabled | true (enable native WSS on the OCPP server) |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_OCPP_STRICT_MODE | ocpp.strictMode | false (disable strict OCPP 1.6 validation) |
CPADMIN_OCPP_CALL_TIMEOUT | ocpp.callTimeoutSeconds | 45 |
CPADMIN_OCPP_AUTO_ADD | ocpp.autoAddUnknownChargepoints | true (auto-register unknown charge points) |
CPADMIN_OCPP_PENDING_UNKNOWN | ocpp.pendingUnknownChargepoints | true (queue unknown charge points for approval) |
CPADMIN_OCPP_V16_ENABLED | ocpp.v16.enabled | false (disable OCPP 1.6 support) |
CPADMIN_OCPP_V201_ENABLED | ocpp.v201.enabled | true (enable OCPP 2.0.1 support β in development) |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_MAIL_ENABLED | notifs.mail.enabled | true |
CPADMIN_MAIL_FROM | notifs.mail.from | CPADMIN <[email protected]> |
CPADMIN_MAIL_HOST | notifs.mail.transport.host | |
CPADMIN_MAIL_PORT | notifs.mail.transport.port | |
CPADMIN_MAIL_USER | notifs.mail.transport.auth.user | |
CPADMIN_MAIL_PASS | notifs.mail.transport.auth.pass | |
CPADMIN_MAIL_SECURE | notifs.mail.transport.secure | true (SSL/TLS from start) |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_WEBPUSH_ENABLED | notifs.webpush.enabled | true |
CPADMIN_VAPID_PUBLIC_KEY | notifs.webpush.vapidPublicKey | |
CPADMIN_VAPID_PRIVATE_KEY | notifs.webpush.vapidPrivateKey | |
CPADMIN_VAPID_SUBJECT | notifs.webpush.vapidSubject | mailto:[email protected] |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_PUSHOVER_ENABLED | notifs.pushover.enabled | true |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_NOTIF_DISABLED_EVENTS | notifs.defaultDisabledEvents | connector_available,connector_unavailable |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_GOOGLE_AUTH_ENABLED | auth.google.enabled | true |
CPADMIN_GOOGLE_CLIENT_ID | auth.google.client_id | |
CPADMIN_GOOGLE_CLIENT_SECRET | auth.google.client_secret |
| Variable | JSON Config | Example |
|---|---|---|
CPADMIN_METRICS_TOKEN | metrics.bearerToken | my-secret-token |
If not set,
/metricsis accessible without authentication (suitable for private/Docker networks).
Booleans (
true/false) and numbers are automatically converted. Secrets are always treated as strings.
The configuration file is config/config.json. In development mode (NODE_ENV=development), config/config.dev.json is used if it exists.
Configuration values can be overridden by environment variables (see the Environment Variablesβ section).
Administrators can edit the configuration directly from the web interface via Settings β Configuration. The editor displays all parameters organized by section in a table with three columns:
config.jsonRequired fields are validated before saving. The application restarts automatically after a successful save.
Environment variables are informational only β they cannot be modified from the UI. The editor writes only to
config.json.
| Parameter | Type | Default | Description |
|---|---|---|---|
loglevel | string | "error" | Log level: error, warn, info, debug |
language | string | "fr" | Default application language (any locale code from locales/ folder, e.g. fr, en) |
dbname | string | "cpadmin.db" | SQLite database file name |
cpoName | string | "CP Admin" | Organization name (displayed in the interface) |
"webui": {
"httpHost": "localhost",
"httpPort": 3000,
"trustProxy": false,
"publicUrl": "http://localhost:3000",
"sessionSecret": "",
"https": {
"enabled": false,
"httpsPort": 3001,
"certFile": "certs/server.crt",
"keyFile": "certs/server.key"
}
}
| Parameter | Description |
|---|---|
httpHost | HTTP listen address (0.0.0.0 to listen on all interfaces) |
httpPort | HTTP port |
trustProxy | Enable if behind a reverse proxy (true or number of proxies) |
publicUrl | Public URL of the application (used in emails, Google OAuth callback) |
sessionSecret | Secret key for sessions (auto-generated if empty on each startup) |
https.enabled | Enable HTTPS server |
https.httpsPort | HTTPS port |
https.certFile / keyFile | Paths to TLS certificate and key files (relative to the config/ folder) |
"ocpp": {
"host": "0.0.0.0",
"wsPort": 9000,
"strictMode": true,
"callTimeoutSeconds": 45,
"autoAddUnknownChargepoints": false,
"pendingUnknownChargepoints": true,
"ocppWsUrl": "ws://ws.cpadmin.local:9000",
"diagnosticsLocation": "ftp://example.com/diagnostics",
"v16": { "enabled": true },
"v201": { "enabled": false },
"wss": {
"enabled": false,
"wssPort": 9001,
"strictClientCert": false,
"ocppWsUrl": "wss://ws.cpadmin.local:9001",
"rsa": { "certFile": "...", "keyFile": "..." },
"ecdsa": { "certFile": "...", "keyFile": "..." },
"caFile": ""
}
}
| Parameter | Description |
|---|---|
host | OCPP server listen address |
wsPort | WebSocket (WS) port |
strictMode | OCPP strict mode (message validation) |
callTimeoutSeconds | Timeout in seconds waiting for a response to an OCPP call |
autoAddUnknownChargepoints | Automatically add unknown charge points that connect |
pendingUnknownChargepoints | Put unknown charge points pending admin approval |
ocppWsUrl | OCPP WebSocket URL to communicate (for charge point configuration) |
diagnosticsLocation | Destination URL for diagnostics upload |
v16.enabled | Enable OCPP 1.6 support (default: true) β set to false to disable; a warning is logged and all connections are rejected if both versions are disabled |
v201.enabled | Enable OCPP 2.0.1 support (default: false) β in development, not yet fully functional |
wss.enabled | Enable WebSocket Secure (TLS) |
wss.strictClientCert | Require a valid client certificate |
wss.rsa / ecdsa | Server certificates for WSS (dual algorithm supported, paths relative to config/ folder) |
wss.caFile | Certificate authority for client certificate validation (path relative to config/ folder) |
"notifs": {
"authRejectThreshold": 3,
"authRejectWindowMinutes": 5,
"flapThreshold": 4,
"flapWindowMinutes": 2,
"refusedCooldownMinutes": 60,
"reconnectGracePeriodSeconds": 60,
"availabilityDebounceSeconds": 5,
"mail": {
"enabled": false,
"from": "CPADMIN <[email protected]>",
"transport": {
"host": "smtp.example.com",
"port": 587,
"secure": false,
"auth": { "user": "...", "pass": "..." }
}
},
"webpush": {
"enabled": false,
"vapidSubject": "mailto:[email protected]",
"vapidPublicKey": "",
"vapidPrivateKey": ""
},
"pushover": {
"enabled": false
}
}
| Parameter | Description |
|---|---|
authRejectThreshold | Number of RFID authorization rejections before notification |
authRejectWindowMinutes | Time window for RFID rejection counting (minutes) |
flapThreshold | Number of rapid reconnections before flapping alert |
flapWindowMinutes | Time window for flapping detection (minutes) |
refusedCooldownMinutes | Cooldown between two chargepoint_refused notifications for the same identity (default: 60 min) |
reconnectGracePeriodSeconds | Grace period in seconds before sending the offline notification. If the chargepoint reconnects within this delay, both offline and online notifications are suppressed (default: 60) |
availabilityDebounceSeconds | Debounce delay (seconds) before sending Available/Unavailable notifications. Prevents spurious alerts from chargepoints that rapidly toggle status on connection (default: 5) |
mail.enabled | Enable email notifications |
mail.from | Sender address |
mail.transport | SMTP transport configuration (Nodemailer) |
webpush.enabled | Enable Web Push notifications |
webpush.vapid* | VAPID keys for Web Push (to be generated) |
| `pushover.enable |
Content type
Image
Digest
sha256:adc7da9d5β¦
Size
73.2 MB
Last updated
3 months ago
docker pull wocha/ocpp-cp-admin