DeviceChain is an Apache 2.0 IoT platform you run on Kubernetes, ready for AI agents. Devices connect over MQTT, HTTP, Sparkplug B or LwM2M, or through a LoRaWAN network server. Rules raise alarms and send commands back, and dashboards, over-the-air updates and multi-tenant access are built in. An optional MCP server lets Claude, Cursor or VS Code read devices, telemetry, alarms and commands with the signed-in user's own token, and an assistant's proposals to acknowledge or clear alarms wait for a person to approve them (Preview). There is no device cap and no enterprise edition.
Watch
More on the DeviceChain YouTube channel.
- Closes the loop. A rule can raise an alarm and command the device, and a command is tracked until the device reports the result or its time-to-live runs out (commands, event processing).
- Measured, with the results published. Throughput was measured on Google Kubernetes Engine and every stored event was checked, with the setup and the limits of each run stated (measured throughput). Container images and the Helm chart are signed (verifying releases).
- Open, with tenants built in. One installation serves many tenants, each isolated from the others, and a membership can be limited to one customer's data (multi-tenancy, security model). All of it is Apache 2.0 and in this repository.
Try it locally
You need Docker, kubectl, kind and OpenTofu 1.10 or later on your PATH, plus dcctl and
dc-simulator from the releases page.
Give Docker at least 4 CPUs, 8 GB of memory and 40 GB of free disk. Most of the time is the
bootstrap; the quickstart budgets about half
an hour end to end. The commands are for a bash shell (on Windows, Git Bash or WSL).
dcctl install local --compact # a kind cluster sized for a laptop
dcctl bootstrap local devicechain --host localhost --no-tls # an instance, served at http://localhost/
dcctl sim create building --manifest buildingpulse # a tenant and a sign-in for it
The simulator sends its readings to the device ingest port, which a local install does not
publish. Forward it in a second terminal and leave it running, then start the simulator:
kubectl -n dci-devicechain port-forward svc/event-sources 8081:8081 # second terminal
dcctl sim run building --simulator ./dc-simulator # Ctrl+C stops it
It provisions twelve thermostats across three buildings, with a rule that raises an alarm when a
temperature goes above 30, and then sends readings every five seconds. Open http://localhost/ and
sign in as building@sim.devicechain.local, the identity sim create made for the tenant
sim-building. Its password is the simPassword field in ~/.devicechain/sims/building.json.
Under Monitor → Alarms, bp-over-temp alarms raise and clear as the temperatures rise and
fall. (The bootstrap also prints a password for superuser@devicechain.local, which administers
the instance and sees no tenant data.)
Your first device continues from here: it
creates a device, sends a reading with curl and shows it in the console.
Docs · Examples · Roadmap · Contributing · Discussions · Releases
The current release is v1.6.0; v1.7 is in progress. See Status for the compatibility promises.
DeviceChain™ takes in telemetry from device fleets, keeps a record of each device and the assets,
areas and customers it belongs to, detects conditions in the data as it arrives, and sends
commands back. It is meant for teams that build an IoT product or run a fleet and want to run the
platform in a Kubernetes cluster they control, with their data kept there.
What it does
Ingest
Devices send data over these transports:
- MQTT, through the broker built into NATS (port 1883)
- HTTP, as a
POST of a JSON event (the same body a device publishes over MQTT)
- Eclipse Sparkplug B, with DeviceChain joining
your existing Sparkplug broker as a Host Application
- OMA LwM2M over CoAP/UDP with DTLS
The transports differ in what they support. HTTP devices can opt into command polling with the
HTTP_PULL command channel on their device type (available since v1.4). Sparkplug commands (NCMD and
DCMD) are opt-in and off by default, and LwM2M telemetry is decoded from SenML-JSON only. Sparkplug and LwM2M are not in
the default install; add them at bootstrap with --enable-area sparkplug-ingest or
--enable-area lwm2m-ingest. The
transport matrix lists what each one
does and what it lacks. A runnable Sparkplug example, with an Eclipse Tahu edge node and a
Mosquitto broker, is in examples/sparkplug-commands.
Device model
You describe a kind of device once, in a versioned device profile that lists its metrics,
commands and detection rules. Publishing a new profile version changes the behaviour of every
device of that type in one step, and rollback undoes it. Devices can be linked to assets, areas
and customers. The links you mark as tracked are written onto each event when it arrives, so a
query for everything in one building finds its readings without walking the relationship graph,
and history stays where it was when a device is moved. A profile can also declare the
configuration a device receives; each device has its own copy, and you can restore an earlier
revision of it or copy another device's
(configuration).
A device can be disabled, which discards its events and refuses commands to it, and keeps its data
(disabling a device).
Any published profile version can be exported as a W3C Web of Things Thing Model. See the
domain model.
Detection and alarms
Detection rules run in the event-processing service as events arrive. Condition types include
thresholds, conditions held for a duration, repeated occurrences, rate of change, silence,
connectivity, windowed aggregates and conditions met by several devices in one area. A rule can
raise an alarm, send a command to a device, call a webhook, or publish to MQTT, Kafka, AWS SNS or
AWS SQS. The webhook and publish actions need the outbound-connectors area, which is off by
default. Rules are written as forms, on a visual canvas that can replay history against a draft,
or from a plain-language description when the optional AI service is enabled. Alarms reach people
by email or webhook, with escalation. See
event processing and alarms.
Commands and dashboards
Commands are validated against the device's profile, then tracked until the device reports the
result or the command's time-to-live runs out
(commands). Dashboards are versioned per tenant
and render with React widget packages published to npm, which you can embed in your own
application (dashboards). A dashboard can be imported,
cloned or started from a template. The console exports the device list, the alarm list, a command
batch and the audit journals as CSV, up to 10,000 rows each.
Sign-in and updates
People can sign in through your own OpenID Connect identity provider, and a tenant can require it
(single sign-on). Over-the-air updates have a per-tenant artifact catalogue with a
verified upload, signers (an artifact nobody has signed cannot be assigned unless you allow that),
assignment to one device or, as a rollout, to a device group a capped number of devices at a time,
and a resumable download. The console has screens for them. Rollouts have no waves, canary
promotion or schedules, and only a device connected over MQTT can receive a managed update
(over-the-air updates).
APIs and data access
The management and query APIs are GraphQL, and their schemas are published in the docs
(schema index). Introspection is off in a running
instance. Client libraries are the @devicechain/client TypeScript package on npm and the
DeviceChain.Sdk .NET package on NuGet, which also targets Unity. Telemetry lives in TimescaleDB,
so BI tools and psql can read it through a read-only analytics schema
(SQL and BI access). An optional
MCP server gives AI assistants read-only access to a
tenant, under the signed-in user's own token.
How it runs
DeviceChain is a set of Go services on Kubernetes, with a React console. NATS JetStream carries
messaging, device MQTT connections and key-value state. PostgreSQL holds entity data, and a
second PostgreSQL database with the TimescaleDB extension holds events. Each tenant's data is
separated by a tenant column that every query is scoped to, and by per-tenant messaging subjects.
All tenants share one set of services
(multi-tenancy).
A default install sizes the CPU request of each service on the event path from measurement
(service sizing). On
Google Kubernetes Engine, on three 4-vCPU, 16 GB database nodes and three 4-vCPU, 8 GB service
nodes, an HA install at its defaults sustained 10,000 events a second for 10 minutes, on each of
two development builds that went into v0.22.0, and stored every accepted event exactly once,
checked event by event: none missing, none stored twice, none unexpected. In those runs the
event-path services and the broker's stream leaders were held to one balanced placement across
the three service nodes. With placement left to the scheduler, the v0.19.0 release candidate was
measured the same way at 6,000 events a second. Each event carried one reading, from one tenant
whose ingest ceiling was raised for the test. These results describe that workload and cluster,
not a capacity guarantee. See
measured throughput. Each
tenant is allowed 1,000 readings a second by default
(governance).
The --ha flag on dcctl install runs the message broker as a three-node cluster with every
stream replicated, and both databases as three-instance clusters. Without --compact, it also
runs event-management as two pods. It needs three schedulable
nodes (on kind, three workers). An --ha install keeps running when any one node is lost; a
second node lost at the same time stops writes. dcctl ha verify checks that the broker holds
the replication the install declares (high availability).
The disaster recovery page covers
backups and restore. A restore covers the two databases; JetStream stream state and object
storage have not been through a restore drill.
DeviceChain started as a rebuild of the SiteWhere IoT
platform. It begins from SiteWhere's domain (devices, device types, assets, areas and customers)
and replaces the Java and Spring stack with Go services. There is no tool to import data from a
SiteWhere installation.
Status
DeviceChain follows semantic versioning from v1.0.0. The device wire, the
GraphQL API, the npm and C# SDKs and dcctl change incompatibly only in a major release, and a
deprecation lasts at least two minor releases first; the
versioning policy says exactly what is
covered. Each release lists anything you must do first in the
release notes and the
upgrade guide. Read them before
you upgrade.
dcctl install local and dcctl bootstrap local are tested end to end on kind. To use another
cluster, pass --kube-context <ctx> to both commands; that path is not part of the end-to-end
tests. For Google Kubernetes Engine, deploy/gke creates a cluster sized
for DeviceChain and walks through installing onto it.
Install
dcctl is the command-line tool that installs and runs DeviceChain. Download it for Linux, macOS
or Windows from the releases page. It
carries the Helm chart, the operator manifests and the OpenTofu configuration inside it, so the
binary is all you need from this repository. It drives these tools, which must be on your PATH:
kubectl
- OpenTofu (
tofu) or terraform
docker, only when dcctl runs the cluster itself (the local provider, which runs kind on
Docker) or builds images from source (--build). Installing into an existing cluster with
--kube-context from published images needs no Docker daemon.
kind, for the local provider
The cluster must run Kubernetes 1.29 or newer. dcctl preflight local checks the tools, and the
Kubernetes version once a cluster exists, without changing anything. For a small machine,
--compact on dcctl install
lowers resource requests and leaves out the monitoring stack.
dcctl install prepares a Kubernetes cluster once. dcctl bootstrap then creates an instance:
one DeviceChain deployment with its own console, message broker and databases. Tenants are
created inside an instance.
# Prepare the cluster. This creates a kind cluster named "devicechain" if there is none, and
# installs the DeviceChain operator, a shared PostgreSQL server and its backup store, the
# CloudNativePG operator, cert-manager, Prometheus and Grafana, and Traefik with Gateway API.
dcctl install local
# Create an instance served at http://localhost/.
dcctl bootstrap local devicechain --host localhost --no-tls
Bootstrap prints the console URL and a generated password for superuser@devicechain.local.
Your first device continues from here. It
walks you through creating a tenant, sending a reading with curl and seeing it in the console.
To remove the instance, run dcctl destroy local devicechain. The cluster and what
dcctl install put on it stay; kind delete cluster --name devicechain removes them. Destroy
keeps the instance's root-key escrow file. Move it aside before you bootstrap again under the
same name.