Build and run
Create a production binary, apply migrations, and start the result locally or on a server.
A Ridu build produces one executable in dist/. The executable contains the Go server, API,
workers, generated schema, migration-history fingerprint, and compiled admin.
Build your app
From the project root, run:
ridu buildFor a project named my-app, the last line is:
Built dist/my-appNew projects already contain an initial migration. If an older project has no files in
migrations/, create its first artifact and try the build again:
ridu migrate create --name initial
ridu buildReview and commit the new *.ridu.json file. Future schema changes need a new migration before
ridu build will accept them.
Before a release, run the broader checks and replay the migration history:
ridu check
ridu migrate verify
ridu buildSQLite verification uses a temporary database and needs no path. PostgreSQL and MongoDB
verification need DATABASE_URL because they create an isolated shadow schema or database.
Apply migrations and start
The binary checks that the target database has the exact migration history used during the build. Apply pending migrations before starting it.
Choose the target database below. SQLite needs an absolute path so the migration command and server open the same file. PostgreSQL needs its production connection URL.
export RIDU_SQLITE_PATH="$PWD/.ridu/production.sqlite"
ridu migrate plan
ridu migrate up
ridu migrate status
./dist/my-appexport DATABASE_URL='postgres://user:password@host/database?sslmode=verify-full'
ridu migrate plan
ridu migrate up
ridu migrate status
./dist/my-appThe generated start package script runs the same binary, so bun run start, npm run start,
pnpm run start, or yarn start is convenient when testing on the build machine. A production
image only needs dist/my-app, trusted certificates, and its environment variables.
The server listens on :8080 by default. Set RIDU_ADDRESS when you control the full address, or
set PORT when a hosting platform assigns the port:
RIDU_ADDRESS=':3000' ./dist/my-appChoose another output path
Use --output when a deployment expects a particular filename:
ridu build --output ./dist/server
./dist/serverThe output path may be relative to the project or absolute. Ridu writes a temporary executable and only replaces the destination after the complete build succeeds.
Fix a failed first build
migration artifact history is empty: runridu migrate create --name initial, review the generated file, then build again.ridu migrate plan needs a SQLite database: setRIDU_SQLITE_PATHto an absolute path or pass--database-path <path>.- Startup reports pending or mismatched migrations: run
ridu migrate status, restore the committed artifacts if they changed, then runridu migrate up. - A binary made with
go buildrefuses to start: useridu build; it embeds the migration fingerprint and admin assets. - The host cannot connect to the server: set
PORTorRIDU_ADDRESS, and configure its health check to use/readyz.
Continue with the Railway guide for a concrete hosted deployment, or the production overview for security, health checks, backups, and rollout rules.