Docker

How to run a Erigon node with Docker

Using Docker allows starting Erigon packaged as a Docker image without installing the program directly on your system.

Download and start Erigon in Docker

Here are the steps to download and start Erigon in Docker:

  1. Verify that you have the latest Docker Engine installed, see https://docs.docker.com/engine/release-notesarrow-up-right.

  2. Check the Erigon Docker Hubarrow-up-right page to see the available releases.

  3. Download the latest version:

docker pull erigontech/erigon:latest
  1. List the downloaded images to get the IMAGE ID:

docker images
  1. To check which Erigon version has been downloaded:

docker run -it <image_id> --v
  1. If you want to start Erigon add the options according to the usage page or the advanced customization page. For example:

docker run -it <image_id> --internalcl --chain=holesky --prune=hrtc
  1. When done, exit the container or press Ctrl+C. The container will stop.

Optional: Setup dedicated user

User UID/GID need to be synchronized between the host OS and container so files are written with correct permission.

You may wish to setup a dedicated user/group on the host OS, in which case the following make targets are available.

Environment Variables

There is a .env.example file in the root of the repo.

  • DOCKER_UID - The UID of the docker user

  • DOCKER_GID - The GID of the docker user

  • XDG_DATA_HOME - The data directory which will be mounted to the docker containers

If not specified, the UID/GID will use the current user.

A good choice for XDG_DATA_HOME is to use the ~erigon/.ethereum directory created by helper targets make user_linux or make user_macos.

Check: Permissions

In all cases, XDG_DATA_HOME (specified or default) must be writeable by the user UID/GID in docker, which will be determined by the DOCKER_UID and DOCKER_GID at build time.

If a build or service startup is failing due to permissions, check that all the directories, UID, and GID controlled by these environment variables are correct.

Run

circle-info

Windows support for docker-compose is not ready yet.

Next command starts: Erigon on port 30303, rpcdaemon on port 8545, prometheus on port 9090, and grafana on port 3000.

Makefile creates the initial directories for Erigon, Prometheus and Grafana. The PID namespace is shared between erigon and rpcdaemon which is required to open Erigon's DB from another process (RPCDaemon local-mode). See: https://github.com/erigontech/erigon/pull/2392/filesarrow-up-right

If your docker installation requires the docker daemon to run as root (which is by default), you will need to prefix the command above with sudo. However, it is sometimes recommended running docker (and therefore its containers) as a non-root user for security reasons. For more information about how to do this, refer to this articlearrow-up-right.

General Info and side notes

  • Images before 2.60.7 are released in repository “thorax/erigon”arrow-up-right and will not be moved to the new repo;

  • The released archive now comprises 10 key binaries: erigon, downloader, devnet, EVM, caplin, diag, integration, RPCDaemon, Sentry, and txpool;

  • The new Docker images feature seven binaries: erigon, integration, diag, Sentry, txpool, downloader, and RPCDaemon (same binaries included in the released archive);

  • Multi-platform docker image available for linux/amd64/v2 and linux/arm64 platforms and based on alpine:3.20.2; No need to pull another docker image for another different platform.

  • The Docker image is now compatible with multiple platforms: Linux (amd64, v2) and arm64. It's built on top of Alpine 3.20.2;

  • All build flags now passed to the release workflow — so, user can see previously missed build info in our released binaries (as well as in docker images) and also better build optimization expected;

  • With recent updates, all build configurations are now included in the release process. This provides users with more comprehensive build information for both binaries and Docker images, along with enhanced build optimizations..

Usagechevron-right

Last updated

Was this helpful?