Install an agent
Weik.io 2026.2An agent runs your integrations on an on-premise host or in your cloud account. Its host opens no inbound port, because the agent connects out to Weik.io on port 443. Product page · Video
Watch: Sites and agents, 4:25
The video enrols an agent and runs its bundle on a host, then checks that the agent is online.
This part of the video couldn't be loaded.
On this page
An agent runs your integrations on an on-premise host or in your cloud account. A cloud agent runs them beside the hub. Each agent comes with a small message server, the leaf node, which links out to your Weik.io installation. The same install can add a gateway that serves APIs on that host, or run the gateway alone.
The agent’s host only connects out, to the installation’s two names on TCP 443. Open no port towards it except the entrances of a gateway it runs.
The central part of your installation is called the hub. You see that word in setup.sh and in the admin UI.
This page installs an agent on a Linux host. For Windows Server 2022 and 2025, see Agents on Windows.
The hub runs a message server, the backend, the gateway and the log, metric and trace stores on one server, or on as many as you need for high availability, and it publishes port 443. Agents in three places connect to it: at a factory inside a customer network, in the customer's Azure account and as cloud agents in Weik.io Cloud. Each agent has a leaf node beside it and starts one Java process per running integration, and it opens two outbound connections to the hub on port 443, wss for the leaf node and https for telemetry. No agent accepts an inbound connection.
Enrol an agent#
Installing an agent has two steps. You enrol it with weikio agent enrol or Settings, Agents, Enrol agent, and then you run its setup script on the host.
A platform administrator enrols the agent. The command writes the agent’s bundle into a folder:
$ weikio agent enrol agent-fi-01 --host linux-compose \
--capabilities os=linux,region=fi,environment=devtest,environment=production \
--projects finance,hr \
--out ./agent-fi-01/Flags of weikio agent enrol set how the agent links to the hub and what it runs:
| Flag | What it does |
|---|---|
--via public |
Links the agent through the hub’s published address on port 443 (the default) |
--via hub- |
Links a cloud agent inside the hub’s network to the hub’s leaf port 7422, which needs no public name |
--runs integrations,gateway |
Adds a gateway on the agent’s host, as Gateways at sites describes |
The command prints the next steps as a numbered list. The folder can’t be downloaded again. If you lose it, weikio agent credentials agent-fi-01 issues a new one and withdraws the old credential.
The CLI and the admin UI call the agent’s stack a site, so they call this folder the site bundle and the agent’s host the site host. Every file in the folder goes to the agent’s host:
| File | What it has |
|---|---|
docker- |
The agent and leaf node containers and their pinned images |
setup.sh |
The setup script you run on the agent’s host |
.env |
The images docker- runs, which an upgrade replaces |
agent.env |
The agent’s ID, the local leaf URL and WEIKIO_HOME |
agent. |
The agent’s credential for the leaf node’s link to the hub |
leaf.conf |
The leaf node’s configuration, which links it to the hub |
agent.nk |
The agent’s key for the leaf node |
runtime. |
The password every integration uses with the leaf node |
Install the agent#
Copy the folder to the agent’s host and run its setup script there as root:
$ scp -r agent-fi-01 site-host:
$ ssh -t site-host 'cd agent-fi-01 && sudo sh ./setup.sh'The script places the files in /opt/weikio/agent-fi-01, or in the folder you give with --dir, and sets their owner and modes. Then it starts the stack and waits until the agent reports to the hub. Once the agent is online, it receives the deployments that already match it.
Check the agent from your machine:
$ weikio get agentsNAME ID HOST RUNS STATUS CAPABILITIES PROJECTS VERSION BEHIND LAST SYNC RUNTIMES
agent-fi-01 01k5x765rwwyedaqwwb82pdvd1 linux-compose integrations online os=linux region=fi environment=devtest,production finance, hr 2026.2.2 - 4s ago 4 running
agent-fi-02 01k5x9m2qv7r3t8wz4hc6yj0fd linux-compose integrations online os=linux region=fi environment=production finance 2026.2.2 - 12s ago 1 runningTo check the agent in the admin UI, open it under Settings › Platform › Agents.




