2023-06-14 04:34:58 +01:00
---
title: Build Nwaku from Source
2023-11-23 12:01:32 +01:00
hide_table_of_contents: true
2025-10-03 15:54:25 +10:00
displayed_sidebar: runNode
2023-06-14 04:34:58 +01:00
---
2023-08-01 20:39:04 +01:00
This guide provides detailed steps to build a `nwaku` node from the source code to access the latest development version or a specific commit or release of `nwaku` . For your convenience, you may want to [download a pre-compiled binary ](https://github.com/waku-org/nwaku/tags ) instead.
2023-06-14 04:34:58 +01:00
2023-06-15 17:28:53 +01:00
:::info
2023-06-19 18:07:45 +01:00
- A minimum of 2GB of RAM is required to build `nwaku` .
- Nwaku is available for Linux and macOS, with experimental Windows support.
2023-06-15 17:28:53 +01:00
:::
2023-06-14 04:34:58 +01:00
2023-07-11 18:52:38 +01:00
## Prerequisites
2023-06-14 04:34:58 +01:00
2023-09-15 21:08:15 +01:00
To build `nwaku` , you need the standard developer tools, including a C compiler, GNU Make, Bash, Git, Rustup, and PostgreSQL client library.
2023-06-14 04:34:58 +01:00
```mdx-code-block
import Tabs from '@theme/Tabs ';
import TabItem from '@theme/TabItem ';
```
< Tabs >
< TabItem value = "debian" label = "Debian and Ubuntu" >
2023-11-23 12:01:32 +01:00
```shell
2024-02-10 03:29:08 +03:00
sudo apt-get install build-essential git libpq5 jq
2023-09-13 23:03:00 +05:30
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2024-02-10 03:29:08 +03:00
source "$HOME/.cargo/env"
2023-06-14 04:34:58 +01:00
```
< / TabItem >
< TabItem value = "fedora" label = "Fedora" >
2023-11-23 12:01:32 +01:00
```shell
2025-01-30 14:35:27 +01:00
sudo dnf install @development -tools git libpq-devel which
2023-09-13 23:03:00 +05:30
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2023-06-14 04:34:58 +01:00
```
< / TabItem >
< TabItem value = "arch" label = "Arch Linux" >
2023-11-23 12:01:32 +01:00
```shell
2023-08-01 20:39:04 +01:00
# Using your favoured AUR helper
2023-07-04 13:33:22 +01:00
sudo [AUR HELPER] -S base-devel git postgresql-libs
2023-09-13 23:03:00 +05:30
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
2023-06-14 04:34:58 +01:00
```
< / TabItem >
2023-06-20 12:41:55 +01:00
< TabItem value = "mac" label = "MacOS (Homebrew)" >
2023-06-14 04:34:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-09-13 23:03:00 +05:30
brew install cmake git postgresql@15 rustup-init
2023-07-04 13:33:22 +01:00
# Create a symbolic link to libpq.5.dylib in /usr/local/lib/
sudo mkdir -p /usr/local/lib/
sudo ln -s /opt/homebrew/opt/postgresql@15/lib/libpq .5.dylib /usr/local/lib/libpq.dylib
2023-06-14 04:34:58 +01:00
```
2023-06-20 12:41:55 +01:00
< / TabItem >
< / Tabs >
2023-11-23 12:01:32 +01:00
## Clone the repository
2023-06-14 04:34:58 +01:00
Get the source code from the GitHub repository. The default branch is `master` , the release candidate for major updates.
2023-11-23 12:01:32 +01:00
```shell
2023-06-14 04:34:58 +01:00
git clone https://github.com/waku-org/nwaku
cd nwaku
```
2023-06-14 13:08:58 +01:00
:::tip
2023-06-14 04:34:58 +01:00
You can use `git tag -l` to check specific version tags.
:::
2023-11-23 12:01:32 +01:00
## Build the binary
2023-06-14 04:34:58 +01:00
2023-06-15 17:28:53 +01:00
Build the `nwaku` binary:
2023-06-14 04:34:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-14 04:34:58 +01:00
make wakunode2
```
2023-06-14 13:08:58 +01:00
The first `make` invocation updates to all Git submodules. After each `git pull` , run `make update` to keep the submodules updated in the future.
2023-06-14 04:34:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-20 12:41:55 +01:00
make update
2023-06-14 04:34:58 +01:00
```
2023-11-23 12:01:32 +01:00
## Run the binary
2023-06-14 04:34:58 +01:00
2023-06-15 03:09:14 +01:00
Nwaku will create the `wakunode2` binary in the `./build/` directory.
2023-06-14 04:34:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-15 03:09:14 +01:00
# Run with default configuration
2023-06-14 04:34:58 +01:00
./build/wakunode2
2023-06-15 03:09:14 +01:00
# See available command line options
./build/wakunode2 --help
2023-06-14 04:34:58 +01:00
```
2023-08-01 20:39:04 +01:00
To learn more about running nwaku, have a look at these guides:
2023-06-14 04:34:58 +01:00
2025-10-03 15:54:25 +10:00
- [Run a Nwaku Node ](/run-node/ )
- [Run Nwaku in a Docker Container ](/run-node/run-docker )
- [Run Nwaku with Docker Compose ](/run-node/run-docker-compose )
- [Node Configuration Methods ](/run-node/config-methods )
2023-06-14 04:34:58 +01:00
2023-11-23 12:01:32 +01:00
## Run test suite
2023-06-14 04:34:58 +01:00
2023-06-22 11:46:26 +01:00
Run the tests for Waku:
2023-06-14 04:34:58 +01:00
2023-11-23 12:01:32 +01:00
```shell
2023-06-14 04:34:58 +01:00
make test
2023-09-13 23:03:00 +05:30
```
2023-09-15 21:08:15 +01:00
:::tip Congratulations!
2025-10-03 15:54:25 +10:00
You have successfully built the `nwaku` binary from the source code. Have a look at the [Node Configuration Examples ](/run-node/configure-nwaku ) guide to learn how to configure `nwaku` for different use cases.
2024-02-10 03:29:08 +03:00
:::