Deployment example

A main server + connector server deployment on Linux x86_64. The web client and server are same-origin behind a reverse proxy.

1. Main server

First put keragi-wasmx-linux-x64.tgz, keragi-resx.tgz, keragi-msgx.tgz and keragi-userx.tgz from the downloads page in the current directory:

npm install -g ./keragi-wasmx-linux-x64.tgz
wasmx init /opt/clientx --preset main --offline .
cd /opt/clientx
cp .env.example .env

Edit /opt/clientx/.env:

WASMX_ADDR=127.0.0.1:3001
WASMX_DB=sqlite://data/keragi.db
JWT_SECRET=replace-with-at-least-32-random-characters
BOOTSTRAP_ADMIN_CREDENTIAL=admin@example.com
BOOTSTRAP_ADMIN_PASSWORD=replace-with-a-strong-password
USERX_ADMIN_URL=http://127.0.0.1:3001/userx
USERX_PUBLIC_URL=http://127.0.0.1:3001/userx
USERX_ADMIN_CREDENTIAL=admin@example.com
USERX_ADMIN_PASSWORD=replace-with-a-strong-password

--preset main installs resx, msgx and userx. Add AI if needed:

wasmx add ../keragi-agix.tgz
wasmx stop
wasmx start

2. Connector server (optional, separate machine)

The connector must run on a machine that can access the local AI CLIs:

npm install -g ./keragi-wasmx-linux-x64.tgz
wasmx init /opt/keragi-connector --preset connector --offline .
cd /opt/keragi-connector
cp .env.example .env

Edit /opt/keragi-connector/.env:

Start it:

wasmx start
wasmx status

3. Verify the servers

curl http://127.0.0.1:3001/status        # main server (resx provides /status)
curl http://127.0.0.1:3002/conn/health   # connector server (conn provides the health check)

4. Deploy the web client

Download keragi-app-web.tar.gz:

mkdir -p /var/www/clientx
tar xzf keragi-app-web.tar.gz -C /var/www/clientx
cp /var/www/clientx/config.example.json /var/www/clientx/dist/config.json

For same-origin deployment, use relative paths in config.json:

{
  "meta": { "version": "0.1.0", "mode": "private" },
  "services": {
    "userx": "/userx",
    "msgx": "/msgx",
    "agix": "/agix",
    "conn": "/conn"
  },
  "capabilities": { "connector": true }
}

5. Reverse proxy