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