Created: 2026/06/30 12:24:02 America/Chicago
By: admin

What This Guide Installs

This guide installs Verlihub from the official Verlihub/verlihub source tree on Ubuntu Server. It compiles the NMDC hub server with CMake, stores hub data under /var/lib/verlihub, uses MariaDB for hub tables, and starts the hub through a systemd service.

Use the Docker article if you want container isolation. Use this Ubuntu article when the hub should run directly on a VPS, dedicated server, or bare-metal machine.

Server Plan Before You Install

  • Choose a public DNS name for the hub, such as hub.example.org.
  • Choose the NMDC port. Port 411/tcp is traditional. Verlihub can bind it safely through systemd without running as root. Port 4111/tcp is a simpler alternate when you do not need the historic port.
  • Decide whether this first install will be plain NMDC only. Add NMDCS after the plain hub is stable.
  • Keep one Linux account for the service: verlihub.
  • Keep one MariaDB database and user: verlihub.
  • Write down the master hub nickname and password before running the wizard.

Install Ubuntu Packages

The official install notes list GCC, CMake, MySQL client libraries, OpenSSL, ICU, Make, ZLib, PCRE, GetText, MaxMindDB, LibIntl, threads, dynamic loading, Lua, and Dialog. On Ubuntu, install the matching packages first.

 sudo apt update
sudo apt install -y \
    build-essential \
    ca-certificates \
    cmake \
    default-libmysqlclient-dev \
    default-mysql-client \
    dialog \
    gettext \
    git \
    libasprintf-dev \
    libicu-dev \
    liblua5.2-dev \
    libmaxminddb-dev \
    libpcre3-dev \
    libssl-dev \
    make \
    mariadb-server \
    pkg-config \
    zlib1g-dev 

Start MariaDB and make sure it comes back after reboot.

 sudo systemctl enable --now mariadb
sudo systemctl status mariadb 

Create The Verlihub Linux User

Run Verlihub as its own unprivileged user. Do not run the hub as root.

 sudo adduser --system --group --home /var/lib/verlihub --shell /bin/bash verlihub
sudo install -d -o verlihub -g verlihub /var/lib/verlihub
sudo install -d -o verlihub -g verlihub /var/log/verlihub 

The verlihub user should own runtime files only. Keep source files under /usr/local/src/verlihub, keep binaries under /usr/local, and keep database administration under MariaDB. The service account needs write access to /var/lib/verlihub and /var/log/verlihub; it does not need sudo access.

Use sudo as the server administrator to install packages, compile the binary, and create the systemd unit. Run the hub process itself as verlihub. This split matters because a hub accepts untrusted public traffic from DC++ clients.

Create The MariaDB Database

Create the database and user before running vh --install. Use a real password instead of the example value.

 sudo mariadb 
 CREATE DATABASE verlihub CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'verlihub'@'localhost' IDENTIFIED BY 'change-this-password';
GRANT ALL PRIVILEGES ON verlihub.* TO 'verlihub'@'localhost';
FLUSH PRIVILEGES;
EXIT; 

Check that the application user can log in.

 mariadb -u verlihub -p verlihub 

Download The Verlihub Source

Build from the official GitHub repository. Keep source files under /usr/local/src so the build tree is separate from hub runtime data.

 sudo install -d -o "$USER" -g "$USER" /usr/local/src/verlihub
git clone https://github.com/Verlihub/verlihub.git /usr/local/src/verlihub
cd /usr/local/src/verlihub 

If you need a specific release or commit, check it out before building. For a first install, build the current upstream branch after reading the repository notes.

Compile And Install Verlihub

The upstream install path uses mkdir build, cmake .., make, make install, and ldconfig. The command below installs Verlihub under /usr/local.

 mkdir -p build
cd build
cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DUSE_TLS_PROXY=OFF \
    -DUSE_FEARTLS_PROXY=OFF
make -j"$(nproc)"
sudo make install
sudo ldconfig 

Keep TLS proxy options off for the first run unless you already have the proxy dependency, certificates, firewall rules, and a test client ready for NMDCS.

Run vh --install

The vh helper writes the Verlihub configuration, creates or updates hub tables, and stores the first hub settings. Run it as the verlihub Linux user so generated files belong to the service account.

 sudo -iu verlihub
vh --install 
Wizard FieldUse This ValueReason
Configuration folder /var/lib/verlihub Owned by the verlihub service user.
Database host localhost MariaDB runs on the same Ubuntu server.
Database name verlihub Matches the database created above.
Database user verlihub Matches the MariaDB user created above.
Database passwordYour MariaDB passwordAllows Verlihub to read and write hub tables.
Hub addressYour public DNS nameThis is the address clients and hublists should publish.
Hub port 411, 4111, or your chosen portMust match systemd, firewall, and router rules.
Master userYour operator nicknameCreates the first account with hub administration access.

If the wizard asks for MariaDB administrator credentials, use the local MariaDB administrator account. On many Ubuntu installs that means running database administration through sudo mariadb instead of a password-based root login.

Test The Hub In The Foreground

Before creating systemd, start the hub once from the terminal and watch the output.

 vh --run /var/lib/verlihub 

Open a second terminal and test the port from another machine if possible. Stop the foreground process with Ctrl+C after the hub starts cleanly.

Run Port 411 Without sudo

