Running a Chainlink Node on MacOS
This document will walk through the steps to get a Chainlink node running locally using Docker on Mac OS in a few steps.
Note: replace any values [LIKE_THIS] with the appropriate value
Create The Docker Environment
-
Create a directory to house the image and settings
mkdir chainlink-kovan cd chainlink-kovanWithin this directory you need a few files.
-
Create
.envโ this will house the docker environment variables for the Chainlink NodeROOT=/chainlink LOG_LEVEL=debug ETH_CHAIN_ID=42 MIN_OUTGOING_CONFIRMATIONS=2 LINK_CONTRACT_ADDRESS=0xa36085F69e2889c224210F603D836748e7dC0088 CHAINLINK_TLS_PORT=0 SECURE_COOKIES=false GAS_UPDATER_ENABLED=true ALLOW_ORIGINS=* ETH_URL=wss://eth-kovan.alchemyapi.io/v2/[YOUR_API_KEY] DATABASE_URL=postgresql://postgres:[PG_PASSWORD]@[DOCKER_IMAGE]:5432/chainlink?sslmode=disable DATABASE_TIMEOUT=0๐
[YOUR_API_KEY]can be found via alchemy
-
Create
database.envโ this will house the docker environment variables for the PostgreSQL NodePOSTGRES_USER=postgres POSTGRES_PASSWORD=[PG_PASSWORD] POSTGRES_DB=chainlink -
Create
docker-compose.ymlโ this will house the configuration for your docker images.version: '3' services: pg_chainlink: image: "postgres" ports: - "5432:5432" env_file: - database.env volumes: - [PATH_TO_POSTGRES_DATA]:/var/lib/postgressql/data/ chainlink: image: "smartcontract/chainlink:[CURRENT_VERSION]" env_file: .env depends_on: - pg_chainlink ports: - "6688:6688" volumes: - [PATH_TO_CHAINLINK_VOLUME]:/chainlink/ command: node start --password /chainlink/password.txt --api /chainlink/apicredentials.txt[PATH_TO_POSTGRES_DATA]is the location of the PostgreSQL data directory. For me it is:/Library/PostgreSQL/14/data[PATH_TO_CHAINLINK_VOLUME]should be a directory that will house a few more items. I created it withinchainlink-kovanmkdir chainlink-volume cd chainlink-volume pwdUse the results and use that for
[PATH_TO_CHAINLINK_VOLUME] -
While still in the chainlink-volume create a few files In
password.txtadd, feel free to change the passwordsecretIn
apicredentials.txtadd, this will be the username and password for the web UIyour-email@address.com password
Prep Docker
- Add the PostgreSQL and Chainlink volumes to docker

Start docker
-
Run
docker compose upYou will see the following error

This is expected. The database for PostgreSQL has not been created
-
Create the PostgreSQL database for chainlink

-
Stop docker if itโs still running
ctrl-cand re-rundocker compose upYou should see a flurry of activity and something like this ๐

Now that your node is running, open the operator interface.
Open the operator interface
-
Head to http://localhost:6688

-
Login with the credentials you set in
apicredentials.txt