FEYN

Relayt Server - Self-Hosting Guide

This guide shows you how to run Relayt Server in your own environment. You can run it:

OptionBest forSection
A. Docker ComposeMost installs. Optionally includes a PostgreSQL database.Option A
B. Linux VM with systemdA long-running service on a VM or bare-metal server.Option B
C. Standalone jarQuick trials, or servers without systemd.Option C

All three options use the same configuration file (config/relayt.env), the same certificates and the same database.

Contents

  1. What you need
  2. What is in the download
  3. Quick start (Docker with bundled PostgreSQL)
  4. Step 1 - Database
  5. Step 2 - TLS certificates
  6. Step 3 - Configuration file
  7. Step 4 - Run the server
  8. First login and verification
  9. Environment variable reference
  10. Operations
  11. Troubleshooting
  12. Examples: langgraph-agent and google-adk-agent

1. What you need

RequirementDetails
ServerLinux, macOS or Windows. 2 CPU cores and 2 GB RAM are enough to start.
NetworkInbound TCP 8443 (HTTPS). Outbound access to your database, your SMTP server and, if you enable social sign-in, to Google and Microsoft.
Docker pathDocker 24 or later with Docker Compose v2.20 or later (docker compose version).
VM / standalone pathJava 17 or later (java -version).
DatabasePostgreSQL 12 or later. You can use your own, or let Docker Compose start one for you.
Tools for the helper scriptsbash and openssl, plus keytool (included with any JDK/JRE) or Docker. On Windows, run the scripts in WSL or Git Bash.
SMTP serverUsed to send password-reset codes. Any SMTP service works (your mail relay, Microsoft 365, Gmail, Amazon SES).
DNS nameA hostname for the server, for example relayt.example.com. The certificate is issued for this name.

Important: Relayt Server only serves HTTPS, and it authenticates agents with client certificates (mutual TLS). If you put a reverse proxy or load balancer in front of it, it must pass TLS through unchanged (Layer 4 / TCP mode). A proxy that terminates TLS removes the agent's certificate and breaks agent authentication.

2. What is in the download

Extract relayt-server-<version>.zip (or .tar.gz). To verify the download first, run sha256sum -c SHA256SUMS (macOS: shasum -a 256 -c SHA256SUMS).

relayt-server-<version>/
├── README.txt                     Short pointer to this guide
├── SELF-HOSTING.md                This guide
├── openapi-mtls.yaml              OpenAPI (Swagger) spec for the agent API (mutual TLS)
├── VERSION                        Release version
├── relayt-server.jar              The application (Java 17+)
├── Dockerfile                     Builds a container image from the jar
├── docker-compose.yml             Server, plus optional PostgreSQL (profile "with-db")
├── config/
│   └── relayt.env.example         Configuration template -> copy to config/relayt.env
├── sql/
│   └── setup.sql                  Creates the "relayt" database and tables
├── scripts/
│   ├── generate-certs.sh          Creates a private CA, server keystore and truststore
│   ├── issue-client-cert.sh       Issues a client certificate for an agent
│   ├── generate-secrets.sh        Generates JWT_SECRET (and the bundled DB password)
│   └── run-standalone.sh          Starts the jar without Docker or systemd
├── systemd/
│   └── relayt-server.service      systemd unit for Linux VMs
├── certs/                         Generated certificates go here
└── examples/                      Example agents you can build and run (see section 12)
    ├── README.md                  Overview and quick path
    ├── langgraph-agent/           Python / LangGraph agent: source, README, Dockerfile, scripts
    ├── google-adk-agent/          Java / Google ADK agent: source, README, Dockerfile, scripts
    └── certs/                     Keystores and truststores of the examples, created by their scripts

Run all commands in this guide from the extracted folder.

3. Quick start (Docker with bundled PostgreSQL)

This is the fastest way to get a working server. Replace relayt.example.com with your hostname (and add --ip 10.0.0.5, with your address, if clients connect by IP address).

# 1. Create TLS certificates for your hostname. --examples also adds localhost,
#    relayt-server and host.docker.internal, which the curl check below, the
#    Admin UI on this machine and the example agents (section 12) use.
scripts/generate-certs.sh --dns relayt.example.com --examples

# 2. Create your configuration file
cp config/relayt.env.example config/relayt.env

# 3. Generate JWT_SECRET, the database password and the keystore passwords
scripts/generate-secrets.sh --apply config/relayt.env --bundled-db

# 4. Edit config/relayt.env: set SMTP_HOST, SMTP_USERNAME and SMTP_PASSWORD
#    (see section 9). Everything else is already filled in.

# 5. Start the server and the bundled database
docker compose --env-file config/relayt.env --profile with-db up -d --build