Linux normally reserves ports below 1024 for privileged processes. Do not solve that by starting Verlihub with sudo vh --run. Grant the service only the bind capability it needs.

The systemd unit below uses AmbientCapabilities=CAP_NET_BIND_SERVICE and CapabilityBoundingSet=CAP_NET_BIND_SERVICE. That lets the verlihub user bind 411/tcp while the process still runs without root privileges. If you use 4111/tcp, you may remove those two capability lines.

Avoid the global sysctl net.ipv4.ip_unprivileged_port_start=0 for this job. It changes low-port policy for every process on the server. Avoid setcap on the Verlihub binary unless you fully control upgrades, because package or source installs can replace the file and drop the capability.

Create A systemd Service

Create a service file so Ubuntu starts Verlihub after boot, restarts it after a crash, and keeps the runtime user limited to the hub files.

 sudo tee /etc/systemd/system/verlihub.service >/dev/null <<'EOF'
[Unit]
Description=Verlihub NMDC hub server
After=network-online.target mariadb.service
Wants=network-online.target

[Service]
Type=simple
User=verlihub
Group=verlihub
WorkingDirectory=/var/lib/verlihub
ExecStart=/usr/local/bin/vh --run /var/lib/verlihub
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
ReadWritePaths=/var/lib/verlihub /var/log/verlihub
Restart=on-failure
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF 
 sudo systemctl daemon-reload
sudo systemctl enable --now verlihub
sudo systemctl status verlihub
journalctl -u verlihub -f 

Open The Hub Port

If UFW is enabled, open the hub port you configured. Also check the firewall panel at your VPS provider.

 sudo ufw allow 411/tcp comment 'Verlihub NMDC'
# Or, if you configured 4111 instead:
sudo ufw allow 4111/tcp comment 'Verlihub NMDC alternate'
sudo ufw status numbered 

For a home server, forward the same TCP port on the router to the Ubuntu machine. For NMDCS, add the secure port only after TLS is configured and tested.

Verify The Install

CheckCommandWhat To Look For
Service state systemctl status verlihub active (running).
Hub logs journalctl -u verlihub -n 100 No database login errors or port bind errors.
Hub status sudo -iu verlihub vh --status /var/lib/verlihub The helper can read the hub configuration.
Service user systemctl show verlihub -p User -p Group -p NoNewPrivileges The service reports User=verlihub and NoNewPrivileges=yes.
Low-port capability systemctl show verlihub -p AmbientCapabilities -p CapabilityBoundingSet CAP_NET_BIND_SERVICE is present when the hub listens on 411/tcp.
Hub port ss -ltnp | grep -E ':411|:4111' A listening TCP socket on the configured port.
Database backup mariadb-dump -u verlihub -p verlihub > verlihub.sql A dump file exists before you change plugins or upgrade.

Hosting Etiquette For A Public Hub

  • Publish one reachable address. Use the DNS name and port that clients should keep in favorites and hublists. Do not submit temporary IPs, dead redirects, or several names for the same hub unless they serve different protocols.
  • Keep the MOTD useful. List the hub address, secure address when available, rules, registration command, operator contact, and support site. Users should not need to guess how to register or who owns the hub.
  • Do not fake hub stats. Public hublists work best when users, share, protocol, software, and topic match the real hub state.
  • Keep logs private and rotated. Logs are for abuse handling and troubleshooting. Do not publish user IPs, private messages, or registration data in public pages. Configure log rotation before the first busy week.
  • Patch the host. Apply Ubuntu security updates, keep MariaDB supported, and test Verlihub upgrades on a database copy before replacing production binaries.
  • Limit exposed ports. Publicly expose the hub port and any tested secure hub port. Keep MariaDB private. Restrict SSH to administrator IPs when your provider supports it.
  • Set plain rules. State what is banned, how operators handle spam or illegal content, and what happens to bots that flood search or chat.
  • Back up before experiments. Save /var/lib/verlihub and the MariaDB database before changing plugins, Lua scripts, locale settings, or class permissions.

Upgrade And Backup Routine

Back up the database and /var/lib/verlihub before replacing binaries.

 sudo -iu verlihub tar czf /tmp/verlihub-files-$(date +%F).tar.gz /var/lib/verlihub
mariadb-dump -u verlihub -p verlihub > verlihub-db-$(date +%F).sql
cd /usr/local/src/verlihub
git pull
cd build
cmake ..
make -j"$(nproc)"
sudo systemctl stop verlihub
sudo make install
sudo ldconfig
sudo systemctl start verlihub 

Read upstream release notes before upgrading a production hub. If a table layout changes, test the upgrade on a copy of the database first.

Common Problems

  • vh --install cannot connect to MariaDB. Check the database name, user, password, and whether MariaDB is listening locally.
  • The service starts and exits. Read journalctl -u verlihub -n 100. Most first-run failures are database credentials, missing config files, or a port already in use.
  • Clients time out. Check UFW, the VPS firewall, NAT port forwarding, and the Verlihub listen port.
  • Port 411 fails for the verlihub user. Check the systemd capability lines, then run sudo systemctl daemon-reload and sudo systemctl restart verlihub. Do not start the hub with sudo.
  • Chat text is garbled. Match the hub locale, database charset, and client encoding used by your community.
  • NMDCS is not available yet. Build and configure the supported TLS proxy path separately. Plain NMDC should work before secure hub access is added.