Install — Source

If you prefer to compile the binary yourself — for reproducibility, for a platform without a published Docker image, or because you can't run Docker in your environment — clone the L2 node repository and build with Cargo. The result is a single ogmara-node binary plus a systemd unit that starts it on boot under the ogmara system user created in Server Preparation.

Prerequisite: you've completed Server Preparation (Rust toolchain, build dependencies, the ogmara system user, /etc/ogmara and /var/lib/ogmara/data directories, swap if you only have 2 GB of RAM). The Rust compiler is memory-hungry — without swap on a small VPS the build can OOM-kill halfway through.

Clone and build

If you prefer to compile the binary yourself, clone the repository and build with Cargo.

# Clone the L2 node repository
git clone https://github.com/Ogmara/l2-node.git
cd l2-node

# Build in release mode
cargo build --release

# Copy binary to system path
sudo cp target/release/ogmara-node /usr/local/bin/
sudo chmod +x /usr/local/bin/ogmara-node

Install the systemd unit

Create a systemd service file so the node starts automatically on boot.

# /etc/systemd/system/ogmara-node.service
[Unit]
Description=Ogmara L2 Node
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=ogmara
Group=ogmara
ExecStart=/usr/local/bin/ogmara-node --config /etc/ogmara/ogmara.toml
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
WorkingDirectory=/var/lib/ogmara

# Security hardening
ProtectSystem=strict
ReadWritePaths=/var/lib/ogmara/data /var/log/ogmara
ProtectHome=true
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
# Enable and start the service
sudo systemctl daemon-reload
sudo systemctl enable ogmara-node
sudo systemctl start ogmara-node

Configuration of the four required ogmara.toml blocks (and the testnet ↔ mainnet switch procedure) lives on the dedicated Configuration page — the same page Docker operators use, since the config schema is identical for both install paths.

Start and Verify

After starting the node, check the logs to confirm it is running correctly.

# Check the service status
sudo systemctl status ogmara-node

# View logs (for systemd)
sudo journalctl -u ogmara-node -f

# View logs (for Docker)
docker logs -f ogmara-node

You should see log entries indicating:

  • The API server is listening on port 41721
  • The P2P listener is bound to port 41720
  • Peer discovery is running and connecting to bootstrap nodes
  • The chain scanner has started monitoring Klever for contract events
# Quick health check
curl http://127.0.0.1:41721/api/v1/health

If you get a valid JSON response, your L2 node is up and running. You now have a working Ogmara node on the network.

Back up your node key

Back Up Your Node Key Now!

Your node generated a private key on first startup. This key IS your node's wallet address — it holds KLV funds for anchoring and is your identity on the network. If you ever lose the data directory, this key is gone forever along with any funds on it.

# Export your node's private key to a backup file. Run as the ogmara
# user (it owns the data directory the key lives in) and point at the
# same config the service uses so it finds the right data_dir. Export
# uses a read-only DB open, so it works even while the node is running.
sudo -u ogmara ogmara-node --config /etc/ogmara/ogmara.toml export-key -o /tmp/my-node-key.bak

# Store this file securely (USB drive, password manager, etc.)
# NEVER share it or commit it to git

To restore on a new server or after a data wipe:

# Stop the node first — import needs an exclusive write lock on the DB.
sudo systemctl stop ogmara-node
sudo -u ogmara ogmara-node --config /etc/ogmara/ogmara.toml import-key -i /tmp/my-node-key.bak
sudo systemctl start ogmara-node

Optional production features (state anchoring, on-chain peer discovery, alerts, snapshot sync, peer staleness) and the testnet ↔ mainnet switch procedure have moved to the dedicated Configuration page.

← Server Prep   Next: Configuration →