Build the OpenScan.AI explorer stack from source on a Linux server. This guide provides full control over versions and configuration and is ideal for production deployments and contributors.
Prerequisites
- Ubuntu 22.04 LTS (or similar), 8+ GB RAM, SSD storage
- Docker and Docker Compose plugin
- Git
- A synced EVM node with JSON-RPC and tracing enabled (see Chain Node Layer)
Install Docker if needed:
curl -fsSL https://get.docker.com | shsudo usermod -aG docker $USERStep 1 — Clone the Repository
git clone https://github.com/OpenScanAI/openscan.gitcd openscanStep 2 — Configure the Environment
Copy the example environment file and edit it:
cp .env.example .envKey settings:
# Chain connectionETHEREUM_JSONRPC_HTTP_URL=http://your-chain-node:8545ETHEREUM_JSONRPC_TRACE_URL=http://your-chain-node:8545CHAIN_ID=50 # e.g. 50 for XDC Network
# DatabaseDATABASE_URL=postgresql://explorer:CHANGE_ME@postgres:5432/explorer_db
# Public URLsNEXT_PUBLIC_API_HOST=explorer.yourchain.exampleNEXT_PUBLIC_NETWORK_NAME="Your Chain"Step 3 — Build the Images
docker compose buildThis compiles the indexer, API, and frontend from source. Expect the first build to take 15–30 minutes.
Step 4 — Initialize the Database
docker compose up -d postgresdocker compose run --rm indexer ./bin/migrateStep 5 — Start the Stack
docker compose up -dThe indexer begins backfilling history immediately. Follow progress:
docker compose logs -f indexerStep 6 — Verify
curl "http://localhost:4000/api/v2/blocks"Once curl returns recent blocks and the UI at http://localhost:3000 renders, the build is complete. Run through the full verification checklist before exposing the explorer publicly.
Updating
git pulldocker compose builddocker compose up -dSee Network Upgrades for safe upgrade procedure.