This reference covers the commands used to operate a self-hosted instance day to day.
All Compose commands assume you’re in the docker-compose directory of the backend repository.
Service lifecycle
# Start the stack in the backgrounddocker compose up -d
# Stop the stack (data persists)docker compose down
# Stop and DELETE all indexed datadocker compose down -v
# Restart one servicedocker compose restart backend
# Recreate a service after config changesdocker compose up -d --force-recreate backend
# Update to the latest imagesdocker compose pull && docker compose up -dLogs
# Follow backend (indexer + API) logsdocker compose logs -f backend
# Last hour of frontend logsdocker compose logs --since 1h frontend
# Filter a specific fetcher moduledocker compose logs backend | grep "Indexer.Fetcher.Block"
# Export a day of logs for analysisdocker compose logs --since 24h backend > backend.logHealth and status
# Container status and resource usagedocker compose psdocker stats
# Indexing statuscurl -s http://localhost:4000/api/v2/main-page/indexing-status
# API livenesscurl -fsS http://localhost:4000/api/v2/stats > /dev/null && echo OK
# RPC endpoint reachability (from the host)curl -X POST $ETHEREUM_JSONRPC_HTTP_URL \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'Database
# Open a psql shelldocker compose exec db psql -U postgres blockscout
# Logical backupdocker compose exec db pg_dump -U postgres blockscout | gzip > backup.sql.gz
# Restoregunzip -c backup.sql.gz | docker compose exec -T db psql -U postgres blockscout
# Database sizedocker compose exec db psql -U postgres -c \ "SELECT pg_size_pretty(pg_database_size('blockscout'));"Source-install operations
# Run migrations manuallymix ecto.migrate
# Reset the local database (dev only)mix ecto.drop && mix ecto.create && mix ecto.migrate
# Test suitemix test
# Format and lintmix format --check-formattedmix credo --strictTroubleshooting quick reference
| Task | Command |
|---|---|
| Is the indexer caught up? | curl localhost:4000/api/v2/main-page/indexing-status |
| Is the RPC endpoint alive? | eth_blockNumber call above |
| Which service is crash-looping? | docker compose ps (look at STATUS) |
| Why did the backend restart? | docker compose logs --tail 200 backend |
| How full is the disk? | df -h |
See Maintenance & Operations for the runbooks behind these commands, and Monitoring for alerting thresholds.