Explorer installation (install)

Part 2 — run this after completing Explorer Installation (Preparation): configuration, secrets, DNS, and storage.


1. Create the Compose File

In /data/openscan/docker-compose.yml:

services:
postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: explorer
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: explorer_db
volumes:
- pgdata:/var/lib/postgresql/data
indexer:
image: ghcr.io/openscanai/indexer:latest
restart: unless-stopped
depends_on: [postgres]
env_file: .env
api:
image: ghcr.io/openscanai/api:latest
restart: unless-stopped
depends_on: [postgres]
ports:
- "127.0.0.1:4000:4000"
env_file: .env
frontend:
image: ghcr.io/openscanai/frontend:latest
restart: unless-stopped
depends_on: [api]
ports:
- "127.0.0.1:3000:3000"
env_file: .env
volumes:
pgdata:

Ports are bound to localhost — the reverse proxy (step 5) exposes them publicly.

2. Pull Images and Start the Database

Terminal window
cd /data/openscan
docker compose pull
docker compose up -d postgres

3. Initialize the Database

Terminal window
docker compose run --rm indexer ./bin/migrate

4. Start the Full Stack

Terminal window
docker compose up -d
docker compose logs -f indexer

The indexer begins backfilling immediately. On an established chain this runs for hours to days — the API and UI come up right away and fill in as history lands.

5. Put TLS in Front

Follow TLS / HTTPS Setup to serve the explorer on your domain with automatic certificates.

6. Verify

Run the full Explorer Verification checklist:

Terminal window
curl "http://127.0.0.1:4000/api/v2/blocks"

Then check the UI at http://127.0.0.1:3000 (or via SSH tunnel) before and after TLS is live.

7. Finish the Setup