<titledata-rh="true">Set Up a Local Development Environment | Waku Documentation</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:url"content="https://docs.waku.org/build/javascript/local-dev-env"><metadata-rh="true"property="og:locale"content="en_GB"><metadata-rh="true"name="docusaurus_locale"content="en-GB"><metadata-rh="true"name="docsearch:language"content="en-GB"><metadata-rh="true"name="keywords"content="waku, web3"><metadata-rh="true"name="image"content="https://docs.waku.org/_og/fee168d3a2936afe248cae3ea510b183f31c20eb.png"><metadata-rh="true"name="docusaurus_version"content="current"><metadata-rh="true"name="docusaurus_tag"content="docs-default-current"><metadata-rh="true"name="docsearch:version"content="current"><metadata-rh="true"name="docsearch:docusaurus_tag"content="docs-default-current"><metadata-rh="true"property="og:title"content="Set Up a Local Development Environment | Waku Documentation"><metadata-rh="true"name="description"content="The most reliable way to ensure your js-waku application will work in realistic conditions is to spin up a local nwaku fleet and test against it."><metadata-rh="true"property="og:description"content="The most reliable way to ensure your js-waku application will work in realistic conditions is to spin up a local nwaku fleet and test against it."><linkdata-rh="true"rel="icon"href="/theme/image/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://docs.waku.org/build/javascript/local-dev-env"><linkdata-rh="true"rel="alternate"href="https://docs.waku.org/build/javascript/local-dev-env"hreflang="en-GB"><linkdata-rh="true"rel="alternate"href="https://docs.waku.org/build/javascript/local-dev-env"hreflang="x-default"><linkrel="alternate icon"type="image/png"href="/theme/image/favicon.png">
<p>The most reliable way to ensure your js-waku application will work in realistic conditions is to spin up a local nwaku fleet and test against it.</p>
<h2class="anchor anchorWithHideOnScrollNavbar_WYt5"id="requirements">Requirements<ahref="#requirements"class="hash-link"aria-label="Direct link to Requirements"title="Direct link to Requirements"></a></h2>
<ul>
<li><ahref="https://www.docker.com/products/docker-desktop/"target="_blank"rel="noopener noreferrer">Docker Desktop</a> or Docker Engine with Compose plugin</li>
</ul>
<h2class="anchor anchorWithHideOnScrollNavbar_WYt5"id="quick-start">Quick Start<ahref="#quick-start"class="hash-link"aria-label="Direct link to Quick Start"title="Direct link to Quick Start"></a></h2>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="1-start-the-network">1. Start the Network<ahref="#1-start-the-network"class="hash-link"aria-label="Direct link to 1. Start the Network"title="Direct link to 1. Start the Network"></a></h3>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="2-connect-your-js-waku-app">2. Connect Your js-waku App<ahref="#2-connect-your-js-waku-app"class="hash-link"aria-label="Direct link to 2. Connect Your js-waku App"title="Direct link to 2. Connect Your js-waku App"></a></h3>
<p>Copy the configuration from the output above and paste it into your application. Then start your node:</p>
<divclass="language-typescript codeBlockContainer_EB2s codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#F8F8F2;--prism-background-color:rgba(var(--lsd-surface-secondary), 0.08)"><divclass="codeBlockContent_QJqH"><pretabindex="0"class="prism-code language-typescript codeBlock_bY9V thin-scrollbar"style="color:#F8F8F2;background-color:rgba(var(--lsd-surface-secondary), 0.08)"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#F8F8F2"><spanclass="token keyword"style="color:rgb(189, 147, 249);font-style:italic">await</span><spanclass="token plain"> waku</span><spanclass="token punctuation"style="color:rgb(248, 248, 242)">.</span><spanclass="token function"style="color:rgb(80, 250, 123)">start</span><spanclass="token punctuation"style="color:rgb(248, 248, 242)">(</span><spanclass="token punctuation"style="color:rgb(248, 248, 242)">)</span><spanclass="token punctuation"style="color:rgb(248, 248, 242)">;</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#F8F8F2"><spanclass="token plain"style="display:inline-block"></span><br></span><spanclass="token-line"style="color:#F8F8F2"><spanclass="token plain"></span><spanclass="token comment"style="color:rgb(98, 114, 164)">// Your app is now connected to your local Waku network!</span><br></span></code></pre></div></div>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="3-stop-when-done">3. Stop When Done<ahref="#3-stop-when-done"class="hash-link"aria-label="Direct link to 3. Stop When Done"title="Direct link to 3. Stop When Done"></a></h3>
<h2class="anchor anchorWithHideOnScrollNavbar_WYt5"id="available-commands">Available Commands<ahref="#available-commands"class="hash-link"aria-label="Direct link to Available Commands"title="Direct link to Available Commands"></a></h2>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="using-npx-published-package">Using npx (published package)<ahref="#using-npx-published-package"class="hash-link"aria-label="Direct link to Using npx (published package)"title="Direct link to Using npx (published package)"></a></h3>
<table><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>npx @waku/run start</code></td><td>Start the network (detached) and show connection info</td></tr><tr><td><code>npx @waku/run stop</code></td><td>Stop the network and clean up</td></tr><tr><td><code>npx @waku/run info</code></td><td>Show connection info for running network</td></tr><tr><td><code>npx @waku/run logs</code></td><td>View and follow logs from all nodes</td></tr><tr><td><code>npx @waku/run test</code></td><td>Test the network by sending a message</td></tr></tbody></table>
<h2class="anchor anchorWithHideOnScrollNavbar_WYt5"id="configuration">Configuration<ahref="#configuration"class="hash-link"aria-label="Direct link to Configuration"title="Direct link to Configuration"></a></h2>
<p>All configuration is done via environment variables passed to the command.</p>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="custom-ports">Custom Ports<ahref="#custom-ports"class="hash-link"aria-label="Direct link to Custom Ports"title="Direct link to Custom Ports"></a></h3>
<p>If the default ports are in use, specify custom ports:</p>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="cluster-configuration">Cluster Configuration<ahref="#cluster-configuration"class="hash-link"aria-label="Direct link to Cluster Configuration"title="Direct link to Cluster Configuration"></a></h3>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="custom-nwaku-version">Custom nwaku Version<ahref="#custom-nwaku-version"class="hash-link"aria-label="Direct link to Custom nwaku Version"title="Direct link to Custom nwaku Version"></a></h3>
<h2class="anchor anchorWithHideOnScrollNavbar_WYt5"id="debugging">Debugging<ahref="#debugging"class="hash-link"aria-label="Direct link to Debugging"title="Direct link to Debugging"></a></h2>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="view-node-logs">View Node Logs<ahref="#view-node-logs"class="hash-link"aria-label="Direct link to View Node Logs"title="Direct link to View Node Logs"></a></h3>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="check-node-health">Check Node Health<ahref="#check-node-health"class="hash-link"aria-label="Direct link to Check Node Health"title="Direct link to Check Node Health"></a></h3>
<h3class="anchor anchorWithHideOnScrollNavbar_WYt5"id="check-peer-connections">Check Peer Connections<ahref="#check-peer-connections"class="hash-link"aria-label="Direct link to Check Peer Connections"title="Direct link to Check Peer Connections"></a></h3>