NEW

CCIP is now live for all developers. See what's new.

Running a Chainlink Node

This guide will teach you how to run a Chainlink node locally using Docker. The Chainlink node will be configured to connect to the Ethereum Sepolia.

Requirements

  • As explained in the requirements page, make sure there are enough resources to run a Chainlink node and a PostgreSQL database.
  • Install Docker Desktop. You will run the Chainlink node and PostgreSQL in Docker containers.
  • Chainlink nodes must be able to connect to an Ethereum client with an active websocket connection. See Running an Ethereum Client for details. In this tutorial, you can use an external service as your client.

Using Docker

Run PostgreSQL

  1. Run PostgreSQL in a Docker container. You can replace mysecretpassword with your own password.

    docker run --name cl-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
    
  2. Confirm that the container is running. Note the 5432 port is published 0.0.0.0:5432->5432/tcp and therefore accessible outside of Docker.

    docker ps -a -f name=cl-postgres
    

    If the container is running successfully, the output shows a healthy status:

    CONTAINER ID   IMAGE      COMMAND                  CREATED         STATUS         PORTS                    NAMES
    dc08cfad2a16   postgres   "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes   0.0.0.0:5432->5432/tcp   cl-postgres
    

Configure users and roles

You can create several users with different role-based access tiers. This allows you to grant access to several users without granting admin privileges to every user. Role-based access can be configured only by using the CLI.

  1. Open an interactive bash shell on the container that is running your node:

    docker exec -it chainlink /bin/bash
    
  2. Log into the Chainlink CLI. The CLI prompts you for the admin credentials that you configured for your node.

    chainlink admin login
    
  3. Add a user with view-only permissions on the node. The CLI prompts you for the new user's credentials.

    chainlink admin users create --email=operator-ui-view-only@test.com --role=view
    

    This user can now log into the UI and query the API, but cannot change any settings or jobs.

  4. Confirm the current list of users:

    chainlink admin users list
    
  5. Log out of the CLI. This prevents users with access to the shell from executing admin commands.

    chainlink admin logout
    
  6. Exit from the container.

    exit
    

To learn how to modify user roles and see the full list of available roles, read the Role-Based Access Control page.

What's next

Stay updated on the latest Chainlink news