docs.waku.org/docs/run-node/run-docker.md

83 lines
3.0 KiB
Markdown
Raw Permalink Normal View History

2023-06-14 13:08:58 +01:00
---
2023-06-18 09:34:09 +01:00
title: Run Nwaku in a Docker Container
2023-11-23 12:01:32 +01:00
hide_table_of_contents: true
displayed_sidebar: runNode
2023-06-14 13:08:58 +01:00
---
This guide provides detailed steps to build and run a `nwaku` node in a Docker container. If you prefer a pre-configured setup with a monitoring dashboard, see the [Run Nwaku with Docker Compose](/run-node/run-docker-compose) guide.
2023-06-14 13:08:58 +01:00
## Prerequisites
2023-06-20 12:41:55 +01:00
Ensure [Docker](https://www.docker.com/) is installed on your system using the appropriate instructions provided in the [Docker documentation](https://docs.docker.com/engine/install/).
2023-06-14 13:08:58 +01:00
2024-05-16 18:22:15 +01:00
:::info
We recommend running a `nwaku` node with at least 2GB of RAM, especially if `WSS` is enabled. If running just a `Relay` node, 0.5GB of RAM is sufficient.
:::
2023-11-23 12:01:32 +01:00
## Get Docker image
2023-06-14 13:08:58 +01:00
The Nwaku Docker images are available on the Docker Hub public registry under the [wakuorg/nwaku](https://hub.docker.com/r/wakuorg/nwaku) repository. Please visit [wakuorg/nwaku/tags](https://hub.docker.com/r/wakuorg/nwaku/tags) for images of specific releases.
2023-06-14 13:08:58 +01:00
2024-08-19 12:49:19 +02:00
## Build Docker image
2023-06-15 17:28:53 +01:00
You can also build the Docker image locally:
2023-06-14 13:08:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-15 03:09:14 +01:00
# Clone the repository
2023-06-14 13:08:58 +01:00
git clone --recurse-submodules https://github.com/waku-org/nwaku
cd nwaku
2023-06-15 03:09:14 +01:00
2023-06-20 12:41:55 +01:00
# Build docker image
2023-06-15 04:33:19 +01:00
make docker-image
2023-06-14 13:08:58 +01:00
```
2023-11-23 12:01:32 +01:00
## Run Docker container
2023-06-14 13:08:58 +01:00
2023-06-15 17:28:53 +01:00
Run `nwaku` in a new Docker container:
2023-06-14 13:08:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-14 13:08:58 +01:00
docker run [OPTIONS] [IMAGE] [ARG...]
```
- `OPTIONS` are your selected [Docker options](https://docs.docker.com/engine/reference/commandline/run/#options)
- `IMAGE` is the image and tag you pulled from the registry or built locally
- `ARG...` is the list of arguments for your [node configuration options](/run-node/config-options)
2023-06-14 13:08:58 +01:00
2023-06-15 17:28:53 +01:00
Run `nwaku` using the most typical configuration:
2023-06-14 13:08:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
docker run -i -t -p 60000:60000 -p 9000:9000/udp wakuorg/nwaku:v0.32.0 \
--dns-discovery=true \
--dns-discovery-url=enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im \
--discv5-discovery=true \
--nat=extip:[YOUR PUBLIC IP] # or, if you are behind a nat: --nat=any
2023-06-15 04:33:19 +01:00
```
To find your public IP, use:
2023-06-14 13:08:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-15 04:33:19 +01:00
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'
```
For more detailed information about all possible configurations, please run
```shell
docker run -t wakuorg/nwaku:v0.32.0 --help
```
:::info
Note that running a node in The Waku Network (--cluster-id=1) requires a special set of configurations and therefore, it is recommended to run in this case with docker compose
:::
2024-05-16 18:22:15 +01:00
:::info
2023-06-19 18:07:45 +01:00
We recommend using explicit port mappings (`-p`) when exposing ports accessible from outside the host (listening and discovery ports, API servers).
:::
2024-05-16 18:22:15 +01:00
:::tip
If you encounter issues running your node or require assistance with anything, please visit the - Visit the #help-desk channel on [Discord](https://discord.waku.org/).
2024-05-16 18:22:15 +01:00
:::
:::tip Congratulations!
You have successfully built and started a `nwaku` node in a Docker container. Have a look at the [Node Configuration Examples](/run-node/configure-nwaku) guide to learn how to configure `nwaku` for different use cases.
:::