Skip to content
Weik.ioDocs
2026.2
Try Weik.io

Install Weik.io on one server

Weik.io 2026.2

Install Weik.io on one Linux server with weikio-backend init and Docker Compose, then sign in with two-factor and connect the weikio CLI.

On this page

Install Weik.io on one server from the release files on weik.io. For several servers, see Install Weik.io on several servers.

Your Weik.io installation runs in one Docker Compose stack:

  • The terminator, which publishes port 443
  • The backend, which serves the admin UI and the API
  • The API gateway
  • The message server, which keeps its storage
  • The three telemetry stores
  • The backup service
  • The telemetry forwarder

The central part of your installation is called the hub, the word you see in setup.sh.

Before you start#

The server#

The stack is tested on a hub server with 4 virtual CPUs on x86-64 and 8 GB of memory. The server runs Ubuntu 24.04 LTS with Linux kernel 6.8.

Builds of integrations run isolated with Landlock on Linux 6.7 or later, which Ubuntu 24.04 has turned on. On an older kernel, or with Landlock off, Weik.io installs, but builds don’t run and doctor warns about it. A platform administrator can allow builds with weaker isolation, as Keeping integrations apart describes.

Disk#

For Disk space
The message server’s storage The storage budget you give init, plus a quarter of it
The images About 2 GB
The telemetry stores Up to about 75 GB with their default caps

The tested disk of 160 GB has room for all of them with --disk-budget 40GiB and about 29 GB to spare. Storage and its budget has the numbers behind this.

Encrypted disks#

Put Docker’s data folders and the installation’s home on an encrypted disk, and set it up before you install Docker. Encryption at rest has the steps for Hetzner and bare metal.

Disk speed#

The speed of the message server’s disk sets how many events a second the hub stores.

Disk of the tested server Time of one write Events the hub stored a second
The server’s local solid-state disk About 1 ms About 600
A network-attached disk 5 to 9 ms 70 to 100

Measure your disk once it’s mounted. dd prints the time of 1,000 writes, so divide that time by 1,000. The second command removes the test file:

Terminal
$ dd if=/dev/zero of=/data/disk-speed bs=4k count=1000 oflag=dsync
$ rm /data/disk-speed

Docker#

The stack runs on Docker Engine with the Compose plugin 2.20.2 or later. It’s tested with Docker 29.9.0 and Compose v5.6.0.

Docker rotates the log of each container of the stack at 50 MB and keeps the newest three files. To limit the logs of the host’s other containers the same way, put this in /etc/docker/daemon.json:

/etc/docker/daemon.json
{ "log-driver": "json-file", "log-opts": { "max-size": "50m", "max-file": "3" } }

Then run systemctl restart docker.

Updates#

Bring the server and its kernel up to date before you install. If Ubuntu then writes /var/run/reboot-required, restart the server first.

Terminal
$ apt-get update && apt-get dist-upgrade

Names#

Create a DNS record that points at the server for each of the installation’s names:

  • The backend’s name, such as acme.example, which serves the admin UI and the API
  • The name of the published leaf address, such as nats.acme.example, which the agents link to

Later you add a record for each gateway hostname that points at the hub, such as api-test.acme.example.

Ports#

Only TCP 443 has to be reachable from outside, because the hub serves the installation’s names on that port.

Create the home and master key#

Run the commands on the server as root, for example with sudo. The installation’s home is /opt/weikio, owned by uid 1654, which is the user every Weik.io image runs as. Create the home and the master key, which seals every secret Weik.io keeps:

Terminal
$ install -d -o 1654 -g 1654 -m 0700 /opt/weikio
$ head -c 32 /dev/urandom > /opt/weikio/master.key && chown 1654:1654 /opt/weikio/master.key && chmod 0400 /opt/weikio/master.key

Download and check the release#

Each release publishes images.env, which has one line per image pinned by tag and digest, and SHA256SUMS. The block below downloads both files and checks images.env against its checksum. Then it gets the backend image from images.env. Put the release’s version in place of <version>, such as 2026.2.4:

Terminal
$ curl -fsSLO --proto =https --proto-redir =https https://weik.io/downloads/releases/<version>/images.env \
  && curl -fsSLO --proto =https --proto-redir =https https://weik.io/downloads/releases/<version>/SHA256SUMS \
  && sha256sum -c --ignore-missing SHA256SUMS \
  && IMG=$(grep '^WEIKIO_IMAGE_BACKEND=' images.env | cut -d = -f 2-) \
  && printf '%s\n' "$IMG" | grep -Eq '^[A-Za-z0-9._:/-]+/weikio/weikio-backend:[^@ ]+@sha256:[0-9a-f]{64}$' \
  || { echo "images.env did not pass its checks, so nothing was started: download both files again, and check that WEIKIO_IMAGE_BACKEND names the release's backend image as <registry>/weikio/weikio-backend:<release>@sha256:<digest>." >&2; exit 1; }
You see
images.env: OK

On any other result, download both files again before you go on. A checksum that doesn’t match, or an image line of the wrong shape, stops the block before anything starts.

Create the installation#

weikio-backend init runs once in the backend image and writes the stack into /opt/weikio/deploy/compose/single. Give it the two names and the storage budget:

Terminal
$ docker run --rm -u 1654:1654 -v /opt/weikio:/opt/weikio -e WEIKIO_HOME=/opt/weikio -e Weikio__Keys__Dir=/opt/weikio/keys \
  -e WEIKIO_MASTER_KEY_FILE=/opt/weikio/master.key -e Weikio__Nats__Urls__0=nats://nats:4222 -e WEIKIO_BACKEND_IMAGE=$IMG \
  $IMG weikio-backend init --public-base-url https://acme.example --public-leaf-url wss://nats.acme.example:443 --disk-budget 40GiB

