Server Preparation

Before installing the L2 node, prepare your host: confirm the machine meets the requirements, open the right network ports, install system dependencies, create a dedicated system user and directories, add swap if RAM is tight, and lock the firewall down to only what the node actually needs. This page covers all of that — once done, head to Install — Docker (recommended) or the source-build path on the hub page.

Requirements

  • OS: Debian 13 (Trixie) or Ubuntu 24.04+ recommended
  • CPU: 2+ cores
  • RAM: 2+ GB (4 GB recommended if building from source)
  • Disk: 20+ GB (SSD preferred)
  • Network: Public IP address and a domain name

Ports to Open

  • 41720 UDP+TCP — P2P communication between nodes (required)
  • 80 — HTTP (for Let's Encrypt and redirect to HTTPS)
  • 443 — HTTPS (web frontend, API, push gateway)

Install Dependencies

Update your system and install the build tools needed to compile the L2 node from source. If you plan to use Docker only, you can skip the Rust toolchain.

# Update system packages
sudo apt update && sudo apt upgrade -y

# Install build dependencies
sudo apt install -y build-essential pkg-config libssl-dev \
  curl git unzip

# Install Rust (if building from source)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

# Install Node.js (if deploying web frontend)
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

Create System User and Directories

Run Ogmara under a dedicated system user for security. Never run the node as root.

# Create a system user for Ogmara
sudo useradd -r -m -d /var/lib/ogmara -s /usr/sbin/nologin ogmara

# Create required directories
sudo mkdir -p /var/lib/ogmara/data
sudo mkdir -p /etc/ogmara
sudo mkdir -p /var/log/ogmara

# Set ownership
sudo chown -R ogmara:ogmara /var/lib/ogmara
sudo chown -R ogmara:ogmara /var/log/ogmara

Docker users: the ogmara system user above is harmless extra setup for you — the containerized node runs as your host UID via --user $(id -u):$(id -g) (set in the Install — Docker step), not as the ogmara user. The directories are still useful as the bind-mount targets, but you'll re-chown them to your own UID in the next step. Source-build operators do use the ogmara user (via the systemd unit), so this section stays relevant for both paths.

Add Swap Space (for Compilation)

If your server has only 2 GB of RAM, add swap space before compiling Rust projects. The Rust compiler can use significant memory during builds.

# Create a 2 GB swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Make it permanent
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Firewall Setup

Configure UFW to allow only the ports your node needs.

# Install and enable UFW
sudo apt install -y ufw

# Allow SSH (so you don't lock yourself out)
sudo ufw allow OpenSSH

# Allow Ogmara P2P
sudo ufw allow 41720/tcp
sudo ufw allow 41720/udp

# Allow HTTP and HTTPS
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# Enable the firewall
sudo ufw enable
sudo ufw status

Important: Make sure you allow SSH before enabling UFW. If you skip this, you will lock yourself out of the server.

← Back to Run a Node   Next: Install — Docker →