docs.waku.org/assets/js/6e8bfb6f.bf5d76ca.js
2024-05-16 17:24:14 +00:00

1 line
8.0 KiB
JavaScript

"use strict";(self.webpackChunkwaku_guide=self.webpackChunkwaku_guide||[]).push([[6512],{3905:(e,n,t)=>{t.d(n,{Zo:()=>c,kt:()=>m});var r=t(67294);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function u(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=r.createContext({}),l=function(e){var n=r.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},c=function(e){var n=l(e.components);return r.createElement(s.Provider,{value:n},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},k=r.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),p=l(t),k=a,m=p["".concat(s,".").concat(k)]||p[k]||d[k]||o;return t?r.createElement(m,i(i({ref:n},c),{},{components:t})):r.createElement(m,i({ref:n},c))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,i=new Array(o);i[0]=k;var u={};for(var s in n)hasOwnProperty.call(n,s)&&(u[s]=n[s]);u.originalType=e,u[p]="string"==typeof e?e:a,i[1]=u;for(var l=2;l<o;l++)i[l]=t[l];return r.createElement.apply(null,i)}return r.createElement.apply(null,t)}k.displayName="MDXCreateElement"},16783:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>u,toc:()=>l});var r=t(87462),a=(t(67294),t(3905));const o={title:"Run Nwaku in a Docker Container",hide_table_of_contents:!0},i=void 0,u={unversionedId:"guides/nwaku/run-docker",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:!1,editUrl:"https://github.com/waku-org/docs.waku.org/tree/develop/docs/guides/nwaku/run-docker.md",tags:[],version:"current",lastUpdatedAt:1715880135,formattedLastUpdatedAt:"16 May 2024",frontMatter:{title:"Run Nwaku in a Docker Container",hide_table_of_contents:!0},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"}},s={},l=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Get Docker image",id:"get-docker-image",level:2},{value:"Run Docker container",id:"run-docker-container",level:2}],c={toc:l},p="wrapper";function d(e){let{components:n,...t}=e;return(0,a.kt)(p,(0,r.Z)({},c,t,{components:n,mdxType:"MDXLayout"}),(0,a.kt)("p",null,"This guide provides detailed steps to build and run a ",(0,a.kt)("inlineCode",{parentName:"p"},"nwaku")," node in a Docker container. If you prefer a pre-configured setup with a monitoring dashboard, see the ",(0,a.kt)("a",{parentName:"p",href:"/guides/nwaku/run-docker-compose"},"Run Nwaku with Docker Compose")," guide."),(0,a.kt)("h2",{id:"prerequisites"},"Prerequisites"),(0,a.kt)("p",null,"Ensure ",(0,a.kt)("a",{parentName:"p",href:"https://www.docker.com/"},"Docker")," is installed on your system using the appropriate instructions provided in the ",(0,a.kt)("a",{parentName:"p",href:"https://docs.docker.com/engine/install/"},"Docker documentation"),"."),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"We recommend running a ",(0,a.kt)("inlineCode",{parentName:"p"},"nwaku")," node with at least 2GB of RAM, especially if ",(0,a.kt)("inlineCode",{parentName:"p"},"WSS")," is enabled. If running just a ",(0,a.kt)("inlineCode",{parentName:"p"},"Relay")," node, 0.5GB of RAM is sufficient.")),(0,a.kt)("h2",{id:"get-docker-image"},"Get Docker image"),(0,a.kt)("p",null,"The Nwaku Docker images are available on the Docker Hub public registry under the ",(0,a.kt)("a",{parentName:"p",href:"https://hub.docker.com/r/statusteam/nim-waku"},"statusteam/nim-waku")," repository. Please visit ",(0,a.kt)("a",{parentName:"p",href:"https://hub.docker.com/r/statusteam/nim-waku/tags"},"statusteam/nim-waku/tags")," for images of specific releases."),(0,a.kt)("p",null,"You can also build the Docker image locally:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"# Clone the repository\ngit clone --recurse-submodules https://github.com/waku-org/nwaku\ncd nwaku\n\n# Build docker image\nmake docker-image\n")),(0,a.kt)("h2",{id:"run-docker-container"},"Run Docker container"),(0,a.kt)("p",null,"Run ",(0,a.kt)("inlineCode",{parentName:"p"},"nwaku")," in a new Docker container:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"docker run [OPTIONS] [IMAGE] [ARG...]\n")),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"OPTIONS")," are your selected ",(0,a.kt)("a",{parentName:"li",href:"https://docs.docker.com/engine/reference/commandline/run/#options"},"Docker options")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"IMAGE")," is the image and tag you pulled from the registry or built locally"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"ARG...")," is the list of arguments for your ",(0,a.kt)("a",{parentName:"li",href:"/guides/nwaku/config-options"},"node configuration options"))),(0,a.kt)("p",null,"Run ",(0,a.kt)("inlineCode",{parentName:"p"},"nwaku")," using the most typical configuration:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.20.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")),(0,a.kt)("p",null,"To find your public IP, use:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'\n")),(0,a.kt)("admonition",{type:"info"},(0,a.kt)("p",{parentName:"admonition"},"We recommend using explicit port mappings (",(0,a.kt)("inlineCode",{parentName:"p"},"-p"),") when exposing ports accessible from outside the host (listening and discovery ports, API servers).")),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"If you encounter issues running your node or require assistance with anything, please visit the ",(0,a.kt)("a",{parentName:"p",href:"https://discord.com/channels/1110799176264056863/1216748184592711691"},"#node-help channel")," on our Discord.")),(0,a.kt)("admonition",{title:"Congratulations!",type:"tip"},(0,a.kt)("p",{parentName:"admonition"},"You have successfully built and started a ",(0,a.kt)("inlineCode",{parentName:"p"},"nwaku")," node in a Docker container. Have a look at the ",(0,a.kt)("a",{parentName:"p",href:"/guides/nwaku/configure-nwaku"},"Node Configuration Examples")," guide to learn how to configure ",(0,a.kt)("inlineCode",{parentName:"p"},"nwaku")," for different use cases.")))}d.isMDXComponent=!0}}]);