The command prints the installation’s operator seed once. A restore needs both the seed and master.key, which the backup archives don’t contain. Save the seed and a copy of master.key outside this server, apart from the backup archives.

--disk-budget caps the message server’s storage. The budget can be at most 80 % of the disk under that storage. Weik.io reserves part of the budget:

For Reserved
The installation’s stores About 10.2 GiB
Each project 1 GiB
Each environment About 3.1 GiB

A budget of 40 GiB therefore has room for three environments and 20 projects of the default size. You can raise the budget later while the hub runs, as Storage and its budget shows.

Some flags work only with the first init:

Flag What it does
--hub-network-leaf-url nats://nats:7422 Links an agent that runs on this server over the hub’s network
--dev Writes a stack to try Weik.io on one host and creates an agent called dev. It also creates the project sandbox and the environment devtest
--hub-names-authority platform Has the platform’s own authority sign the installation’s names
--authority-names corp.example,factory.local Limits the platform’s own authority to names under the suffixes you give

A --dev stack needs at least --disk-budget 15GiB.

By default the images come from Docker Hub and the certificates from Let’s Encrypt. Both services operate from the United States. To pull the images from a registry of your own, mirror them into it with their upstream paths and give init the registry in --registry, as Air-gapped installations describes. To get the certificates from another ACME authority, give its directory in --certificate-authority and the email address the authority writes to in --certificate-contact. To have the platform’s own authority sign the installation’s names instead, use --hub-names-authority platform from the table above, as Certificates describes.

Files of the stack#

Each file in the stack folder belongs either to the platform or to you. An upgrade writes the platform’s files again for the new release and leaves yours unchanged.

File Whose What it is
docker-compose.yaml The platform’s The stack
upgrade.sh The platform’s The script that moves the stack to a release and back
raise-budget.sh The platform’s The script that raises the storage budget while the hub runs
standby-refresh.sh The platform’s The script that keeps a standby hub restored
weikio-install.json The platform’s The install record of the choices you gave init
README.md The platform’s The stack’s guide for this release
.env Yours The settings you change day to day
docker-compose.override.yaml Yours, once you create it Services and settings you add

Leave COMPOSE_FILE unset, so that docker compose loads docker-compose.override.yaml together with the stack file.

Start the stack#

Point the two DNS records at the server, then start the stack in its folder:

Terminal
$ cd /opt/weikio/deploy/compose/single
$ docker compose up -d
$ docker compose ps -a
$ docker compose logs init
$ (umask 077; docker compose logs init | awk '/first platform-admin API key/ {print $NF}' > first-api-key)
$ test -s first-api-key && docker compose rm -f init
$ docker compose run --rm infra weikio-backend doctor

In docker compose ps -a, check the state of each service:

  • nats healthy
  • infra and init exited with 0
  • backend, apim, splitter, terminator, backup, forwarder and the three stores up

The first platform-admin API key and the set-password link appear only once, in docker compose logs init. The key is never stored, so the awk line saves it into first-api-key, a file only root can read. Once that file has the key, docker compose rm -f init removes the init container with its log.

doctor prints a line for each check. The line starts with the result and the name of the check, followed by what the check found. A line whose result is warn or fail ends with fix: and the command that fixes it. Any fail makes doctor exit with an error.

Once the names point at the server, the platform gets its first certificates from Let’s Encrypt by default. Until then the admin UI serves a temporary certificate and browsers show a warning.

Sign in the first time#

  1. Open the set-password link from the init log.
  2. Choose a password for the local admin.
  3. Enrol an authenticator app. From then on, you sign in with the password and the app’s code.

The admin UI then shows ten recovery codes once. If you lose the authenticator app, each code signs you in once, as Two-factor sign-in describes. Keep the codes apart from Weik.io, as you keep the master key.

Connect the CLI#

Install the weikio CLI on your own machine and sign in with the key from first-api-key. When you give the key on standard input, weikio login uses that key and opens no browser. Remove every copy of the file once the login has stored the key.

Terminal
$ curl -fsSL https://weik.io/install.sh | sh
$ weikio login https://acme.example < first-api-key
$ rm first-api-key

On a machine with a browser, weikio login https://acme.example opens the installation’s approval page instead, where you approve the key.

Create a project and an agent#

Create a project and an environment with the gateway that serves its APIs, and make them the context of the next commands. Then enrol an agent for the server that runs the integrations:

Terminal
$ weikio project create sales
$ weikio create env test --entity-store-bytes 512MiB
$ weikio gateway create test --env test --hostname api-test.acme.example --networks internet --default -y
$ weikio context set --project sales --env test
$ weikio agent enrol site-a --host linux-compose --via public --capabilities environment=test --out ./site-a

The enrolment writes the agent’s bundle into ./site-a, which you get only once. Copy the folder to the agent’s host and run its setup script there as root:

Terminal
$ scp -r ./site-a site-host:
$ ssh -t site-host 'cd site-a && sudo sh ./setup.sh'

Then delete the folder on both machines, because it contains the agent’s credential. Once weikio get agents lists the agent as online, write the first integration and run it:

Terminal
$ weikio init hello
$ weikio run ./hello

weikio run follows the integration’s log lines until you press Ctrl-C, which leaves the integration running. Install an agent covers the agent’s options. Your first integration explains what you just ran.

Sign in to the live demo

Sign in with the shared viewer account. It can open every screen of the example projects but can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo