Running Mina with Docker

1. Preparation

1.1 Ubuntu setup

Update the packages on the server to the latest versions:

sudo apt update && sudo apt upgrade -y

Install and activate Docker:

sudo apt install docker.io curl -y \
&& sudo systemctl start docker \
&& sudo systemctl enable docker

1.2 Firewall configuration

If your VPS server has a built-in Firewall, then you should open ports 8302 and 8303 there.

If not, then follow the commands below:

Open ports 8302 and 8303:

sudo iptables -A INPUT -p tcp --dport 8302:8303 -j ACCEPT

2. Node launch options

2.1 Run only Block Producer:

Variables description: --name mina - you can use any name for the container, or leave it as it is; --env MINA_PRIVKEY_PASS='YOUR_PASS' - instead YOUR PASS enter the password for your key.

--env UPTIME_PRIVKEY_PASS='YOUR_PASS' - instead YOUR PASS enter the password for your key for uptime system. $KEYPATH - path to the file with the private key my-wallet.

Optional: --coinbase-receiver B62qp... - flag to redirect block reward to another address.

2.1.1 Run Snark Worker to Block Producer:

Let's set the Worker fee: set-snark-work-fee 0.025 - the commission value of 0.025 can be changed to any other.

Run Worker:

For both Block Producer and Snark Worker to work, you may configure the Snark Stopper. To briefly stop the Worker during block production.

Follow the link below to set up your Snark Stopper.

Setting up Snark Stopper

2.2 Run only Snark Worker (without Block Producer)

First, let's launch a node without a Producer and a Snark.

Variables description:

--name mina - you can use any name for the container, or leave it as it is;

By default, the -work-selection for a snark worker is random rand. You can change this by adding the -work-selection seq flag to the command, which will work on jobs in the order required to be included from the scan state and will likely result in your snarks being included without a potentially lengthy delay;

set-snark-work-fee 0.025 - the commission value of 0.025 can be changed to any other.

3. Viewing logs

View running containers:

Node container logs:

Node status:

3.1 Alternative log output

The output will only show the line with the block producer running. See example below:

4. Docker commands

The container is stopped by the command:

Restart container:

Removing a container:

Removing a running container:

5. Others

Deleting config folder:

Last updated

Was this helpful?