You can run the server as a normal program. This is handy for trying OpenNodd, for development, or on a machine without Docker.
#Requirements
- Node.js 22.5 or newer, with npm.
- For production: a Postgres server. Without one, OpenNodd uses an embedded Postgres (PGlite) that needs nothing installed.
#Install the nodd command
The nodd command includes the server. There are two ways to get it.
#From a running OpenNodd server
Every server serves its own copy:
npm install -g https://nodd.example.com/opennodd.tgz#From source
You need pnpm 9 as well.
git clone https://github.com/opennodd/opennodd.git
cd opennodd
pnpm install
pnpm build
cd gateway && npm link # puts `nodd` on your PATHOr run it without linking: pnpm --filter opennodd exec node dist/cli.js serve.
#Start the server
nodd serveWith no database set, OpenNodd keeps its data in ./data/pglite, relative to the folder you started it in. Open http://127.0.0.1:7420/app. The first person to sign up becomes the admin.
To use a Postgres server:
export DATABASE_URL=postgres://nodd:a-password@localhost:5432/opennodd
nodd serveOr pass it as an option: nodd serve --db postgres://.... Create the database first; OpenNodd creates its own tables.
Other options: --port 7420, --host 127.0.0.1, --grpc-port 7421. All environment variables in Configuration work here too. For example:
NODD_PUBLIC_URL=https://nodd.example.com NODD_INVITE_ONLY=1 NODD_SECRET_KEY=$(openssl rand -hex 32) nodd serve --host 127.0.0.1Note
Save the NODD_SECRET_KEY you generate, and use the same one every time you start the server.
For HTTPS, put a reverse proxy in front. See Reverse proxy and HTTPS.
#Keep it running (systemd)
Create /etc/systemd/system/opennodd.service. Change the user, the paths and the Environment= lines:
[Unit]
Description=OpenNodd
After=network-online.target
[Service]
User=nodd
WorkingDirectory=/var/lib/opennodd
EnvironmentFile=/etc/opennodd.env
ExecStart=/usr/bin/nodd serve --host 127.0.0.1 --port 7420
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetPut your settings in /etc/opennodd.env, one per line, for example:
DATABASE_URL=postgres://nodd:a-password@localhost:5432/opennodd
NODD_PUBLIC_URL=https://nodd.example.com
NODD_INVITE_ONLY=1
NODD_SECRET_KEY=<your key>Then:
sudo systemctl daemon-reload
sudo systemctl enable --now opennodd
journalctl -u opennodd -fUse which nodd to find the right path for ExecStart.
#Upgrading
Install the new version of the command the same way, then restart the service. Migrations run when the server starts. Back up first. See Backups and upgrading.