Blockscout
SupportWebsiteGithubDiscord
  • Blockscout Open-Source Explorer
  • 💡About BlockScout
    • Features
      • Ethereum Bytecode Database Microservice
      • Blockscout Redesign
    • Chains Using Blockscout
    • Partners & Integrations
      • RaaS Providers
      • Vera: Verifier Alliance
        • Adding your chain to the Vera database
        • Programmatic verification via the API
    • News & Media
      • Newsletter & Blog
    • Funding
      • L2 Funding Proposal
        • Aux Funding Images
    • Roadmap
  • 🙎Using Blockscout
    • Getting Started
      • Glossary of Terms
      • Main Menu
      • Blocks
      • Transaction Types
      • Beacon Chain Withdrawal Views
    • My Account
      • Watch list
      • Private tags
      • Public tags
      • API keys
      • Custom ABI
      • Verified addresses
        • Copy and Sign Message
      • For developers
    • Dappscout Apps Marketplace
      • DApp Integration
    • Swapscout
      • Earn Merits when using Swapscout
    • Revokescout
    • Autoscout Explorer Launchpad
    • CSV Exports
    • Token Support
      • ERC-1155 Support
    • Merits
      • Streak rewards
      • Activity Pass
      • Leaderboard
      • Badges
      • FAQs
  • 👩‍💻Developer Support
    • For Web3 Developers
    • Link to Blockscout
    • Blockscout APIs
      • Requests & Limits
      • REST API Endpoints
        • Stats API
        • Interpreter API
      • JSON RPC & ETH Compatible RPC Endpoints
        • Account
        • Block
        • Contract
        • Logs
        • Stats
        • Token
        • Transaction
        • ETH RPC API
      • GraphQL in Blockscout
    • Smart Contract Verification
      • Blockscout UI
      • Blockscout smart-contract verification API
      • Hardhat Verification Plugin
        • Sourcify Plugin for Hardhat
      • Foundry Verification
      • Sourcify Verification
      • OpenZeppelin Contract Verification
      • Automate verifications with Catapulta
      • Verification via thirdweb
      • Interacting with Smart Contracts
    • Integrate Merits
    • Chainscout chains list
  • 🏃‍♂️Setup and Run Blockscout
    • General Overview
      • Separate Indexer, Web App, and API
      • Umbrella Project Organization
      • Indexer Architecture Overview
      • ShareLock
      • EVM Version Information
    • Requirements
      • General Backend Requirements / Blockscout Backend Prerequisites
      • Backend/Frontend Compatibility Matrix
      • Hardware & Hosting Requirements
      • Database Storage Requirements
      • Client Setting Requirements
      • Node Tracing / JSON RPC Requirements
      • L2 -> L1 JSON-RPC Method Requests
    • ☑️ENV Variables
      • Backend ENVs: Common
      • Backend ENVs: Chain-Specific
      • Backend ENVs: Integrations
      • Frontend ENVs: Common
        • ENVs
        • Deprecated ENVs
      • Deprecated Backend ENVs
        • Previous ENV Variable Home Page
    • Deployment
      • ⭐Manual Deployment Guide
        • Ubuntu Setup
        • MacOS setup
      • ⭐Docker-compose Deployment
      • ⭐Kubernetes Deployment
      • Rollup Deployment
      • 🌟Cosmos-based chains
      • 🍀Upgrade Guide (v7.0 & v8.0)
      • Frontend Migration
        • All-In-One Container
        • Separate Frontend
        • Customized Backend
        • Proxy Setup
        • FAQs
      • Manual Deployment (backend + old UI)
        • Manual cleaning an instance from the previous deployment
      • Terraform Deployment
      • Ansible Deployment (AWS Cloud)
        • Overview
        • Prerequisites
        • AWS Permissions & Settings
          • Creating a Secret Key Pair
          • Login with AWS CLI
          • Creating an AWS certificate for SSL
          • Manually Cleaning Terraform Related Instances
        • Variables
        • Deploying the Blockscout Infrastructure
        • Deploying Blockscout
        • Destroying Provisioned Infrastructure
        • Common Additional Tasks
        • Common Errors and Questions
        • AWS Marketplace (deprecated)
          • Overview
          • CloudFormation Template
          • Prerequisites & Install Parameters
          • Install from AWS Marketplace
          • AWS EC2 archive node setup with OpenEthereum (formerly Parity)
          • Updating & Redeploying in AWS
          • Customizing CSS
    • Microservices
      • Blockscout ENS (BENS) Name Service Integration
      • Smart Contract Verification
    • Configuration Options
      • Automating Restarts
      • Branding Configs
      • Circle CI Updates
      • Charts and Stats
      • CSS Configuration & Presets
      • Exchange Rates
      • Front-end Config Files
      • haproxy Settings for Blockscout.com
      • Internationalization
      • Logger Configs
      • Memory Usage
      • Metrics
      • My Account Settings
      • Sorting and Pagination
      • Tracing
      • Reown Project ID for contract Read/Write
    • Indexing
      • How do I fix indexer timeouts?
      • How do I update memory consumption to fix indexer memory errors?
    • Testing
    • DB schema
  • FAQs
    • User FAQs
    • Developer FAQs
  • 🧩Resources
    • EaaS: Hosting with Blockscout
    • Contributing to Blockscout
    • Bug Bounty Program
    • Media kit
    • Release Notes
      • v5.3.0: 10/23/23
      • v5.2.0: 6/20/23
      • v5.1.0: 2/13/23
      • v5.0.0: 1/11/23
    • Discord Channel
    • Discussion
    • GitHub Repo
