scripts/dev-realtime.sh starts and supervises:
Logs from every service share one terminal, prefixed with the service name.
Ctrl+C stops everything, and if any service exits, the rest stop too.
Prerequisites
- Node.js 20 or later
- Go 1.25 or later
- Docker with Docker Compose v2.24 or later, for ClickHouse and NATS
curl,openssl, andlsof(preinstalled on macOS and most Linux distributions; on Windows, use WSL)- Python 3, only to send sample spans
Start OpenLIT
1
Clone the repository and install the UI dependencies
2
Create src/client/.env
file:./data.db is relative to src/client/prisma, and .db files are ignored by git. The script reads the UI port from NEXTAUTH_URL.3
Run the script from the repository root
The first time, add After that, start it without The script applies Prisma migrations, starts ClickHouse if needed, then starts NATS, the UI, the receiver, and the engine. It prints the address of each service when they are up.
SEED=1 to create the default user, organisation, project, and database configuration:SEED:4
Sign in
Open
http://localhost:3000 and sign in with user@openlit.io and openlituser.Send sample spans
Threshold alerts only see spans sent with an API key.- In OpenLIT, open Settings → API Keys and create a key.
-
Send spans to the local receiver:
Useful flags include
--service,--model,--latency-ms,--cost, and--http-status. Run the script with--helpfor the full list. If the dev script reported that port 4318 was busy and used 14318, pass--endpoint http://127.0.0.1:14318. - Open Alerts, create an alert from the Error rate spike template, and send the spans again. The alert fires within a few seconds.
openlit.init(otlp_endpoint="http://127.0.0.1:4318", otlp_headers={"Authorization": "Bearer <your key>"}).
Options
Set any of these before the script, for exampleUI_PORT=3001 scripts/dev-realtime.sh.
NATS uses
assets/nats.conf, so local development has the same permissions as production. Its passwords, the engine secret, and the cron secret are random for each run. To skip Docker for NATS, install the server once:
Work on the UI only
If you are not working on alerts or the realtime pipeline, you can run the UI on its own against ClickHouse:Run the checks
Before you open a pull request, run the checks for what you changed:Troubleshooting
UI port 3000 is already in use: stop the other process or setUI_PORT, and updateNEXTAUTH_URLto match.prisma migrate deploy failed: the SQLite file was created by a different branch. PointSQLITE_DATABASE_URLat a new file, or rerun withSKIP_MIGRATE=1.- Alerts never fire: spans must be sent with an API key from the same project, and the alert must be in the environment you send to (default
production). Docker Compose ... is too old:src/dev-docker-compose.ymlneeds Compose v2.24 or later. Upgrade Docker, or run your own ClickHouse and setINIT_DB_HOSTandINIT_DB_PORT.timed out waiting for NATS JetStream: the script prints the NATS container logs above this message. Rerun it, or installnats-serverlocally (see Options) so NATS runs without Docker.

