docs.waku.org/assets/js/9bfa6c6d.7e91b217.js
2025-10-03 11:14:33 +00:00

1 line
7.1 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[6102],{28453:(e,n,r)=>{r.d(n,{R:()=>t,x:()=>d});var o=r(96540);const i={},s=o.createContext(i);function t(e){const n=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),o.createElement(s.Provider,{value:n},e.children)}},65950:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>l,frontMatter:()=>t,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"run-node/run-docker","title":"Run Nwaku in a Docker Container","description":"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 guide.","source":"@site/docs/run-node/run-docker.md","sourceDirName":"run-node","slug":"/run-node/run-docker","permalink":"/run-node/run-docker","draft":false,"unlisted":false,"editUrl":"https://github.com/waku-org/docs.waku.org/tree/develop/docs/run-node/run-docker.md","tags":[],"version":"current","lastUpdatedAt":null,"frontMatter":{"title":"Run Nwaku in a Docker Container","hide_table_of_contents":true,"displayed_sidebar":"runNode"},"sidebar":"runNode","previous":{"title":"Run Nwaku with Docker Compose","permalink":"/run-node/run-docker-compose"},"next":{"title":"Build Nwaku from Source","permalink":"/run-node/build-source"}}');var i=r(74848),s=r(28453);const t={title:"Run Nwaku in a Docker Container",hide_table_of_contents:!0,displayed_sidebar:"runNode"},d=void 0,a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Get Docker image",id:"get-docker-image",level:2},{value:"Build Docker image",id:"build-docker-image",level:2},{value:"Run Docker container",id:"run-docker-container",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This guide provides detailed steps to build and run a ",(0,i.jsx)(n.code,{children:"nwaku"})," node in a Docker container. If you prefer a pre-configured setup with a monitoring dashboard, see the ",(0,i.jsx)(n.a,{href:"/run-node/run-docker-compose",children:"Run Nwaku with Docker Compose"})," guide."]}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.p,{children:["Ensure ",(0,i.jsx)(n.a,{href:"https://www.docker.com/",children:"Docker"})," is installed on your system using the appropriate instructions provided in the ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/engine/install/",children:"Docker documentation"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["We recommend running a ",(0,i.jsx)(n.code,{children:"nwaku"})," node with at least 2GB of RAM, especially if ",(0,i.jsx)(n.code,{children:"WSS"})," is enabled. If running just a ",(0,i.jsx)(n.code,{children:"Relay"})," node, 0.5GB of RAM is sufficient."]})}),"\n",(0,i.jsx)(n.h2,{id:"get-docker-image",children:"Get Docker image"}),"\n",(0,i.jsxs)(n.p,{children:["The Nwaku Docker images are available on the Docker Hub public registry under the ",(0,i.jsx)(n.a,{href:"https://hub.docker.com/r/wakuorg/nwaku",children:"wakuorg/nwaku"})," repository. Please visit ",(0,i.jsx)(n.a,{href:"https://hub.docker.com/r/wakuorg/nwaku/tags",children:"wakuorg/nwaku/tags"})," for images of specific releases."]}),"\n",(0,i.jsx)(n.h2,{id:"build-docker-image",children:"Build Docker image"}),"\n",(0,i.jsx)(n.p,{children:"You can also build the Docker image locally:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"# Clone the repository\ngit clone --recurse-submodules https://github.com/waku-org/nwaku\ncd nwaku\n\n# Build docker image\nmake docker-image\n"})}),"\n",(0,i.jsx)(n.h2,{id:"run-docker-container",children:"Run Docker container"}),"\n",(0,i.jsxs)(n.p,{children:["Run ",(0,i.jsx)(n.code,{children:"nwaku"})," in a new Docker container:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"docker run [OPTIONS] [IMAGE] [ARG...]\n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"OPTIONS"})," are your selected ",(0,i.jsx)(n.a,{href:"https://docs.docker.com/engine/reference/commandline/run/#options",children:"Docker options"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"IMAGE"})," is the image and tag you pulled from the registry or built locally"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"ARG..."})," is the list of arguments for your ",(0,i.jsx)(n.a,{href:"/run-node/config-options",children:"node configuration options"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Run ",(0,i.jsx)(n.code,{children:"nwaku"})," using the most typical configuration:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"docker run -i -t -p 60000:60000 -p 9000:9000/udp wakuorg/nwaku:v0.32.0 \\\n --dns-discovery=true \\\n --dns-discovery-url=enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im \\\n --discv5-discovery=true \\\n --nat=extip:[YOUR PUBLIC IP] # or, if you are behind a nat: --nat=any\n"})}),"\n",(0,i.jsx)(n.p,{children:"To find your public IP, use:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'\n"})}),"\n",(0,i.jsx)(n.p,{children:"For more detailed information about all possible configurations, please run"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-shell",children:"docker run -t wakuorg/nwaku:v0.32.0 --help\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsx)(n.p,{children:"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"})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["We recommend using explicit port mappings (",(0,i.jsx)(n.code,{children:"-p"}),") when exposing ports accessible from outside the host (listening and discovery ports, API servers)."]})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["If you encounter issues running your node or require assistance with anything, please visit the - Visit the #help-desk channel on ",(0,i.jsx)(n.a,{href:"https://discord.waku.org/",children:"Discord"}),"."]})}),"\n",(0,i.jsx)(n.admonition,{title:"Congratulations!",type:"tip",children:(0,i.jsxs)(n.p,{children:["You have successfully built and started a ",(0,i.jsx)(n.code,{children:"nwaku"})," node in a Docker container. Have a look at the ",(0,i.jsx)(n.a,{href:"/run-node/configure-nwaku",children:"Node Configuration Examples"})," guide to learn how to configure ",(0,i.jsx)(n.code,{children:"nwaku"})," for different use cases."]})})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}}}]);