Skip to main content

Prerequisites

Shared server baseline

Option A: Bun + systemd + Nginx

1

Install runtime packages

Install Bun for the account that will run the application, using the version in package.json under engines.bun (currently 1.4.4). Make its bun executable available in that account’s PATH.
2

Clone the repository and create .env

Edit .env with vim .env and fill the required values before continuing. Set CHAIN_ID explicitly for the intended network.
3

Build and migrate

4

Create the systemd service and Nginx site

Create /etc/systemd/system/kuest.service with sudo vim. Replace deploy and the Bun path with the account and executable you configured:
The service account needs read access to the checkout and .env, and write access to .next for the standalone startup script. Then enable the service:
Create /etc/nginx/sites-available/kuest with the following site, replacing the example domain:
Enable the site, check the configuration, and issue the TLS certificate:
Confirm SITE_URL matches the final HTTPS origin. Restart the service after environment changes, and rerun bun run db:push when the domain or cron secret changes to update database callbacks.

Option B: Docker Compose + Caddy

1

Install Docker Engine and Compose

Install Docker Engine, Compose plugin, and Git on the server.
2

Clone the repository and create .env

Use the same /opt/kuest/prediction-market layout as the Bun path, and fill .env before starting the containers.
3

Set domain variables

Add:
4

Start production compose

5

Run database migrations

See Docker Compose for the local PostgreSQL profile and startup health checks.

Scheduler on VPS

If the supplied pg_cron jobs are not active in your database, create Linux cron jobs that follow Scheduled Jobs. Keep that page as the single source of truth for the exact cron expressions.
Keep only one scheduler backend active for /api/sync/*.