Deploying ENSNode with Docker
The Docker images are the easiest way to run or deploy the ENSNode suite of services, both locally and in the cloud.
Below is a sample Docker Compose file linking the various services together.
services: ensindexer: container_name: ensindexer image: ghcr.io/namehash/ensnode/ensindexer:latest ports: - "42069:42069" environment: # Override DATABASE_URL to point to docker compose postgres DATABASE_URL: postgresql://postgres:password@postgres:5432/postgres # Override ENSRAINBOW_URL to point to docker compose ensrainbow ENSRAINBOW_URL: http://ensrainbow:3223 # Override ENSADMIN_URL to point to docker compose ensadmin ENSADMIN_URL: http://localhost:4173 # Override ENSNODE_PUBLIC_URL to point to docker compose ensindexer # Note: it must be URL accessible from web browser (i.e. it cannot be a hostname in docker network) ENSNODE_PUBLIC_URL: http://localhost:42069 env_file: # NOTE: must define apps/ensindexer/.env.local (see apps/ensindexer/.env.local.example) - path: ./apps/ensindexer/.env.local required: true depends_on: - ensrainbow - postgres
ensrainbow: container_name: ensrainbow image: ghcr.io/namehash/ensnode/ensrainbow:latest ports: - "3223:3223" env_file: # NOTE: can define apps/ensrainbow/.env.local (see apps/ensrainbow/.env.local.example) - path: ./apps/ensrainbow/.env.local required: false restart: unless-stopped
ensadmin: container_name: ensadmin image: ghcr.io/namehash/ensnode/ensadmin:latest ports: - "4173:4173" environment: # Override ENSADMIN_PUBLIC_URL to point to docker compose ensindexer # Note: it must be URL accessible from web browser (i.e. it cannot be a hostname in docker network) ENSADMIN_PUBLIC_URL: http://localhost:4173 # Override NEXT_PUBLIC_DEFAULT_ENSNODE_URLS to the docker compose ensindexer # Note: it must be a comma-separated list of URLs that are accessible from a web browser # (i.e. it cannot be a hostname in the docker network) NEXT_PUBLIC_DEFAULT_ENSNODE_URLS: http://localhost:42069 env_file: # NOTE: can define apps/ensadmin/.env.local (see apps/ensadmin/.env.local.example) - path: ./apps/ensadmin/.env.local required: false depends_on: - ensindexer
postgres: container_name: postgres image: postgres:17 environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data
volumes: postgres_data: driver: local
Example Docker Compose View the complete Docker Compose example on GitHub.