Then delete the folder on both machines, because it contains the agent’s credential.
What the host needs#
The agent’s image is built for x86-64. The tested host runs Ubuntu 24.04 LTS with Linux kernel 6.8 on x86-64 and has Docker 29.9.2 and Compose 5.6.1 from Docker’s package repository.
| Part | What the host needs |
|---|---|
| Memory for the agent | About 110 MB |
| Memory for each integration it runs | About 131 to 136 MiB |
| Memory for telemetry | 200 to 230 MiB for what the agent keeps while the hub is out of reach |
| Disk | About 0.9 GB for the images, and about 0.55 GB more for a gateway’s, on a disk encrypted as Encryption at rest describes |
| Network | TCP 443 to the two names of your Weik.io installation, which the network’s own DNS resolves |
| Registry | Docker Hub or the registry in the bundle’s .env, at the install and at every upgrade |
| Clock | In sync |
The figure for each integration was measured with a timer integration that splits a list. An integration’s Java heap may grow to 256 MB unless you give its deployment another size.
The agent checks the hub’s certificate against the host’s clock, which Ubuntu keeps in sync by default with systemd-timesyncd.
When the host’s network already uses Docker’s default address ranges, an integration can’t reach a host there. Give Docker other pools in /etc/docker/daemon.json before the setup script runs, then restart Docker:
{ "log-driver": "json-file", "log-opts": { "max-size": "50m", "max-file": "3" },
"default-address-pools": [ { "base": "10.240.0.0/16", "size": 24 } ] }Capabilities and projects#
An agent runs the deployments that match its capabilities and projects. An administrator writes the agent’s capabilities as key and value pairs, such as os, region, site, datacenter or environment. An integration lists what it needs as requirements:
name: erp-invoice-export
version: 1.0.0
requirements: { os: linux, region: fi }A deployment adds its environment to these requirements. A deployment of this integration to production runs on every agent that has the capabilities os=linux region=fi environment=production and whose projects include the integration’s project. Two matching agents run two copies, which is how an integration gets high availability.
A numeric capability matches at least its value, so memoryGb: 8 matches an agent with memoryGb=16. Where an integration runs has the rest of the matching rules.
A requirement matches only the capabilities an administrator wrote, not the os and arch the agent reports when it connects.
Change an agent#
When you change an agent’s capabilities or projects, the deployments that no longer match leave the agent at its next sync:
$ weikio agent set-capabilities agent-fi-02 os=linux region=fi environment=productionTarget: https://hub.example
1 deployment leaves the agent at its next sync: devtest/finance/erp-invoice-export.
Continue? [y/N] y
agent agent-fi-02 updated (capabilities os=linux region=fi environment=production, revision 4201)The agent then fetches a new credential in place of the old one. The leaf node’s link to the hub goes down once and comes back.
weikio describe agent shows what each deployment should run on the agent beside what it runs:
$ weikio describe agent agent-fi-01Agent: agent-fi-01
ID: 01k5x765rwwyedaqwwb82pdvd1
Host: linux-compose
Status: online
Environments: devtest, production
Capabilities: os=linux region=fi environment=devtest,production
Projects: finance, hr
Last sync: 4s ago
Version: 2026.2.2
Reaches the hub via: public
Hub addresses: wss://nats.acme.example:443
DEPLOYMENT DESIRED ACTUAL DIFF STOP DEADLINE
devtest/finance/erp-invoice-export 1.1.0 started 1.1.0 running (pid 4121) in sync 70s (shutdownTimeout 45, extraShutdownTimeout 15 (Camel's defaults))
production/finance/erp-invoice-export 1.1.0 started 1.0.0 running (pid 3980) version behind: restarting 70s (shutdownTimeout 45, extraShutdownTimeout 15 (Camel's defaults))
production/finance/nightly-payroll stopped stopped in sync -
devtest/sandbox/hello 0.1.0 started absent bundle not yet fetched -Drain and revoke#
Drain an agent before maintenance. A draining agent gets no new deployments and keeps running the ones it has, so you can move them off one at a time:
$ weikio agent drain agent-fi-02Target: https://hub.example
agent agent-fi-02 draining (since 2026-09-22 15:02 UTC, revision 4203)
New deployments aren't placed on it.
2 deployments keep running until you move or stop them:
production finance/erp-invoice-export (running 1.1.0)
production finance/nightly-payroll (stopped)
To move it, run:
weikio deploy finance/erp-invoice-export --env production --version 1.1.0
To stop it instead, run:
weikio undeploy finance/erp-invoice-export --env productionTo let the agent take new deployments again, run weikio agent undrain agent-fi-02.
weikio agent revoke agent-fi-02 stops the deployments on the agent. From then on, the agent can’t connect to the hub. To take an agent out of use, drain it and move what’s left, then revoke it and delete its record.
Behind a proxy#
When the agent’s host reaches the hub only through an HTTP proxy, set the proxy before the setup script runs:
- The Docker daemon’s proxy in
/etc/docker/daemon.json, for the image pulls - Root’s Docker client proxy in
/root/.docker/config.json, which the agent passes on to its integrations - A
proxyblock in the hub link of the bundle’sleaf.conf
The host’s network also needs DNS for the installation’s two names.
With the proxy block, the link’s line in leaf.conf looks like this:
{ urls: ["wss://nats.acme.example:443"], no_randomize: true, credentials: "/etc/nats/agent.creds", deny_exports: ["weikio.out.>"], account: SITE, proxy: { url: "http://proxy.corp.example:3128" } }Make the same edit in every bundle Weik.io issues for the agent later.
An integration’s calls go through the proxy with Java’s proxy properties, which the agent sets from HTTP_PROXY, HTTPS_PROXY and NO_PROXY.
If the proxy inspects TLS, leave the installation’s two names out of the inspection, or put the proxy’s certificate authority into the bundle’s hub-ca.crt.
While the hub is away#
While an agent can’t reach the hub, it keeps running its integrations and tries the hub again. When the hub hasn’t replied for longer than the environment’s offline limit, the agent stops the integrations and keeps their files. It starts them again when the hub replies.
The offline limit is 24 hours unless the environment’s --offline-start-max-age sets another. An agent that restarts while the link is cut starts its integrations from its stored copy only within that limit.
The agent’s host keeps the telemetry of everything it runs on its disk, up to 4 GiB per agent and per gateway, or a tenth of the free disk when that’s less. It sends the telemetry with its original times once the hub accepts it again. A proxy or CDN in front of the hub must answer with a status from 502 to 504 while the hub is out of reach, because an agent’s host discards a batch answered with any other status.
Upgrade an agent#
Upgrade each agent with the images.env of the release you upgraded the hub to. In the folder the setup script installed the agent in, run:
$ sudo sh ./setup.sh --upgrade <images.env>The script pulls the images the file lists and replaces the agent’s .env with the file. Then it recreates what changed and waits until the agent is online again.
An agent on an older release keeps working and shows as behind. weikio problems lists it with the release to upgrade to. When you deploy a version that needs a newer agent, the deploy prints which agent release it needs.