Explainer
Why Docker Ignition skips third-party modules on first startup
Short answer
On a fresh Ignition container's first start, a third-party module bound into /modules stays a file: module registration writes into data/db/config.idb, and a fresh launch has no such database yet. Bind-mount any gateway backup, even an empty one, as /restore.gwbk; the first-start restore creates the database, and the module registers on that same start.
On this page
- What the first start of a fresh container actually does
- A file in /modules is not a registered module
- Why the gateway restart button does not help
- The two ways to register third-party modules on first start
- Worked example: MQTT Engine on a fresh container with an empty backup at /restore.gwbk
- Running the container after the first start
- The decision for each case
- Questions asked
On the first start of a fresh Ignition container, a third-party module bound into /modules stays a file: registration is skipped, so the module never appears on the gateway's modules page, and no gateway restart brings it in. The cause is start order. Module registration writes into the gateway's configuration database, data/db/config.idb, and on a fresh launch that database does not exist when the registration pass runs. Give the container a gateway backup to restore on first start, bind-mounted as /restore.gwbk, and the database exists before registration runs, so a module delivered through /modules registers on that same start. An otherwise empty backup is enough.
What the first start of a fresh container actually does #
The container's entry point provisions the gateway before the web interface ever comes up: it creates the data directory, initializes the internal configuration database at data/db/config.idb, and applies auto-commissioning settings such as the administrator credential passed in through the environment. The step that turns a signed .modl file bound into /modules into an installed module is a registration pass, and that pass writes records into the same configuration database.
On a fresh launch there is no database yet when the registration pass runs, so third-party modules are skipped. The modules that ship inside the image need no such pass, which is why the gateway otherwise comes up looking completely normal while the mounted file sits untouched. The /modules bind mount remains the documented channel for external and third-party modules: delivery works exactly as documented, and the failure is in the ordering.
The same entry point offers a first-start restore: bind-mount a gateway backup to /restore.gwbk and the image restores it during that first start. The restore builds the configuration database, which is precisely what the registration pass was missing.
A file in /modules is not a registered module #
Registration is a database write, not a file copy, so a visible file proves delivery and nothing more. Three checks separate delivery from registration:
- The gateway configuration page opens through the published port.
- The
.modlfile is visible inside the container at/modules, checked with a shell into the container. - The module is absent from the gateway's modules page despite both of the above.
In the deployment reported with this symptom, all three held: the configuration page was reachable, MQTT-Engine-signed.modl was visible in /modules, and the modules page listed nothing. That combination points at first-start ordering, not at Docker networking, port publishing, or the bind mount. If the page does not open or the file is not visible, fix port publishing, host-path resolution, or file permissions first, because those faults produce the same empty modules page for a different reason.
Why the gateway restart button does not help #
A gateway restart from the web interface reloads an already-commissioned gateway; it does not re-run the container entry point's first-start provisioning. That is why the reported restart changed nothing. The ordering problem belongs to the first start of a fresh data directory: once data/db/config.idb exists, a container start registers the modules bound into /modules, which is why the sequence of commissioning without modules, stopping the container, adding them to the mounted folder, and starting again is reported to work.
Recreating the container with a fresh data directory returns the gateway to first-start state. A fresh container does cure some gateway faults — a stuck Vision window often needs a fresh container is the documented case — but with a fresh data directory it also erases registered third-party modules and replays the ordering problem described here.
The two ways to register third-party modules on first start #
Both approaches arrange for an existing configuration database before the registration pass runs.
Restoring a backup that already contains the module: take a gateway backup on a gateway where the module is installed and running, and bind-mount it as /restore.gwbk. The first start restores the gateway and its module configuration together, and the modules are available on the first start of the container, as reported. Choose this when the container should clone a working system.
Restoring an empty backup and delivering the module through /modules: any valid gateway backup initializes the configuration database, and no special configuration is needed. The module in /modules registers on that same first start. Choose this when the container should boot a clean gateway carrying only the modules you mount.
Without any backup, the reported working sequence is: start the container with no modules present, wait until the gateway is past commissioning, stop the container, add the modules to the mounted folder, and start again.
In every case, obtain the .modl package from the module manufacturer or its authorized distributor, and check the module version against the gateway version in the container before the first start.
Worked example: MQTT Engine on a fresh container with an empty backup at /restore.gwbk #
The inputs, and where each comes from:
- Image
kcollins/ignition:latest— the reported deployment. - Module package
MQTT-Engine-signed.modlin the host folder~/ignition/modules— the reported deployment. - Mount
~/ignition/modules:/modulesfor module delivery — the reported deployment. - Port publish
8088:8088for the gateway web interface — the reported deployment. - First-start restore mount of a gateway backup to
/restore.gwbk— the container path is the one the image documents; the host path in this example,~/ignition/empty-backup.gwbk, is this example's own name for an otherwise empty backup. - Administrator credential through
GATEWAY_ADMIN_PASSWORD— the variable the reported deployment sets; supply the value through your deployment's secret handling rather than a literal on the command line.
The rule in words: third-party module registration writes into data/db/config.idb. A fresh launch has no such file when the pass runs, so the pass is skipped. A first-start restore of any valid backup creates the file, so the pass runs against it on the same start.
The arithmetic, as two start sequences. Without the restore mount: container start, data directory empty, registration pass finds no data/db/config.idb, third-party modules skipped, gateway completes commissioning. Result: the modules page lists nothing from /modules, and a gateway restart does not change it — exactly the reported failure. With the restore mount: container start, the entry point finds /restore.gwbk, the backup restores, data/db/config.idb exists, the registration pass runs against the existing database, and MQTT-Engine-signed.modl registers. Result: the modules page lists MQTT Engine on this first start.
The command for the working case:
docker run -p 8088:8088 \
-v ~/ignition/modules:/modules \
-v ~/ignition/empty-backup.gwbk:/restore.gwbk \
-d kcollins/ignition:latest
Decision: whenever third-party modules must exist on the first start of a containerized gateway, bind-mount a gateway backup as /restore.gwbk — an empty backup when the module arrives through /modules, a backup from a running gateway when you want the module's configuration restored with it. The only requirement on the backup is that it restores. Verify by opening the gateway through the published port and confirming the module on the modules page, with the startup log watched through restore and registration.
Running the container after the first start #
Pin the image before the deployment is repeated anywhere important: latest moves, and the first-start behavior you verified should be the behavior that ships. Record the image version or digest next to the gateway version and the module versions.
Treat the backup as configuration data. A gateway backup carries connection settings and credentials, so keep it out of public repositories and review the restored connections before the gateway talks to the plant network.
After the module registers, two steps remain and both run through the gateway's own dialogs: module certificate approval and license activation. The published browser port serves gateway administration only, so reaching the broker the module connects to is a separate network check with its own causes.
The decision for each case #
A .modl file present in /modules, a reachable gateway page, and an empty modules page on a fresh data directory is first-start ordering: mount a gateway backup as /restore.gwbk, empty when the module arrives through /modules, or run the commission-then-add sequence. A module that registers but will not run is a different fault: check module-versus-gateway version, read the load error from the startup log, and complete certificate approval and licensing. A file that is not visible in /modules or a page that does not open is a delivery fault: fix the mount and the port publish first.
If the deployment is an Ignition Edge Panel rather than a full gateway, the native-versus-Docker hosting choice has its own write-up in running Ignition Edge Panel natively or in Docker on an industrial PC.
Questions asked
Does a plain docker stop and start behave differently from recreating the container?
Yes. Stopping and starting the container keeps its writable layer, so with no data volume mounted the configuration database created during commissioning survives, and the commission-then-add sequence works on such a container. Recreating the container drops that layer and returns the gateway to first-start state, replaying the ordering problem unless a backup is mounted again. A gateway restart from the web interface does neither.
Does the backup have to come from a gateway that already runs the module?
No. A backup from a gateway where the module is installed and running restores that module's configuration together with the rest of the gateway, which is convenient when the container should clone a working system. An otherwise empty backup only has to initialize the configuration database, so a backup of a freshly commissioned gateway with minimal configuration does the job. Take either with the gateway's built-in backup function.
The module appears on the modules page but shows as not running. What now?
Registration and loading are separate steps, so the listing only proves the database write happened. Check that the module version supports the gateway version running in the container, read the module's load error in the startup log, and complete certificate approval and license activation through the gateway's own dialogs. A module that runs but cannot reach its broker is a network question, not a registration one.
Is the restore-on-first-start behavior the same on every Ignition Docker image?
No. The first-start restore belongs to the image's entry point, not to Ignition itself, and each image documents its own environment variables and mount paths. The /restore.gwbk behavior described here is documented for the community image used in the example. Before relying on it elsewhere, read the documentation of the exact image and tag you run, and record that image identity next to the gateway and module versions.