
Deploy Kortix | (Just Updated) Open-Source AI Agent Platform (Suna), Admin Login Ready, Sign-up Closed
Kortix (Suna) self-hosted AI agent platform, API and web UI
Just deployed
Just deployed
Just deployed
Just deployed
/var/lib/postgresql/data
Just deployed
Just deployed
Just deployed
/var/lib/storage
Just deployed
Deploy and Host Kortix on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the admin password, the JWT secret, the database password and the encryption seed are generated, the admin account exists before the site is reachable, and public sign-up is closed. Kortix (formerly Suna) is an open-source platform for running AI agents, with a web UI, an API, per-user accounts and a Supabase-compatible auth and storage layer, a self-hosted alternative to hosted agent platforms.
About Hosting Kortix
This template runs eight services, the same eight containers as upstream's self-host stack, each from a thin wrapper image over the pinned upstream image (Kortix 0.16.4): frontend, the web UI, public on port 8080 with a healthcheck at /api/health; api, the Kortix API, public on port 8080 with a healthcheck at /v1/health; kong, the Supabase-compatible gateway (/auth/v1, /rest/v1, /storage/v1), public on port 8080 with a healthcheck at /healthz; db, Supabase Postgres with a volume at /var/lib/postgresql/data; auth, GoTrue; rest, PostgREST; storage, Supabase Storage with a volume at /var/lib/storage; and gateway, the private LLM gateway.
What the wrapper fixes. Upstream's self-host stack is a compose file with eight containers and a one-time bootstrap script. The wrapper applies what Railway needs: private hosts under *.railway.internal, public services on the injected PORT, secrets from template variables so they survive redeploys, one admin login created at boot from ADMIN_EMAIL and ADMIN_PASSWORD, and sign-up closed at two layers (the auth server refuses every new user and the app runs in closed sign-up mode), so a stranger who finds the URL cannot register. Redeploys keep the admin, the accounts and the database.
Using it. Open the frontend domain and sign in with ADMIN_EMAIL and ADMIN_PASSWORD from the api service. An agent uses the API: log in against the kong domain to get a bearer token, then call the api domain with Authorization: Bearer ACCESS_TOKEN. The template sets no model-provider key and no managed git provider: add your own model keys in Kortix, and note that creating a workspace through the API answers 503 Managed git provider "github" is not configured until one is configured.
License. Kortix is under the Elastic License 2.0: use it yourself, but do not offer it to third parties as a hosted or managed service, and do not circumvent its license-key functionality.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of theapiservice); the auth gateway ishttps://RAILWAY_SERVICE_KONG_URLand the web UI ishttps://RAILWAY_SERVICE_FRONTEND_URL - Private URL:
http://api.railway.internal:8080 - Credentials: the variables
ADMIN_EMAILandADMIN_PASSWORDon theapiservice (plain text), andJWT_SECRETon thekongservice andapiservice (the signing secret of the auth gateway's anon key) - Auth: sign in with
POST https://RAILWAY_SERVICE_KONG_URL/auth/v1/token?grant_type=password(headerapikey: ANON_KEY, JSON bodyemailandpassword), then sendAuthorization: Bearer ACCESS_TOKENto the API; writes answer 401 without it - Health:
GET /v1/healthon the api domain returns 200 without credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, RAILWAY_SERVICE_KONG_URL, ADMIN_EMAIL, ADMIN_PASSWORD, JWT_SECRET (variables of the api service); also curl, openssl.
R="https://$RAILWAY_PUBLIC_DOMAIN"; K="https://$RAILWAY_SERVICE_KONG_URL"; H="content-type: application/json"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/v1/health")" = 200 ]; do n=$((n+1)); [ "$n" -le 120 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/v1/health"
# the anon key of the auth gateway is a fixed JWT payload signed with JWT_SECRET
b64() { openssl base64 -A | tr '+/' '-_' | tr -d '='; }
HP="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNjQxMDI0MDAwLCJleHAiOjIxMTQzODA4MDB9"
ANON="$HP.$(printf %s "$HP" | openssl dgst -sha256 -hmac "$JWT_SECRET" -binary | b64)"
# sign-up is closed: a stranger who posts to the sign-up endpoint is refused
curl -s -o /dev/null -w "public signup: %{http_code}\n" -H "apikey: $ANON" -H "$H" -d '{"email":"stranger@example.com","password":"Not-the-real-one-1"}' "$K/auth/v1/signup"
# the generated password is the admin account: log in, the answer carries a bearer token
TOKEN=$(curl -s -H "apikey: $ANON" -H "$H" -d "{\"email\":\"$ADMIN_EMAIL\",\"password\":\"$ADMIN_PASSWORD\"}" "$K/auth/v1/token?grant_type=password" | sed -n 's/.*"access_token":"\([^"]*\)".*/\1/p')
if [ -n "$TOKEN" ]; then echo "login: ok"; else echo "login: failed"; fi
BODY="{\"name\":\"Agent $$\"}"
# write-auth: POST /v1/accounts needs the bearer token; without it, or with a wrong one, the answer is 401
curl -s -o /dev/null -w "read with key: %{http_code}\n" -H "Authorization: Bearer $TOKEN" "$R/v1/accounts"
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "$H" -H "Authorization: Bearer $TOKEN" -d "$BODY" "$R/v1/accounts"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$H" -d "$BODY" "$R/v1/accounts"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "$H" -H "Authorization: Bearer not-a-real-token" -d "$BODY" "$R/v1/accounts"
Expected output against a fresh deploy:
health: 200
public signup: 403
login: ok
read with key: 200
write with key: 201
write without key: 401
write wrong key: 401
The refusals are the contract: a request without a token is refused (write without key: 401), a stranger cannot register (public signup: 403) and a wrong token is refused (write wrong key: 401).
Why Deploy Kortix on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Kortix on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
- Agent-ready - no deployer fields, a contract block, and one script that proves the API is healthy, strangers cannot register, the generated password is the admin and the API refuses writes without a token.
- Admin included - the admin account has a generated password before the site is reachable, so nobody can claim your instance by registering first.
- Eight services wired for you - database, auth, REST, storage, gateway, API and web UI reference each other, no manual URLs.
- Data survives redeploys - the database and the storage service each have a volume, and the generated secrets stay the same.
- Pinned - Kortix and the Supabase components are pinned by tag and digest, and the wrapper images by tag and digest.
Common Use Cases
- Self-hosted AI agent platform - run agents for yourself or your team on infrastructure you control.
- Agent backend for an application - call the Kortix API with a bearer token from your own code.
- Private alternative to hosted agent products - keep prompts, accounts and files in your own database.
- Agent-managed workspace - give an AI agent the admin login to create accounts and manage the instance through the API.
Dependencies for Kortix Hosting
- Eight services (frontend, api, kong, db, auth, rest, storage, gateway), two of them with a volume, created by the template.
Deployment Dependencies
Template Content