# 6. Check it is up
curl -k https://localhost:8443/ping        # prints nothing and returns HTTP 200

Note: variables exported in your shell (for example DB_PASSWORD in ~/.zshrc) override config/relayt.env and can cause required variable DB_PASSWORD is missing a value. If you see it, run unset DB_USERNAME DB_PASSWORD and retry (see Troubleshooting). With Docker only DB_USERNAME, DB_PASSWORD and the optional RELAYT_* variables are affected; other exported variables such as JWT_SECRET do not need to be unset.

Then open https://relayt.example.com:8443/admin/setup to create the first administrator (section 8).

Want to see an agent talk to the server? The download includes two ready-to-run example agents. See section 12.

The rest of this guide explains each step, the other deployment options, and how to use your own database or certificates.


4. Step 1 - Database

Relayt Server stores its data in PostgreSQL. The schema is created by sql/setup.sql. The script is safe to run more than once: it creates the relayt database and tables only if they do not exist.

The server checks the schema at startup and refuses to start if tables are missing, so this step is mandatory.

Choose one of the two options.

4a. Option 1 - I do not have PostgreSQL (use the bundled one)

Nothing to install. With Docker Compose, add --profile with-db to the run command (section 7). Compose then:

  • starts a postgres:16 container with a persistent volume (relayt-pgdata);
  • creates the relayt database and runs sql/setup.sql automatically on the first start;
  • uses DB_USERNAME and DB_PASSWORD from config/relayt.env as the database user and password;
  • does not publish port 5432 to the outside world.

In config/relayt.env use:

DB_URL=jdbc:postgresql://postgres:5432/relayt
DB_USERNAME=relayt_app
DB_PASSWORD=<generated by scripts/generate-secrets.sh --bundled-db>

The bundled database setup script runs only when the data volume is empty. If you change DB_USERNAME or DB_PASSWORD later, remove the volume first (docker compose --env-file config/relayt.env --profile with-db down -v). This deletes all data.

4b. Option 2 - I already have PostgreSQL

1. Run the setup script with a database user that can create databases (for example postgres):

psql -h db.example.com -U postgres -f sql/setup.sql

This creates the database relayt and its tables. Keep the database name relayt.

If you cannot create databases (some managed services), ask your DBA to create an empty database named relayt first, then run the same command against it:

psql -h db.example.com -U your_admin_user -d relayt -f sql/setup.sql

The script enables the pgcrypto extension (CREATE EXTENSION IF NOT EXISTS pgcrypto). On PostgreSQL 13 or later this is permitted for ordinary database owners. On older versions it needs a superuser.

2. Create a database account for the application (recommended; you can use your admin account instead if you prefer):

-- run as an admin, e.g.:  psql -h db.example.com -U postgres -d relayt
CREATE ROLE relayt_app LOGIN PASSWORD 'choose-a-strong-password';
GRANT CONNECT ON DATABASE relayt TO relayt_app;
GRANT USAGE ON SCHEMA public TO relayt_app;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO relayt_app;

Use only letters and digits in the password, or at least avoid $, #, spaces and quotes (see the format rules in config/relayt.env.example).

3. Point the server at it in config/relayt.env:

DB_URL=jdbc:postgresql://db.example.com:5432/relayt
DB_USERNAME=relayt_app
DB_PASSWORD=choose-a-strong-password

To require TLS to the database, append ?sslmode=require to DB_URL.

4. Verify:

psql -h db.example.com -U relayt_app -d relayt -c '\dt'

You should see the tables users, callback_urls and messages.

Docker note: if PostgreSQL runs on the same machine as Docker, localhost inside the container is the container itself. On Docker Desktop use host.docker.internal in DB_URL. On Linux, also add this to the relayt-server service in docker-compose.yml:

    extra_hosts:
      - "host.docker.internal:host-gateway"

and make sure PostgreSQL listens on that interface and allows the connection in pg_hba.conf.


5. Step 2 - TLS certificates

Relayt Server needs two files, both in PKCS12 format:

FilePurposeVariable
KeystoreThe server's private key and certificate. Presented to every client, and also presented to agents when the server calls their callback URLs.KEYSTORE_PATH
TruststoreThe certificate authorities (CAs) the server trusts: those that issued your agents' client certificates, and those that issued the certificates of the agent callback endpoints the server calls.TRUSTSTORE_PATH
scripts/generate-certs.sh --dns relayt.example.com
# Add --ip 10.0.0.5 if clients connect by IP. Repeat --dns or use commas for more names:
scripts/generate-certs.sh --dns relayt.example.com,relayt-internal.example.com --ip 10.0.0.5

It writes these files to certs/:

