You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(docker,ci,docs): privilege-drop entrypoint, nextest in CI, expanded getting-started guide
Docker: the image no longer runs as root. A new docker-entrypoint.sh
(using gosu) fixes ownership on the data volume when started as root,
then drops to uid 10001 (nodedb) before exec-ing the server. When
already started as a non-root user (--user 10001:10001) the entrypoint
passes through directly. This makes named-volume mounts work on Linux
hosts where Docker initialises volumes as root-owned.
CI: the test workflow now installs cargo-nextest via taiki-e/install-action
and runs cargo nextest run. Plain cargo test ignores the nextest.toml
cluster test-group that serialises 3-node integration tests and would
hang on the cluster suite. JUnit output is uploaded as an artifact on
every run for post-mortem analysis.
Docs: getting-started gains a prebuilt binary install section for
Linux (x64 and arm64), plain docker run instructions alongside the
existing Compose block, a systemd unit example, and a unified
configuration reference that applies to all install methods.
README test command updated to reflect nextest.
This guide walks you through starting a NodeDB server and running your first queries.
3
+
This guide walks you through starting a NodeDB server and running your first queries. NodeDB requires Linux kernel ≥ 5.1 (for io_uring) regardless of how you run it.
4
4
5
-
## Run with Docker (recommended)
5
+
There are three ways to install NodeDB:
6
6
7
-
The fastest way to get started. Requires Linux kernel ≥ 5.1 (for io_uring).
7
+
1.[Prebuilt binary](#run-a-prebuilt-binary-linux) — **recommended on Linux.** Direct kernel access to io_uring, no virtualization overhead, best raw performance.
8
+
2.[Docker](#run-with-docker) — **recommended on macOS / Windows / WSL2**, or when you want a one-command setup with zero host configuration.
9
+
3.[Build from source](#build-from-source) — for development or custom features.
10
+
11
+
All three share the same [configuration](#configuration), [connection](#connect), and [query](#first-queries) sections below.
12
+
13
+
## Run with Docker
14
+
15
+
The easiest way to get started, and the right choice on macOS, Windows, or any host where you don't want to manage a binary directly. On native Linux, the [prebuilt binary](#run-a-prebuilt-binary-linux) gives you better performance.
16
+
17
+
### Docker Compose
8
18
9
19
```bash
10
20
docker compose up -d
@@ -24,6 +34,22 @@ To stop and wipe all data:
24
34
docker compose down -v
25
35
```
26
36
37
+
### Plain `docker run`
38
+
39
+
If you'd rather not use Compose:
40
+
41
+
```bash
42
+
docker run -d --name nodedb \
43
+
-p 6432:6432 \
44
+
-p 6433:6433 \
45
+
-p 6480:6480 \
46
+
-p 9090:9090 \
47
+
-v nodedb-data:/var/lib/nodedb \
48
+
farhansyah/nodedb
49
+
```
50
+
51
+
The container entrypoint runs as root just long enough to fix ownership on the data volume, then drops privileges to the `nodedb` user (uid 10001). To skip the root step, pass `--user 10001:10001` and pre-create the volume with matching ownership.
52
+
27
53
### Default ports
28
54
29
55
-**6432** — PostgreSQL wire protocol (pgwire)
@@ -61,6 +87,70 @@ Set them under `environment:` in `docker-compose.yml` or pass with `-e` to `dock
61
87
62
88
---
63
89
90
+
## Run a prebuilt binary (Linux)
91
+
92
+
Each tagged release ships a static `nodedb` tarball on GitHub for `linux-x64` and `linux-arm64`. macOS and Windows users should use Docker until those targets ship.
Then `sudo systemctl enable --now nodedb`. The user/group must be able to read the config file and write `data_dir`.
149
+
150
+
> For a specific version or to browse changelogs, see the release page: <https://github.com/NodeDB-Lab/nodedb/releases>. The SQL surface is still pre-1.0 and changes between tags, so pin a version in production.
151
+
152
+
---
153
+
64
154
## Build from Source
65
155
66
156
```bash
@@ -70,8 +160,9 @@ cd nodedb
70
160
# Release build (all crates)
71
161
cargo build --release
72
162
73
-
# Run tests
74
-
cargo test --all-features
163
+
# Run tests (use nextest — see .config/nextest.toml)
164
+
cargo install cargo-nextest --locked # one-time
165
+
cargo nextest run --all-features
75
166
```
76
167
77
168
Requires Rust 1.94+ and Linux (the Data Plane uses io_uring). The build produces two binaries:
@@ -84,8 +175,22 @@ Requires Rust 1.94+ and Linux (the Data Plane uses io_uring). The build produces
84
175
```bash
85
176
# Single-node, default ports
86
177
./target/release/nodedb
178
+
179
+
# Or with a config file
180
+
./target/release/nodedb --config nodedb.toml
87
181
```
88
182
183
+
---
184
+
185
+
## Configuration
186
+
187
+
This section applies to **every** install method — Docker, prebuilt binary, and source builds all read the same TOML schema and respond to the same environment variables. Pick whichever is convenient:
188
+
189
+
- **TOML file** — pass `--config /path/to/nodedb.toml` on the command line. Best for production / systemd / pre-baked images.
190
+
- **Environment variables** — prefix `NODEDB_*`. Best for Docker (`-e`), Compose (`environment:`), and Kubernetes. Env vars **override** values from the TOML file when both are set.
191
+
192
+
### Default ports
193
+
89
194
By default, NodeDB listens on:
90
195
91
196
- **6432** — PostgreSQL wire protocol (pgwire)
@@ -98,11 +203,11 @@ Two additional protocols are available but **disabled by default**:
0 commit comments