Skip to content
You are reading the Teku development version documentation and some features may not be available in the stable release. You can switch to the stable version using the version box at the bottom of the screen.

Updated on November 12, 2020

Running Teku from a Docker image

Use the Teku Docker image to run a node without installing Teku.


Run Teku Docker image

Display the Teku command line help using the Docker image

docker run consensys/teku:latest --help

You can specify Teku environment variables with the docker image instead of the command line options.

Example using Environment variables and CLI options

docker run -d -p 9000:9000 -p 5051:5051 -e TEKU_REST_API_ENABLED=true -e TEKU_P2P_PORT=9000 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=medalla --eth1-endpoint= --validator-keys=/var/lib/teku/validator/keys:/var/lib/teku/validator/passwords --data-path=/var/lib/teku --log-destination=CONSOLE


Allow multiple users to run the Docker image

If using a local volume to mount data, ensure the permissions on the directory allow other users and groups to read/write.

Use the Docker --user option to run the container for the specified user. Use the UID because the username may not exist inside the docker container.


docker run -p 9000:9000 --user 1001:1001 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=medalla --eth1-endpoint= --validator-keys=var/lib/teku/validator/keys:var/lib/teku/validator/passwords

Exposing ports

Expose ports for P2P peer discovery, metrics, and REST APIs. Expose the default ports or the ports specified using:

To run Teku exposing local ports for access:

docker run -p <localportP2P>:30303 -p <localportREST>:5051 consensys/teku:latest --network=<NETWORK> --eth1-endpoint=<URL> --validator-keys=<KEY_DIR>:<PASS_DIR> --rest-api-enabled=true


docker run -p 30303:30303 -p 5051:5051 --mount type=bind,source=/Users/user1/teku/,target=/var/lib/teku consensys/teku:latest --network=medalla --eth1-endpoint= --validator-keys=var/lib/teku/validator/keys:var/lib/teku/validator/passwords --rest-api-enabled=true

Run Teku using Docker Compose


The following docker-compose.yml file starts a Hyperledger Besu and Teku node.


The example assumes the validators specified in --validator-keys has already been registered in the Ethereum 1.0 deposit contract.

Run docker-compose up in the directory containing the docker-compose.yml file to start the container.

version: '3.4'

    image: hyperledger/besu:latest
    command: ["--network=goerli",
      - ./besu:/opt/besu/data
      # Map the p2p port(30303) and RPC HTTP port(8545)
      - "8545:8545"
      - "30303:30303"

    image: consensys/teku:latest
    command: ["--network=medalla",
      - besu_node
      - ./teku:/opt/teku/data
      # Map the p2p port(9000) and REST API port(5051)
      - "9000:9000"
      - "5051:5051"
Questions or feedback? You can discuss issues and obtain free support on Teku Discord channel.
For paid professional support by Consensys, contact us at