FileWhat it isShare it?
keystore.p12Server key and certificateNo
truststore.p12Contains your private CANo
ca.crtYour private CA certificateYes, give it to agents and clients
ca.keyPrivate CA keyNo. Keep it safe, or move it offline once you have issued all certificates
server.crt, server.keyServer certificate and key in PEM formNo
store-passwords.envKEYSTORE_PASSWORD and TRUSTSTORE_PASSWORDNo

Add --examples to also include localhost, relayt-server and host.docker.internal in the server certificate. The example agents need these names. It can be used on its own (scripts/generate-certs.sh --examples) or together with your hostname (scripts/generate-certs.sh --dns relayt.example.com --examples).

Use --days N to change the server certificate lifetime (default 730 days).

To change the server certificate later (add a name, add --examples, or renew it), run the script again with the full list of names. It keeps the existing CA, truststore.p12 and the passwords in store-passwords.env, and re-issues only the server certificate and keystore.p12. Agent certificates and config/relayt.env stay valid; restart the server to load the new certificate. This needs ca.key, so bring it back first if you moved it offline.

To start over, add --force. This creates a new CA and new store passwords, so all previously issued agent certificates stop working, and you must copy the new passwords into config/relayt.env with scripts/generate-secrets.sh --apply config/relayt.env --force. Do not add --bundled-db to that command if the bundled database already exists: it would replace DB_PASSWORD too. The --force also replaces JWT_SECRET, so everyone signs in again.

The script needs openssl and either keytool or Docker. It is equivalent to these manual commands, in case you prefer to run them yourself:

# CA
openssl req -x509 -new -nodes -newkey rsa:4096 -sha256 -days 3650 \
  -subj "/CN=Relayt Private CA" -keyout ca.key -out ca.crt

# Server certificate with a SAN (edit the names)
cat > server.ext <<'EOF'
basicConstraints = CA:FALSE
keyUsage = critical,digitalSignature,keyEncipherment
extendedKeyUsage = serverAuth,clientAuth
subjectAltName = DNS:relayt.example.com,IP:10.0.0.5
EOF
openssl req -new -nodes -newkey rsa:2048 -sha256 -subj "/CN=relayt.example.com" \
  -keyout server.key -out server.csr
openssl x509 -req -sha256 -days 730 -in server.csr -CA ca.crt -CAkey ca.key \
  -CAcreateserial -extfile server.ext -out server.crt

# Keystore (server key + certificate + CA)
openssl pkcs12 -export -name relayt -inkey server.key -in server.crt \
  -certfile ca.crt -out keystore.p12            # asks for a password

# Truststore (the CA)
keytool -importcert -noprompt -alias relayt-ca -file ca.crt \
  -keystore truststore.p12 -storetype PKCS12    # asks for a password

5b. Issue a certificate for each agent

Agents (for example your LangGraph or other automation services) identify themselves to Relayt Server with a client certificate. The server matches the certificate's Subject Alternative Name (SAN) against the SAN you register for the agent's service account in the admin console.

scripts/issue-client-cert.sh --name my-agent --san "dns:my-agent.example.com"

The SAN is a comma-separated list of dns:, ip:, email: or uri: values, for example:

dns:my-agent.example.com
dns:my-agent.example.com,ip:10.0.0.7
uri:spiffe://example.com/agents/my-agent

The script prints the exact SAN string to paste into the admin console, and writes to certs/clients/my-agent/:

FileGive to the agent?
client.crt and client.key (PEM)Yes
client.p12 and client.p12.passwordYes (alternative to the PEM pair)
ca.crtYes, so the agent can trust the server

The certificate is valid for both client and server authentication. When the server delivers a message to the agent's callback URL, the agent's HTTPS endpoint should use this certificate (or another certificate signed by a CA in the truststore), and the server presents its own certificate to the agent.

Test it once the server is running:

curl --cacert certs/clients/my-agent/ca.crt \
     --cert certs/clients/my-agent/client.crt --key certs/clients/my-agent/client.key \
     https://relayt.example.com:8443/ping

Agent API reference (Swagger / OpenAPI)

Once an agent has its certificate, it uses three endpoints that authenticate with that certificate: POST /api/v1/sendForm, PUT /api/v1/disableForm and GET /api/v1/callbackUrls. They are documented, with request and response examples, in openapi-mtls.yaml (OpenAPI 3.1, included in the download).

To browse it, open the file in the Swagger Editor, or run Swagger UI locally:

docker run --rm -p 8080:8080 -e SWAGGER_JSON=/spec/openapi-mtls.yaml \
  -v "$PWD/openapi-mtls.yaml:/spec/openapi-mtls.yaml:ro" swaggerapi/swagger-ui
# then open http://localhost:8080

Swagger UI's "Try it out" cannot present a client certificate from a browser. Send test requests with curl (as above), Postman, Insomnia or Bruno, configured with the agent's client.crt and client.key.