Powered by GitBook
LogoLogo

Privacy and Terms

  • Privacy Notice
  • Terms and Conditions

Copyright © Blockscout Limited 2023-2024

On this page
  • Prepare Environment
  • Deployment Steps

Was this helpful?

Export as PDF
  1. Setup and Run Blockscout
  2. Deployment

Manual Deployment (backend + old UI)

General deployment instructions for a hardware or cloud services environment

Last updated 2 months ago

Was this helpful?

This method uses the deprecated UI and is not recommended. Please use the to deploy a new version of Blockscout.

Prepare Environment

Check your environment is prepared with and .

BlockScout requires a full archive node in order to import every state change for every address on the target network. For client specific settings related to a node running Erigon/Geth/Nethermind, please see .

For testing purposes, instead of an archive node, a test Ethereum client can be used. For instance,

Deployment Steps

1) git clone https://github.com/blockscout/blockscout

2) cd blockscout

3) Provide DB URL: export DATABASE_URL=postgresql://user:password@localhost:5432/blockscout

  • Linux: Update the database username and password configuration

  • Mac: Use logged-in user name and empty password

  • Optional: Change credentials in apps/explorer/config/test.exs for test env

Example usage: Changing the default Postgres port from localhost:5432 if is installed.

4) Install Mix dependencies and compile them mix do deps.get, local.rebar --force, deps.compile

5) Generate a new secret_key_base for the DB by setting a corresponding ENV var: export SECRET_KEY_BASE=VTIB3uHDNbvrY0+60ZWgUoUBKDn9ppLR8MI4CpRz4/qLyEFs54ktJfaNT6Z221No

In order to generate a new secret_key_base run mix phx.gen.secret

6) If you have deployed previously, remove static assets from the previous build mix phx.digest.clean.

CLI Example:

export ETHEREUM_JSONRPC_VARIANT=nethermind
export ETHEREUM_JSONRPC_HTTP_URL=http://localhost:8545
export DATABASE_URL=postgresql://...
export COIN=DAI
export MIX_ENV=prod
export ... 

It is important to set the variable MIX_ENV=prod during deployment. The current default is MIX_ENV=dev which is a slower and less secure setting.

  1. Using docker:

    • docker run -p 8050:8050 ghcr.io/blockscout/smart-contract-verifier:latest

    • cargo install --locked --git https://github.com/blockscout/blockscout-rs smart-contract-verifier-server

    • Then run the binary as smart-contract-verifier-server

  2. Set ENV variables in CLI to enable the rust microservice for Blockscout (these can also be set at runtime).

export MICROSERVICE_SC_VERIFIER_ENABLED=true
export MICROSERVICE_SC_VERIFIER_URL=http://0.0.0.0:8050/

9) Compile the application:mix compile

10) If not already running, start Postgres: pg_ctl -D /usr/local/var/postgres start

11) Create and migrate database mix do ecto.create, ecto.migrate

If you are in dev environment and have run the application previously with a different blockchain, drop the previous database mix do ecto.drop, ecto.create, ecto.migrate Be careful since it will delete all data from the DB. Don't execute it on production if you don't want to lose all the data!

12) Install Node.js dependencies

Optional: If preferred, use npm ci rather than npm install to strictly follow all package versions in package-lock.json.

  • cd apps/block_scout_web/assets; npm install && node_modules/webpack/bin/webpack.js --mode production; cd -

  • cd apps/explorer && npm install; cd -

13) Build static assets for deployment mix phx.digest

14) Enable HTTPS in development. The Phoenix server only runs with HTTPS.

  • cd apps/block_scout_web; mix phx.gen.cert blockscout blockscout.local; cd -

  • Add blockscout and blockscout.local to your /etc/hosts

   127.0.0.1       localhost blockscout blockscout.local

   255.255.255.255 broadcasthost

   ::1             localhost blockscout blockscout.local

If using Chrome, Enable chrome://flags/#allow-insecure-localhost

15) Return to the root directory and start the Phoenix Server. mix phx.server

7) Set as needed.

The ETHEREUM_JSONRPC_VARIANT will vary depending on your client (nethermind, geth etc). .

8) Install and start the. You can , , or use cargo directly (example below). If you experience issues, see the extensive .

Or install and build from sources:

To check : pg_isready

16) Check the if you would like to connect the enhanced frontend UI to the manually installed backend.

🏃‍♂️
Manual Deployment Guide
General Requirements
Database Storage Requirements
Client Settings
Anvil
Boxen
environment variables
More information on client settings
smart contract verification microservice
use docker
build from source
smart contract verifier readme
rust
postgres status
Frontend Migration section