Running Nomatron Server as a Docker Container

Nomatron is in early access. Some advanced workflows may not be covered in the public docs.

This page covers running the Nomatron server from the published Docker image.

It is the right page for operators who want to:

  • run Nomatron on a single Docker host;
  • wrap Nomatron in another scheduler or PaaS that consumes OCI images; or
  • validate a production-style container runtime before moving on to Nomad job specs.

This page focuses on the normal server runtime path. It does not cover --dev mode inside the published container image.

Before You Start

Make sure these are already in place:

  • Docker is installed and the daemon is running;
  • PostgreSQL is reachable from the container host;
  • nomatron database init has already completed successfully, or you are ready to run it from the container;
  • your Nomatron config file or environment variables are ready; and
  • you know how the server will be reached, including api_addr, TLS termination, and Serf networking.

The published image for this release is:

text
ghcr.io/nomatronio/nomatron-releases/nomatron:v0.1.7

Pull The Published Image

Pull a pinned release tag. Always pin a version tag such as v0.1.7; do not use latest:

bash
docker pull ghcr.io/nomatronio/nomatron-releases/nomatron:v0.1.7

Keep Secrets In An Environment File

The server needs several secrets: the database connection string, NOMATRON_LICENSE_KEY, NOMATRON_CLUSTER_KEY (connected licence mode, the default), and NOMATRON_ENCRYPTION_KEY (required outside dev mode). Keep them in a root-only environment file rendered from your secret store, not on the docker run command line:

bash
# /etc/nomatron/nomatron.env  (mode 0600, rendered from your secret store)
NOMATRON_DB_URL=<DB_CONNECTION_STRING>
NOMATRON_LICENSE_KEY=<LICENSE_KEY>
NOMATRON_CLUSTER_KEY=<CLUSTER_KEY>
NOMATRON_ENCRYPTION_KEY=<ENCRYPTION_KEY>

Generate the encryption key with openssl rand -base64 32. Keep it, and the cluster key, for the life of the database.

Generate the cluster key yourself, for example with openssl rand -base64 32. Nomatron does not store or issue cluster keys, so keep it in your secrets manager alongside the encryption key and back it up; it cannot be recovered if lost.

Optional: Run Database Init From The Container

If you want to bootstrap the database from the same image, mount your config file and run database init first:

bash
docker run --rm \
  --env-file /etc/nomatron/nomatron.env \
  -v "$(pwd)/nomatron.hcl:/etc/nomatron/nomatron.hcl:ro" \
  ghcr.io/nomatronio/nomatron-releases/nomatron:v0.1.7 \
  database init --config /etc/nomatron/nomatron.hcl

This is useful when:

  • the host does not have the Nomatron binary installed directly; and
  • you want all bootstrap and runtime commands to come from the same published image.

If you prefer environment variables instead of a config file, see the database initialization page and supply the same variables to the container for both database init and server.

Basic Container Start With A Mounted Config File

The simplest production-style container run is:

bash
docker run --rm \
  -p 4649:4649 \
  -p 4650:4650 \
  --env-file /etc/nomatron/nomatron.env \
  -v "$(pwd)/nomatron.hcl:/etc/nomatron/nomatron.hcl:ro" \
  ghcr.io/nomatronio/nomatron-releases/nomatron:v0.1.7 \
  server --config /etc/nomatron/nomatron.hcl

This starts the Nomatron server in the container and tells it to read configuration from the mounted file.

In normal mode, the mounted config should include a serf stanza even for a single-server deployment. A minimal example looks like this:

hcl
server {
  port     = 4649
  api_addr = "https://nomatron.example.com"
}

# database.connection_string, licensing.license_key and licensing.cluster_key
# come from NOMATRON_DB_URL, NOMATRON_LICENSE_KEY and NOMATRON_CLUSTER_KEY
# in the environment file.

serf {
  node_name = "nomatron-1"
  bind_addr = "0.0.0.0"
  port      = 7946
}

For a single-server deployment, no retry_join peers are required. For a multi-server deployment, add advertise_addr, retry_join, and encrypt_key. (serf.join and NOMATRON_SERF_JOIN were removed and now stop the server from starting.)

If the server starts cleanly, you can open:

text
http://localhost:4649/ui

for a local non-TLS test, or the configured external api_addr in environments fronted by a load balancer or reverse proxy.

Running With Environment Variables

You can also keep the container stateless and inject the important values through environment variables:

bash
docker run --rm \
  -p 4649:4649 \
  -p 4650:4650 \
  --env-file /etc/nomatron/nomatron.env \
  -e NOMATRON_API_ADDR="https://nomatron.example.com" \
  -e NOMATRON_PORT="4649" \
  ghcr.io/nomatronio/nomatron-releases/nomatron:v0.1.7 \
  server

This works well when:

  • your platform injects secrets through environment variables;
  • you want to avoid mounting a config file; or
  • you want to override a small number of settings from the outside.

What The Container Needs From Outside

Even when Nomatron itself runs in Docker, several dependencies still live outside the container:

  • PostgreSQL, unless you are intentionally running a separate database container yourself;
  • TLS termination, if you are not enabling TLS directly in Nomatron;
  • persistent secrets and configuration, whether through mounted files or environment variables; and
  • Serf peer connectivity, if you are running more than one Nomatron server node.

The container is only one part of the deployment. It still needs a reachable database and a clear network path for whatever mode you are operating in.

Ports And Networking

The published image exposes:

  • 4649 for the Nomatron HTTP API and web UI; and
  • 4650 for the agent gRPC server.

For many deployments:

  • always publish 4649;
  • publish 4650 when private network agents need to connect directly; and
  • publish the configured Serf port, over both TCP and UDP, if this node must join other Nomatron servers.

The default Serf port is typically 7946 unless you override it in your config.

Even a single-node server still starts Serf in normal mode. The difference is that a single-node deployment usually does not need to publish or join Serf externally because it has no peers.

For a clustered run, a common pattern is:

bash
docker run --rm \
  -p 4649:4649 \
  -p 4650:4650 \
  -p 7946:7946/tcp \
  -p 7946:7946/udp \
  --env-file /etc/nomatron/nomatron.env \
  -v "$(pwd)/nomatron.hcl:/etc/nomatron/nomatron.hcl:ro" \
  ghcr.io/nomatronio/nomatron-releases/nomatron:v0.1.7 \
  server --config /etc/nomatron/nomatron.hcl

Make sure the serf stanza in your config uses addresses and ports that other nodes can actually reach, and that firewalls allow the Serf port over both TCP and UDP.

File Permissions And Runtime User

The published image runs as a non-root user.

That is good for hardening, but it means any mounted config file, TLS material, or other runtime files must be readable by the container user. On Linux hosts, check file permissions carefully before assuming the mount will work.

Dev Mode Limitation

The published server container is not the right place to use nomatron server --dev.

Dev mode shells out to the local Docker CLI to provision a temporary PostgreSQL container. The published Nomatron image is distroless and does not include the Docker CLI, so --dev should be run from the locally installed Nomatron binary on your workstation instead.

Use the Getting Started guide for the supported local dev flow.

Health And Verification

After startup, verify the container in three places:

1. Container Logs

You should see:

  • starting server
  • db connecting
  • rbac seeded
  • starting agent grpc server

If you see repeated connection failures to PostgreSQL or licensing errors, fix those first before troubleshooting anything higher up the stack.

2. Health Endpoint

Nomatron exposes:

text
/api/v1/health

For a local test:

bash
curl http://localhost:4649/api/v1/health

If the server is healthy, the endpoint should return success for the current node.

3. Browser Access

Open:

text
http://localhost:4649/ui

or your external api_addr if the container is behind a reverse proxy or load balancer.

Common Failure Modes

These are the most common Docker-specific startup issues:

ProblemWhat it usually means
licensing cluster_key is required for connected mode or NOMATRON_ENCRYPTION_KEY is requiredThe environment file is missing the cluster key or encryption key.
NOMATRON_SERF_JOIN is removed; use NOMATRON_SERF_RETRY_JOIN insteadA removed join setting is still present. Switch to retry_join.
failed to connect to databasePostgreSQL is unreachable from the container host, or the DSN is wrong.
The UI loads but callbacks or links are wrongserver.api_addr is missing or does not match the external URL users should use.
Agents cannot connectPort 4650 is not published, blocked, or routed correctly.
Multi-node clustering does not formThe Serf port is not published, advertise_addr is wrong, UDP is blocked, or retry_join peers are not reachable.
Mounted config or TLS files cannot be readHost file permissions do not allow the non-root container user to read them.

For most operators, the cleanest Docker-based pattern is:

  1. keep PostgreSQL outside the Nomatron container;
  2. store the Nomatron config file outside the image, and secrets in a root-only environment file or secret store;
  3. run database init once before first startup;
  4. run the server container with 4649 and 4650 published as needed; and
  5. terminate TLS at a reverse proxy or load balancer unless you have a specific reason to terminate it directly in Nomatron.

If you want to schedule the same image inside Nomad rather than with a plain docker run, continue to the Nomad job page.