Running nohub#

Tip

This page describes how to run a nohub instance. If you just want to experiment, you can use the public instance at foxssake.studio:12980.

Using Docker#

A docker image is regularly published from the main branch.

To run the nohub docker image, make sure to expose the necessary ports:

docker run -p 9980:9980 -p 9981:9981 ghcr.io/foxssake/nohub:main

This exposes port 9980 for clients to connect on, and port 9981 to serve metrics.

Docker Compose#

It is possible to run nohub in conjunction with other services using Docker Compose:

services:
  nohub:
    image: ghcr.io/foxssake/nohub:main
    ports:
      - "9980:9980"  # TCP port for client connections
      - "9981:9981"  # Metrics port (Prometheus)
    environment:
      # See the Server guide for more details:
      # https://foxssake.github.io/nohub/server-guide/configuration.html
      #
      # TCP Configuration
      - NOHUB_TCP_HOST=*
      - NOHUB_TCP_PORT=9980
      
      # Metrics Configuration
      - NOHUB_METRICS_ENABLED=true
      - NOHUB_METRICS_HOST=0.0.0.0
      - NOHUB_METRICS_PORT=9981
      
      # Logging
      - NOHUB_LOG_LEVEL=info
      
      # Lobby Configuration
      - NOHUB_LOBBIES_MAX_COUNT=32768
      - NOHUB_LOBBIES_MAX_PER_SESSION=4
      - NOHUB_LOBBIES_WITHOUT_GAME=true
      
      # Session Configuration
      - NOHUB_SESSIONS_MAX_COUNT=262144
      - NOHUB_SESSIONS_MAX_PER_ADDRESS=64
    restart: unless-stopped

Using bun#

Alternatively, nohub can be run from source, using the following steps:

  1. Make sure bun is installed on your system

  2. Acquire the nohub source, e.g. by cloning it

  3. Install dependencies

  4. Start nohub

Example commands for Linux:

# Install bun
curl -fsSL https://bun.sh/install | bash

# Clone nohub and enter server directory
git clone https://github.com/foxssake/nohub.git
cd nohub/nohub

# Install dependencies
bun install

# Start nohub
bun .