Step 1: Install Docker

Make sure Docker is installed and running. Use these commands on Linux:

sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker

Step 2: Pull or Build the Docker Image

Pull the latest Docker image:

docker pull statusteam/nim-waku:v0.20.0

Build the image locally (if you want to build from source):

git clone --recurse-submodules <https://github.com/waku-org/nwaku>
cd nwaku
make docker-image

Step 3: Running the nwaku Node

Start a basic nwaku node:

docker run -it \\
    -p 60000:60000 \\
    -p 9000:9000/udp \\
    statusteam/nim-waku:v0.20.0 \\
    --dns-discovery=true --nat=extip:[YOUR_PUBLIC_IP]

This command opens ports 60000 for TCP and 9000 for UDP. Replace [YOUR_PUBLIC IP] with the IP address you want to advertise for peer connections.

Step 4: Persistent Data Storage

To preserve node data across restarts, mount a Docker volume:

docker run -it \\
    -v nwaku_data:/var/lib/nwaku \\
    -p 60000:60000 \\
    -p 9000:9000/udp \\
    statusteam/nim-waku:v0.20.0 \\
    --dns-discovery=true --nat=extip:[YOUR_PUBLIC_IP]

Step 5: Configure nwaku Using Custom Configuration Files

Create a custom config.toml file to specify node settings, then mount it into the Docker container:

docker run -v $(pwd)/config.toml:/etc/nwaku/config.toml \\
    statusteam/nim-waku:v0.20.0 --config=/etc/nwaku/config.toml

Step 6: Enabling Advanced Features

You can enable specific protocols or configure other options: