How to Self-Host a Block Explorer with Docker
Ethernal is MIT licensed and runs on your own server with Docker Compose. Clone the repository, run make start, then open the setup page to create an admin user and your first explorer. Everything, including the database, runs in containers.
What you need
- Docker and Docker Compose.
- OpenSSL, which the setup script uses to generate secrets.
- make, because the commands in the README use the Makefile.
- A domain name or the IP address of your server.
- The RPC URL of the EVM chain you want to explore.
Steps
- 1
Clone the repository
Clone Ethernal and check out the latest tagged release, which is the latest stable version.
git clone https://github.com/tryethernal/ethernal.git cd ethernal git checkout $(git describe --tags --abbrev=0) - 2
Run make start
On the first run, the script asks for your domain name (apex, without www) or server IP, the port to serve the app on (80 by default), and, if you entered a domain, whether to enable SSL (yes by default). It then generates the secrets and config files, pulls the images, starts the containers, creates the database and runs the migrations. Generated secrets and config files are added to .gitignore.
make start - 3
Point your domain at the server
If you used a domain instead of an IP address, add two A records at your DNS provider that point to the public IP address of your server: one for your domain (your-domain.com) and one wildcard record (*.your-domain.com). Each explorer is served on its own subdomain of your domain, so the wildcard record is needed for explorers to be reachable.
- 4
Open the setup page
When make start finishes it prints a summary, including a setup link that looks like http://your-domain-or-ip/setup, plus the Bull dashboard address and credentials for background jobs. Run make info to print it again. Open the setup link in your browser.
- 5
Create the admin user
The first screen of the setup creates your admin user. Enter an email and a password, then click Create User.
- 6
Create your first explorer
Enter an Explorer Name and the RPC URL of your chain (it has to start with http:// or https://), then click Create Explorer.
- 7
Open your explorer
The last screen shows the address of your new explorer and links to its settings, the Ethernal dashboard and your list of explorers.
- 8
Update, stop or reset the instance
These are separate commands, not a sequence. To update, run make update, which pulls the latest images and applies migrations and seeds. To stop, run make stop, which stops and cleans up the containers and networks. To reset, run make nuke only if you want to start over: it is destructive and removes containers, volumes and generated config files, which deletes all your data.
Updatemake updateStopmake stopReset (deletes all data)make nuke
Troubleshooting and FAQ
Is the self-hosted version ready for production?
Yes. It runs the same code as hosted Ethernal. You operate the servers, updates and backups yourself, so hosted Ethernal is the better fit if you want a managed service. If you hit a problem, open an issue on GitHub.
Do I need to install a database?
No. The Docker Compose file starts PostgreSQL with TimescaleDB, Redis, the background workers, the backend, the frontend and a web server together, so there is nothing to install besides Docker.
Does the self-hosted version show ads?
Yes, by default. The README notes that the ads help support the development of Ethernal, and asks you to keep them enabled if you can.
How do I regenerate the configuration?
Run bash ./generate-env-files.sh. make start only generates the config files when they are missing, so it will not overwrite them on later runs.
Where can I find the full documentation and the API reference?
The documentation is at doc.tryethernal.com. For the API, use the Ethernal API reference and replace api.tryethernal.com with your own server domain or IP.
Related
Ready to try it?
Sign-up is free, and the Starter plan needs no credit card.
Prefer hosted? Create a free explorer