/ docs / run-node / run-docker.md
run-docker.md
 1  ---
 2  title: Run Nwaku in a Docker Container
 3  hide_table_of_contents: true
 4  displayed_sidebar: runNode
 5  ---
 6  
 7  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.
 8  
 9  ## Prerequisites
10  
11  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/).
12  
13  :::info
14  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.
15  :::
16  
17  ## Get Docker image
18  
19  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.
20  
21  ## Build Docker image
22  
23  You can also build the Docker image locally:
24  
25  ```shell
26  # Clone the repository
27  git clone --recurse-submodules https://github.com/waku-org/nwaku
28  cd nwaku
29  
30  # Build docker image
31  make docker-image
32  ```
33  
34  ## Run Docker container
35  
36  Run `nwaku` in a new Docker container:
37  
38  ```shell
39  docker run [OPTIONS] [IMAGE] [ARG...]
40  ```
41  
42  - `OPTIONS` are your selected [Docker options](https://docs.docker.com/engine/reference/commandline/run/#options)
43  - `IMAGE` is the image and tag you pulled from the registry or built locally
44  - `ARG...` is the list of arguments for your [node configuration options](/run-node/config-options)
45  
46  Run `nwaku` using the most typical configuration:
47  
48  ```shell
49  docker run -i -t -p 60000:60000 -p 9000:9000/udp wakuorg/nwaku:v0.32.0 \
50    --dns-discovery=true \
51    --dns-discovery-url=enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im \
52    --discv5-discovery=true \
53    --nat=extip:[YOUR PUBLIC IP] # or, if you are behind a nat: --nat=any
54  ```
55  
56  To find your public IP, use:
57  
58  ```shell
59  dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'
60  ```
61  
62  For more detailed information about all possible configurations, please run
63  
64  ```shell
65  docker run -t wakuorg/nwaku:v0.32.0 --help
66  ```
67  
68  :::info
69  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
70  :::
71  
72  :::info
73  We recommend using explicit port mappings (`-p`) when exposing ports accessible from outside the host (listening and discovery ports, API servers).
74  :::
75  
76  :::tip
77  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/).
78  :::
79  
80  :::tip Congratulations!
81  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.
82  :::