The fastest way to run Ocrch is with the pre-built Docker image published to the GitHub Container Registry (GHCR). A PostgreSQL database is the only external dependency.
Prerequisites
Section titled “Prerequisites”- Docker and Docker Compose installed
- A PostgreSQL 14+ database (or use the compose file below)
- Etherscan API key (for EVM chains) — free tier is sufficient
- Tronscan API key (for Tron) — free tier is sufficient
- Dedicated wallet addresses for each chain you want to accept
Pull the Image
Section titled “Pull the Image”docker pull ghcr.io/haruki-nikaidou/ocrch-server:latestTagged releases are also available using the short commit SHA:
docker pull ghcr.io/haruki-nikaidou/ocrch-server:<SHA>Quick Start with Docker Compose
Section titled “Quick Start with Docker Compose”Create a config file
Copy the example configuration and fill in your values:
Terminal window curl -o ocrch-config.toml \https://raw.githubusercontent.com/haruki-nikaidou/open-crypto-checkout/main/ocrch-config.example.tomlEdit
ocrch-config.toml— at minimum you must set:admin.secret— a strong password (the server will Argon2-hash it on first boot)merchant.secret— your HMAC signing key shared with your application backendmerchant.allowed_origins— the origin(s) of your checkout frontend[[wallets]]— at least one wallet entry[api_keys]— your Etherscan and/or Tronscan API keys (see Configuration)
Create a
docker-compose.ymlservices:db:image: postgres:16-alpineenvironment:POSTGRES_DB: ocrchPOSTGRES_USER: ocrchPOSTGRES_PASSWORD: changemevolumes:- pgdata:/var/lib/postgresql/datahealthcheck:test: ["CMD-SHELL", "pg_isready -U ocrch"]interval: 5sretries: 10ocrch:image: ghcr.io/haruki-nikaidou/ocrch-server:latestdepends_on:db:condition: service_healthyenvironment:DATABASE_URL: postgres://ocrch:changeme@db:5432/ocrchRUST_LOG: info,sqlx=warnvolumes:- ./ocrch-config.toml:/app/ocrch-config.toml:roports:- "8080:8080"command: ["--migrate"]volumes:pgdata:Start the services
Terminal window docker compose up -dOn first boot the server will:
- Run database migrations automatically (because of the
--migrateflag). - Detect that
admin.secretis plaintext, hash it with Argon2, and rewrite the config file.
- Run database migrations automatically (because of the
Verify the server is healthy
Terminal window curl http://localhost:8080/healthExpected response:
{"status":"ok","version":"0.1.0"}
Configuration File Location
Section titled “Configuration File Location”By default the server reads ./ocrch-config.toml (relative to its working directory, which is /app inside the container). You can override this with the -c flag:
command: ["-c", "/etc/ocrch/config.toml", "--migrate"]CLI Reference
Section titled “CLI Reference”| Flag | Default | Description |
|---|---|---|
-c, --config <PATH> | ./ocrch-config.toml | Path to the TOML config file |
--listen <ADDR> | value from config | Override the listen address (e.g. 0.0.0.0:8080) |
--migrate | — | Run database migrations on startup |
Environment Variables
Section titled “Environment Variables”| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection URL |
RUST_LOG | No | Log filter (default: info,sqlx=warn,tower_http=debug) |
Signals
Section titled “Signals”| Signal | Behavior |
|---|---|
SIGTERM / SIGINT | Graceful shutdown — stops accepting new requests, finishes in-flight work |
SIGHUP | Hot-reload the config file without restarting |
Reverse Proxy
Section titled “Reverse Proxy”Ocrch listens on 0.0.0.0:8080 by default. In production, place it behind a reverse proxy such as Nginx or Caddy that handles TLS termination.
Caddy example:
checkout-api.example.com { reverse_proxy ocrch:8080}Nginx example:
server { listen 443 ssl; server_name checkout-api.example.com;
location / { proxy_pass http://ocrch:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; }}The Upgrade and Connection headers are required for WebSocket support on the /api/v1/user/orders/{id}/ws endpoint.
Next Steps
Section titled “Next Steps”- Configuration reference — detailed documentation for every config option.
- Frontend Development — build your checkout page.
- Service API — create orders from your application backend.