Docker Compose
Setting up a HOPR node with Docker Compose is intended for advanced users. It provides a sophisticated setup, allowing the use of a configuration file and node monitoring tools to enhance the node management experience.
Install Docker, Docker Compose and unzip
Your node machine needs Docker Engine, the Docker Compose plugin, and the curl and unzip tools. Install them on the machine where you will run your node.
If you are migrating from v3.0.x, Docker and Docker Compose are already installed. Run the commands in the last step to check that docker compose and unzip work, then continue with Create your node identity, Safe and node module.
- Linux
- macOS
-
Install Docker Engine and Docker Compose
Follow the official guide for your distribution. Each guide installs Docker Engine together with the Docker Compose plugin (
docker-compose-plugin). -
Install curl and unzip
Ubuntu / Debian:
sudo apt-get update && sudo apt-get install -y curl unzipFedora / CentOS:
sudo dnf install -y curl unzip -
Allow your user to run Docker
The commands in this guide run
dockerwithoutsudo. Add your user to thedockergroup:sudo usermod -aG docker $USERLog out and log back in (or reconnect via SSH) for the change to take effect. Members of the
dockergroup have root-level access to the machine, so only add users you trust. If you prefer not to do this, addsudoin front of everydockercommand in this guide. -
Check the installation
Run these commands. Each one should print a version number:
docker --versiondocker compose versionunzip -v | head -1If
docker compose versionfails, the Docker Compose plugin is missing. The olderdocker-composecommand (with a hyphen) is not used in this guide.
-
Install Docker Desktop
Download and install Docker Desktop. It includes Docker Engine and Docker Compose.
curlandunzipare already installed on macOS. -
Start Docker Desktop
Open Docker Desktop and wait until it shows that Docker is running.
-
Check the installation
Open the Terminal app and run these commands. Each one should print a version number:
docker --versiondocker compose versionunzip -v | head -1
Create your node identity, Safe and node module
If you came here from the migration guide, you already have your identity file and your new Safe and node module addresses. Skip to Download compose folder.
Run these steps on any computer with Docker Desktop. This can be your node machine if it is your own computer. Don't run them on a rented or shared server, because the command in step 2.4 asks for a private key.
-
Start Docker Desktop
Download and start Docker Desktop on your computer.
-
Create a temporary folder
Create a temporary folder called
hopr-identityin your home directory.Linux / macOS (Terminal):
mkdir -p ~/hopr-identityWindows (PowerShell):
New-Item -ItemType Directory -Force -Path "$HOME\hopr-identity" -
Create your node identity
Gather the values you need for node identity creation. You'll paste these into the command.
Placeholder What it is Where to find it <YOUR_IDENTITY_PASSWORD>The password that protects your node identity file Create a strong passphrase (refer to this guide). <NUMBER>How many node identities to create, one per node Use 1unless you run several nodes (see Multiple nodes).Create your node identity. The folder path is written differently on each system.
Linux / macOS (Terminal):
docker run --rm -it --pull always \-v ~/hopr-identity:/data \-e IDENTITY_PASSWORD='<YOUR_IDENTITY_PASSWORD>' \europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopli:latest \identity create \--identity-directory /data \--identity-prefix hopr \--number <NUMBER>Windows (PowerShell):
docker run --rm -it --pull always `-v "$HOME\hopr-identity:/data" `-e 'IDENTITY_PASSWORD=<YOUR_IDENTITY_PASSWORD>' `europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopli:latest `identity create `--identity-directory /data `--identity-prefix hopr `--number <NUMBER>The command creates one file per identity in the
hopr-identityfolder:hopr0.id,hopr1.id, and so on. -
Create your Safe and node module
Gather the values you need for Safe and node module creation. You'll paste these into the command.
Placeholder What it is Where to find it <YOUR_IDENTITY_PASSWORD>The password that protects your node identity file The password you set in previous step during node identity creation. <YOUR_RPC_PROVIDER_URL>The URL of a Gnosis Chain RPC endpoint See the Custom RPC provider guide. <SAFE_OWNER>The address of the wallet that owns your Safe wallet. Your wallet app, for example Rabby wallet, MetaMask. importantBefore you run the command, create a new burner wallet (a fresh wallet with no other funds) and send it
0.02 xDai. The command asks for this wallet's private key and uses it only to pay the transaction fees. Your new Safe is owned by your<SAFE_OWNER>wallet, not the burner wallet, so you never need to paste your Safe owner's private key.Create your Safe and node module, and add the node identity you just created to them. The folder path is written differently on each system.
Linux / macOS (Terminal):
docker run --rm -it --pull always \-v ~/hopr-identity:/data \-e IDENTITY_PASSWORD='<YOUR_IDENTITY_PASSWORD>' \europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopli:latest \safe-module create \--network piz-palu-prod \--provider-url <YOUR_RPC_PROVIDER_URL> \--admin-address <SAFE_OWNER> \--identity-directory /data \--allowance 15000000000000000000000Windows (PowerShell):
docker run --rm -it --pull always `-v "$HOME\hopr-identity:/data" `-e 'IDENTITY_PASSWORD=<YOUR_IDENTITY_PASSWORD>' `europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopli:latest `safe-module create `--network piz-palu-prod `--provider-url <YOUR_RPC_PROVIDER_URL> `--admin-address <SAFE_OWNER> `--identity-directory /data `--allowance 15000000000000000000000-
At the Enter private key: prompt, paste the private key of your burner wallet and press Enter. Nothing appears on screen while you paste, which is expected.
-
hoplisends the transactions. When it finishes, the last two lines show your newsafeandnode_moduleaddresses. Example:safe 0xAbC0000000000000000000000000000000000123node_module 0xDeF0000000000000000000000000000000000456
-
-
Write down your Safe and node module addresses
Write down the
safeandnode_moduleaddresses. You will enter them in Configure your node. -
Keep your identity file and password
Keep the
hopr0.idfile and its password. You will copy the file to your node machine in Manage the identity file, and enter the password in Set up secrets environment variables.
Download compose folder
Start by downloading the compose folder from the HOPR repository to the machine where you will run your node. Run the command in your home folder (or wherever you want the compose folder to live). It needs curl and unzip from Install Docker, Docker Compose and unzip:
curl -fL -o v5.0.0.zip https://github.com/hoprnet/hoprd/archive/refs/tags/v5.0.0.zip && \
unzip v5.0.0.zip "hoprd-5.0.0/deploy/compose/*" -d extracted_files && \
mv extracted_files/hoprd-5.0.0/deploy/compose . && \
rm -rf v5.0.0.zip extracted_files