5c. Alternative: use certificates from your own CA (or Let's Encrypt)

Keystore from PEM files (your certificate chain and private key):

openssl pkcs12 -export -name relayt \
  -inkey privkey.pem -in fullchain.pem \
  -out certs/keystore.p12          # choose a password; this is KEYSTORE_PASSWORD

For Let's Encrypt, privkey.pem and fullchain.pem are in /etc/letsencrypt/live/<name>/. You must rebuild and replace the keystore after each renewal, then restart the server.

Truststore containing the CA(s) that signed your agents' client certificates:

keytool -importcert -noprompt -alias my-ca -file my-ca.pem \
  -keystore certs/truststore.p12 -storetype PKCS12     # choose a password; this is TRUSTSTORE_PASSWORD

Repeat the command with a different -alias and -file for each CA.

Callbacks to publicly trusted endpoints: the truststore replaces Java's default trusted CAs. If any agent callback URL uses a certificate from a public CA, the truststore must contain that CA too. A simple way is to start from the Java default store:

cp "$JAVA_HOME/lib/security/cacerts" certs/truststore.p12
keytool -storepasswd -keystore certs/truststore.p12 -storepass changeit -new 'your-new-password'
keytool -importcert -noprompt -alias my-ca -file my-ca.pem \
  -keystore certs/truststore.p12 -storepass 'your-new-password'

If your stores use the older JKS format, also set SSL_KEYSTORE_TYPE=JKS and SSL_TRUSTSTORE_TYPE=JKS.

5d. Browser trust

If you use the private CA, browsers show a certificate warning for the admin console until you install certs/ca.crt as a trusted root on the administrators' computers. A certificate from a public CA avoids this.


6. Step 3 - Configuration file

cp config/relayt.env.example config/relayt.env
scripts/generate-secrets.sh --apply config/relayt.env              # JWT_SECRET + keystore passwords
scripts/generate-secrets.sh --apply config/relayt.env --bundled-db # ...and DB_PASSWORD, if using the bundled database
chmod 600 config/relayt.env

--apply only replaces values that are still the placeholder CHANGE_ME, so it never overwrites something you set. Run generate-certs.sh first so the keystore passwords are available.

Then open config/relayt.env and complete the Required variables that are still placeholders (at minimum SMTP_HOST, SMTP_USERNAME, SMTP_PASSWORD, and DB_* if you use your own database). Every variable is explained in section 9.

Rules for the file (also written at the top of it):

  • One KEY=value per line. No quotes, no export, no spaces around =.
  • Comments only on their own line, starting with #.
  • Avoid $, #, spaces and quotes inside passwords and secrets.
  • Do not leave an optional variable as an empty KEY=. Comment the line out instead.
  • Certificate paths need the file: prefix.

7. Step 4 - Run the server

Option A: Docker Compose

Always pass --env-file config/relayt.env.

With the bundled PostgreSQL:

docker compose --env-file config/relayt.env --profile with-db up -d --build

With your own PostgreSQL:

docker compose --env-file config/relayt.env up -d --build

--build builds the image locally from relayt-server.jar (no registry or account needed).

Common commands:

docker compose --env-file config/relayt.env ps
docker compose --env-file config/relayt.env logs -f relayt-server
docker compose --env-file config/relayt.env restart relayt-server
docker compose --env-file config/relayt.env --profile with-db down      # stop (keeps database data)

The compose file mounts ./certs into the container at /etc/relayt/certs (read-only), which is why the default KEYSTORE_PATH=file:/etc/relayt/certs/keystore.p12 works without changes.

The container runs as a non-root user. On Linux, if the log says it cannot read the keystore (permission denied), add your own user ids to config/relayt.env and re-run up -d:

RELAYT_UID=1000      # output of: id -u
RELAYT_GID=1000      # output of: id -g

To use a different host port, set RELAYT_PORT=9443 in config/relayt.env.

Option B: Linux VM with systemd

1. Install Java 17 or later (for example sudo apt install openjdk-17-jre-headless or sudo dnf install java-17-openjdk-headless).

2. Create a service user and folders:

sudo useradd --system --no-create-home --shell /usr/sbin/nologin relayt
sudo mkdir -p /opt/relayt /etc/relayt/certs

3. Install the files:

sudo install -o relayt -g relayt -m 644 relayt-server.jar /opt/relayt/relayt-server.jar
sudo install -o relayt -g relayt -m 600 config/relayt.env /etc/relayt/relayt.env
sudo install -o relayt -g relayt -m 600 certs/keystore.p12 certs/truststore.p12 /etc/relayt/certs/
sudo cp systemd/relayt-server.service /etc/systemd/system/

The default KEYSTORE_PATH and TRUSTSTORE_PATH (file:/etc/relayt/certs/...) already match these locations. For DB_URL, use the real database host (not postgres, which only exists inside Docker Compose).

4. Start it:

sudo systemctl daemon-reload
sudo systemctl enable --now relayt-server
sudo systemctl status relayt-server
journalctl -u relayt-server -f           # logs

If java is not at /usr/bin/java (check with command -v java), edit ExecStart in the service file.

Option C: Standalone jar

scripts/run-standalone.sh            # foreground, Ctrl+C to stop
scripts/run-standalone.sh start      # background; log in logs/relayt-server.log
scripts/run-standalone.sh status
scripts/run-standalone.sh stop

The script reads config/relayt.env (use --env FILE for another path) and needs Java 17 or later. Set KEYSTORE_PATH and TRUSTSTORE_PATH to the absolute location of your files, for example file:/home/me/relayt-server-1.0.0/certs/keystore.p12.

Or run the jar yourself, after exporting the variables from the env file in your own way:

java -jar relayt-server.jar

8. First login and verification

  1. Health check:
    curl -k https://relayt.example.com:8443/ping      # expect HTTP 200
    
    (-k skips certificate verification. To verify properly, use --cacert certs/ca.crt.)
  2. Create the master administrator. Open https://relayt.example.com:8443/admin/setup. This page is only available until the first administrator exists. Choose a strong password.
  3. Sign in at https://relayt.example.com:8443/admin.
  4. Create a service account for each agent. In the admin console, add the agent and paste the SAN string printed by issue-client-cert.sh. Then register the agent's callback URL(s) there. The agent can now call the agent API.
  5. Test password reset (this also tests your SMTP settings) using "Forgot password" on the admin login page.
  6. Try an example agent (section 12). It shows the whole flow, from an agent sending a form to a user submitting it.

9. Environment variable reference

All variables go in config/relayt.env. Variables are grouped into Required, Conditionally required and Optional. Defaults are shown where they exist.

9.1 Required

The server does not start if any of these is missing.

VariableDescriptionHow to get the value
DB_URLJDBC URL of the PostgreSQL database.Bundled database: jdbc:postgresql://postgres:5432/relayt. Your own: jdbc:postgresql://<host>:5432/relayt (add ?sslmode=require to require TLS). See section 4.
DB_USERNAMEDatabase user the server connects as.Bundled database: any name, for example relayt_app (it is created for you). Your own: the account from section 4b.
DB_PASSWORDPassword of that user.Bundled: scripts/generate-secrets.sh --apply config/relayt.env --bundled-db. Your own: the password you chose.
KEYSTORE_PATHLocation of the server keystore. Must start with file: and be an absolute path.file:/etc/relayt/certs/keystore.p12 (Docker and systemd). Created by scripts/generate-certs.sh, or see 5c.
KEYSTORE_PASSWORDPassword of the keystore.Printed and saved in certs/store-passwords.env by generate-certs.sh; copied into the env file by generate-secrets.sh --apply. If you made the keystore yourself, the password you chose.
TRUSTSTORE_PATHLocation of the truststore. Must start with file:.file:/etc/relayt/certs/truststore.p12. Created by generate-certs.sh.
TRUSTSTORE_PASSWORDPassword of the truststore.Same as KEYSTORE_PASSWORD above.
JWT_SECRETSecret used to sign login tokens. At least 32 characters. Use the same value on every instance. Treat it like a password. Changing it logs everyone out once.scripts/generate-secrets.sh --apply config/relayt.env, or generate one yourself: openssl rand -hex 32, openssl rand -base64 48, or python3 -c "import secrets; print(secrets.token_urlsafe(48))".
SMTP_HOSTHostname of the SMTP server used to send password-reset codes.From your mail provider. Examples: smtp.office365.com (Microsoft 365), smtp.gmail.com (Gmail, needs an app password), email-smtp.<region>.amazonaws.com (Amazon SES, use SMTP credentials, not IAM keys), or your internal relay.

9.2 Conditionally required

Required only in the situation described.

VariableNeeded whenDescriptionHow to get the value
SMTP_USERNAMESMTP_AUTH is true (the default).SMTP login. Also the default sender address (see MAIL_FROM).From your mail provider. Often the full e-mail address.
SMTP_PASSWORDSMTP_AUTH is true (the default).SMTP password.From your mail provider (an app password or SMTP credential).
MAIL_FROMSMTP_USERNAME is not set.Sender address of outgoing e-mail. Defaults to SMTP_USERNAME.An address your SMTP server allows you to send from, for example relayt@example.com.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETYou want "Sign in with Google". Set both or neither.OAuth client of your Google Cloud project.See Google setup below.
MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRETYou want "Sign in with Microsoft". Set both or neither.App registration in Microsoft Entra ID.See Microsoft setup below.
MICROSOFT_TENANT_IDYou want to limit Microsoft sign-in to one organisation. Default common (any Microsoft account).Directory (tenant) ID, or organizations (any work/school account), or consumers (personal accounts only).Entra admin center, your app registration, Overview, Directory (tenant) ID.
CORS_ALLOWED_ORIGINSA browser-based front end calls the REST API (for example /sendForm).Comma-separated list of allowed origins. Empty by default, which blocks cross-origin browser calls.The origins of your web apps, for example https://app.example.com,https://portal.example.com (scheme + host + port, no path).

If SMTP needs no login at all, set SMTP_AUTH=false, remove SMTP_USERNAME and SMTP_PASSWORD, and set MAIL_FROM.

Google sign-in setup

  1. Open the Google Cloud Console, create or select a project.
  2. APIs & Services > OAuth consent screen: configure the app (name, support e-mail).
  3. APIs & Services > Credentials > Create credentials > OAuth client ID. Choose Web application.
  4. Under Authorized redirect URIs add exactly: http://127.0.0.1:51739/oauth2/callback (replace 51739 if you changed OAUTH_REDIRECT_PORT).
  5. Copy the Client ID into GOOGLE_CLIENT_ID and the Client secret into GOOGLE_CLIENT_SECRET.

Microsoft sign-in setup

  1. Open the Microsoft Entra admin center > Applications > App registrations > New registration.
  2. Choose the supported account types you want (this should match MICROSOFT_TENANT_ID).
  3. Add the redirect URI http://127.0.0.1:51739/oauth2/callback (replace 51739 if you changed OAUTH_REDIRECT_PORT). The redirect URI must match exactly.
  4. Copy Application (client) ID into MICROSOFT_CLIENT_ID.
  5. Certificates & secrets > New client secret, copy the secret Value (shown once) into MICROSOFT_CLIENT_SECRET.

The redirect address points to 127.0.0.1 on the user's own computer, where the Relayt client listens during sign-in. It does not need to be reachable from the internet and has nothing to do with this server's address.

9.3 Optional

Everything here has a default. Leave the line commented out to keep it.

VariableDefaultDescription
SMTP_PORT587SMTP port. Use a STARTTLS port (587 or 25). Port 465 (implicit TLS) is not supported by the default settings.
SMTP_AUTHtrueWhether to log in to the SMTP server.
SMTP_STARTTLStrueWhether to upgrade the SMTP connection with STARTTLS.
SSL_KEYSTORE_TYPEPKCS12Keystore format: PKCS12 or JKS.
SSL_TRUSTSTORE_TYPEPKCS12Truststore format: PKCS12 or JKS.
JWT_ACCESS_EXPIRY_MS3600000 (1 hour)Lifetime of an access token in milliseconds.
JWT_REFRESH_EXPIRY_MS2592000000 (30 days)Lifetime of a refresh token in milliseconds.
OTP_EXPIRY_MINUTES10Minutes a password-reset code stays valid.
OAUTH_REDIRECT_PORT51739Local port the Relayt client listens on for the Google/Microsoft redirect. If you change it, update the redirect URIs in your Google and Microsoft apps.

9.4 Deployment settings (not read by the application)

These configure how the server is launched.

VariableDefaultUsed byDescription
JAVA_OPTS-XX:MaxRAMPercentage=75Docker, systemd, standaloneJVM options, for example -Xmx1g.
RELAYT_PORT8443Docker ComposeHost port that maps to the server's port 8443.
RELAYT_UID, RELAYT_GID10001Docker ComposeUser and group the container runs as. Set to your own ids on Linux if the container cannot read ./certs.

10. Operations

View logs

OptionCommand
Dockerdocker compose --env-file config/relayt.env logs -f relayt-server
systemdjournalctl -u relayt-server -f
Standalonetail -f logs/relayt-server.log

Back up the database

# Bundled database
docker compose --env-file config/relayt.env exec postgres sh -c 'pg_dump -U "$POSTGRES_USER" relayt' > relayt-backup.sql

# Your own database
pg_dump -h db.example.com -U relayt_app relayt > relayt-backup.sql

Also back up config/relayt.env and the certs/ folder. Without the CA key you cannot issue new agent certificates, and without JWT_SECRET users must sign in again.

Upgrade

  1. Download and extract the new bundle next to the old one.
  2. Copy your config/relayt.env and certs/ folder into it.
  3. Read the release notes. If the schema changed they include an SQL file to apply. The server validates the schema at startup and refuses to start if it does not match.
  4. Docker: run docker compose --env-file config/relayt.env [--profile with-db] up -d --build from the new folder. systemd: replace /opt/relayt/relayt-server.jar and run sudo systemctl restart relayt-server. Standalone: scripts/run-standalone.sh stop, then start.

Rotate secrets and certificates

  • JWT_SECRET: change the value and restart. Everyone signs in once more.
  • Server certificate: run generate-certs.sh again with the same options (it keeps the CA and the store passwords, see 5a), or rebuild keystore.p12 from your own CA, then restart the server.
  • Private CA: run generate-certs.sh --force, copy the new store passwords into config/relayt.env (see 5a), re-issue every agent certificate, then restart the server.
  • Agent certificate: run issue-client-cert.sh --force for that agent. If the SAN did not change, nothing changes in the admin console.

Reverse proxy / load balancer: use TCP (Layer 4) pass-through to port 8443. Do not terminate TLS in front of the server, or client-certificate authentication will not work.

Graceful shutdown: the server finishes in-flight requests for up to 30 seconds when stopped.


11. Troubleshooting

SymptomCause and fix
Server exits at startup with Could not resolve placeholder 'DB_URL' (or another variable name)A required variable is missing from config/relayt.env. See 9.1. With Docker, make sure the env file is named config/relayt.env.
Failed to build mutual TLS context for callback calls (or another error about the keystore or truststore file)KEYSTORE_PATH / TRUSTSTORE_PATH is missing the file: prefix, or the file is not where the path says. Use an absolute path such as file:/etc/relayt/certs/keystore.p12.
keystore password was incorrect / Keystore was tampered withKEYSTORE_PASSWORD (or TRUSTSTORE_PASSWORD) does not match the file. Check certs/store-passwords.env. If the passwords were generated before the --force re-run of generate-certs.sh, run generate-secrets.sh --apply config/relayt.env --force (without --bundled-db if the bundled database already exists), then restart the server.
Permission denied reading the keystore in Docker (Linux)Set RELAYT_UID and RELAYT_GID to your user ids (section 7).
Schema-validation: missing table [users]sql/setup.sql was not applied to this database. See section 4.
password authentication failed for userDB_USERNAME / DB_PASSWORD is wrong. With the bundled database they are fixed on the first start; to change them, remove the volume (this deletes data, see 4a).
Connection refused to the databaseWrong host or port in DB_URL; the database does not allow connections from this machine; or, in Docker, localhost was used (see the Docker note in 4b).
WeakKeyException or key byte array is 256 bitsJWT_SECRET is shorter than 32 characters. Generate a new one.
Browser says the connection is not privateThe certificate is from your private CA. Install certs/ca.crt as a trusted root, or use a certificate from a public CA.
Agent gets HTTP 401 on /sendFormThe agent's certificate was not signed by a CA in the truststore, or the SAN does not match the one registered for the service account. Compare with the output of issue-client-cert.sh.
Server cannot deliver to an agent callback (TLS or hostname error)The callback endpoint's certificate must be signed by a CA in the truststore and its SAN must match the callback host name.
Password-reset e-mail never arrivesCheck SMTP_* and MAIL_FROM. Use port 587 with STARTTLS. Look in the server log for the SMTP error.
docker compose reports required: false or an unknown fieldDocker Compose is older than 2.20. Upgrade Docker Compose.
required variable DB_USERNAME is missing a value (or DB_PASSWORD)Either the --env-file config/relayt.env option was left out of the compose command, or the value is empty or missing in that file. If both are fine, a variable with the same name is exported in your shell (for example from ~/.zshrc or ~/.bashrc). Shell variables take priority over --env-file, even when they are empty. Check with env | grep -E '^(DB_USERNAME|DB_PASSWORD|RELAYT_)' and remove them with unset DB_USERNAME DB_PASSWORD. Docker Compose only substitutes these variables (and RELAYT_UID, RELAYT_GID, RELAYT_PORT) from your shell; the server container reads everything else, such as JWT_SECRET and DB_URL, directly from config/relayt.env, so exported copies of those are ignored. To run a single command without them: env -u DB_USERNAME -u DB_PASSWORD docker compose --env-file config/relayt.env --profile with-db up -d --build.

12. Examples: langgraph-agent and google-adk-agent

The download includes two small agents in examples/. Both use Relayt Server to get a human in the loop:

  1. The agent sends an Interview Feedback Form to a user through Relayt Server.
  2. The agent pauses until that user opens the form in the Relayt client and submits it.
  3. Relayt Server delivers the submitted data to the agent's /resume callback, and the agent resumes and logs the result.

They show how an agent authenticates with a client certificate, calls /api/v1/sendForm, and serves an HTTPS callback that only Relayt Server may call (mutual TLS in both directions).

ExampleStackPortYou also need
examples/langgraph-agentPython, LangGraph, FastAPI8000Nothing else
examples/google-adk-agentJava 17, Spring Boot, Google ADK8002A Gemini API key

Each example folder holds the source code, a README.md, a Dockerfile, the compose files and the scripts, so you can read it, change it and rebuild it. You do not need Python, Java or Maven on your machine: Docker builds the agent. The agent's keystore and truststore are created in examples/certs/<example-name>/.

12.1 Before you start

  • Relayt Server is running with Docker Compose (section 3), and you have created the administrator (section 8). If the server runs directly on your machine instead, see 12.4.
  • The server certificate includes the names the examples use. The Quick Start command already creates it with --examples:
    scripts/generate-certs.sh --dns relayt.example.com --examples
    
    If you created the certificates without --examples, run.sh tells you. Run the same command again (with your own --dns/--ip options). It keeps the CA and the store passwords and only re-issues the server certificate. Then restart the server:
    docker compose --env-file config/relayt.env restart relayt-server
    
  • Docker with Compose v2, plus bash and openssl. keytool (any JDK/JRE) is optional: the script runs it in a container when it is missing.

12.2 Run an example

From the extracted relayt-server-<version>/ folder:

cd examples/langgraph-agent        # or: cd examples/google-adk-agent
./run.sh

run.sh does everything that does not need a decision from you:

  1. checks Docker, openssl and that the server certificate and Docker network are ready;
  2. creates the agent's client certificate, keystore, truststore and configuration file (<name>.env) by running generate-certs.sh;
  3. asks for the e-mail of the Relayt user who will receive the form (and, for google-adk-agent, your Gemini API key). You can also pass them: ./run.sh --email you@example.com --google-api-key KEY;
  4. builds the image and starts the container. The first build of google-adk-agent downloads the Maven dependencies and takes a few minutes;
  5. prints the values to add in the Admin UI.

It is safe to run again at any time: it keeps your certificate and values.

12.3 Register the agent in the Admin UI

This is the only manual step. Open https://localhost:8443/admin and add the three things run.sh printed at the end:

In the Admin UIValue for langgraph-agentValue for google-adk-agent
User (the person who receives the form)the e-mail you gave run.shthe e-mail you gave run.sh
Service account, SANdns:langgraph-agent,ip:127.0.0.1dns:google-adk-agent,ip:127.0.0.1
Callback URL on that service accounthttps://langgraph-agent:8000/resumehttps://google-adk-agent:8002/resume

Your browser shows a certificate warning until you install certs/ca.crt as a trusted root (section 5d).

Now run the workflow:

./run.sh trigger      # the agent sends the form; the response shows "PAUSED_FOR_REVIEW"
  1. The user you added signs in with the Relayt client, opens the Interview Feedback Form and submits it.
  2. Check that the agent resumed:
    ./run.sh logs
    
    Both langgraph-agent and google-adk-agent log the same output: the submitted form data, followed by whether the candidate was selected and their rating:
    --- Completed Interview Workflow ---
    Received /resume body: {interviewDate=2026-11-23, candidateId=QWER379, candidateName=Linus Torvalds, overallRating=4, selected=true}
    [2026-11-23 QWER379] Candidate Linus Torvalds was selected. Their overall rating was 4.
    

Other commands: ./run.sh down stops the example. ./run.sh --help lists all options.

12.4 Relayt Server running on the host

If you run the server directly on your machine (Option C, standalone jar), the agent container cannot join the server's Docker network. Add --server-on-host:

./run.sh --server-on-host

The script then reaches the server at host.docker.internal:8443 and uses docker-compose.host.yml. Register the callback URL https://127.0.0.1:8000/resume (8002 for google-adk-agent) instead of the container name, as run.sh prints. The server certificate must have been created with --examples (it then includes host.docker.internal).

12.5 Troubleshooting the examples

SymptomCause and fix
run.sh says the certificate does not include relayt-serverThe server certificate was created without --examples. Run scripts/generate-certs.sh --examples again (plus your --dns/--ip options) and restart the server, as described in 12.1. No --force is needed.
run.sh says the Docker network relayt_default does not existThe server is not running with Docker Compose. Start it (section 7), or use --server-on-host.
/start fails with HTTP 401The service account SAN in the Admin UI does not match the one run.sh printed.
/start says the user or callback URL was not foundThe e-mail is not a user in the Admin UI, or the service account has no callback URL.
The form is submitted but the agent never resumesThe callback URL in the Admin UI is not the one run.sh printed.
google-adk-agent: /start fails with an API key errorGOOGLE_API_KEY is empty or invalid. Run ./run.sh --google-api-key KEY.

Each example's README.md has more detail: every setting in its .env file, and how to run the steps by hand.