Skip to content

Installing BadgerDaemon

BadgerDaemon is the node agent that manages Docker containers for game servers. It runs as a single Go binary on each server (bare-metal or VPS) that you want to use for hosting game servers.

Prerequisites

System Requirements

RequirementMinimumRecommended
CPU2 cores4+ cores (depends on number of game servers)
RAM2 GB + game server RAMAs much as your servers need
Disk20 GB SSD + game server storageNVMe SSD recommended
OSUbuntu 20.04+ / Debian 11+ / RHEL 8+Ubuntu 22.04 LTS
Architectureamd64, arm64, or armv7amd64

Resource Planning

The daemon itself uses very little resources (< 100 MB RAM, negligible CPU). The majority of resources on the node are consumed by game server containers. Plan your node's RAM and CPU based on how many game servers you intend to host.

Software Requirements

  • Docker 24.0+ (required for running game server containers)
  • systemd (for running the daemon as a service)
  • curl or wget (for the installation script)

Network Requirements

  • Outbound HTTPS (443) to your panel URL (for the WebSocket connection)
  • Inbound TCP/UDP on the port range you assign for game servers (e.g., 25565-25665)
  • Inbound TCP 2022 (default SFTP port, configurable)

Installing Docker

bash
curl -fsSL https://get.docker.com | bash

# Verify Docker is running
systemctl status docker
docker --version

Step 1: Register the Node in the Panel

Before installing the daemon, you need to register the node in your BadgerPanel admin area.

  1. Log into your panel as an administrator
  2. Navigate to Admin > Nodes
  3. Click Create Node
  4. Fill in the node details:
FieldDescriptionExample
NameDisplay name for this nodeUS-East-1
FQDNFully qualified domain name or IP of the nodenode1.your-domain.com
MemoryTotal memory available for game servers (MB)16384
DiskTotal disk space available for game servers (MB)100000
Memory OverallocatePercentage to overallocate memory (0 = none)0
Disk OverallocatePercentage to overallocate disk (0 = none)0
  1. After creating the node, you will see an Installation tab with a generated installation command

Step 2: Configure Allocations

Allocations are IP:port pairs that game servers can bind to. You need to create allocations before servers can be deployed on this node.

  1. On the node's detail page, go to the Allocations tab
  2. Click Create Allocation
  3. Enter the IP address and port range:
FieldDescriptionExample
IP AddressThe public IP of the node203.0.113.10
Port RangeRange of ports to allocate25565-25665

Port Ranges

Create a range large enough for the number of servers you plan to host. Each game server needs at least one allocation. Some games require additional ports (e.g., Minecraft query port, RCON port).

Step 3: Install the Daemon

Option A: One-Command Installation Script

The panel generates a ready-to-run installation command. Copy it from the node's Installation tab in the admin panel:

bash
# Example installation command (your token will be different)
curl -sSL https://panel.your-domain.com/api/v1/nodes/install/<node-id> | bash -s -- --token <auth-token>

The installation script will:

  1. Download the correct daemon binary for your system architecture
  2. Place it at /usr/local/bin/badgerdaemon
  3. Create the configuration file at /etc/badgerdaemon/config.yml
  4. Create a systemd service unit
  5. Start the daemon and enable it to start on boot

Option B: Manual Installation

If you prefer to install manually:

1. Download the Binary

Download the daemon binary from your panel. The panel compiles daemon binaries for multiple architectures:

bash
# Determine your architecture
uname -m
# x86_64 = amd64, aarch64 = arm64, armv7l = arm

# Download from your panel
curl -o /usr/local/bin/badgerdaemon \
  "https://panel.your-domain.com/api/v1/daemon/download?arch=amd64"

chmod +x /usr/local/bin/badgerdaemon

2. Create the Configuration

bash
mkdir -p /etc/badgerdaemon

Create /etc/badgerdaemon/config.yml:

yaml
# BadgerDaemon Configuration
panel_url: "https://panel.your-domain.com"
token: "your-node-authentication-token"

# Data directory for server files
data_directory: "/var/lib/badgerdaemon/servers"

# SFTP configuration
sftp:
  enabled: true
  port: 2022
  bind_address: "0.0.0.0"

# Docker configuration
docker:
  socket: "/var/run/docker.sock"
  network: "badgerpanel"

# Logging
log:
  level: "info"  # debug, info, warn, error
  file: "/var/log/badgerdaemon/daemon.log"

3. Create Data Directories

bash
mkdir -p /var/lib/badgerdaemon/servers
mkdir -p /var/log/badgerdaemon

4. Create the Systemd Service

Create /etc/systemd/system/badgerdaemon.service:

ini
[Unit]
Description=BadgerDaemon - Game Server Node Agent
After=docker.service
Requires=docker.service

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/badgerdaemon --config /etc/badgerdaemon/config.yml
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

5. Start the Service

bash
systemctl daemon-reload
systemctl enable badgerdaemon
systemctl start badgerdaemon

Step 4: Verify the Connection

Check the Service Status

bash
systemctl status badgerdaemon

You should see active (running).

Check Daemon Logs

bash
journalctl -u badgerdaemon --tail 20

Look for messages indicating a successful connection to the panel.

Verify in the Panel

In the admin dashboard, navigate to Admin > Nodes. Your node should show a green status indicator indicating it is connected and online.

The node detail page will show:

  • Connection status (online/offline)
  • Daemon version
  • System statistics (CPU, memory, disk usage)
  • Number of active servers

Step 5: Firewall Configuration

Ensure the following ports are accessible:

bash
# UFW (Ubuntu)
sudo ufw allow 2022/tcp                    # SFTP
sudo ufw allow 25565:25665/tcp             # Game server ports (adjust range)
sudo ufw allow 25565:25665/udp             # Some games use UDP

# firewalld (RHEL/CentOS)
sudo firewall-cmd --permanent --add-port=2022/tcp
sudo firewall-cmd --permanent --add-port=25565-25665/tcp
sudo firewall-cmd --permanent --add-port=25565-25665/udp
sudo firewall-cmd --reload

Outbound Connections

The daemon needs outbound HTTPS access to your panel URL. Ensure your firewall allows outbound connections on port 443.

Troubleshooting Installation

Daemon Won't Start

bash
# Check the logs for error details
journalctl -u badgerdaemon --tail 50

# Verify the binary is executable
ls -la /usr/local/bin/badgerdaemon

# Verify the config file exists and is valid
cat /etc/badgerdaemon/config.yml

# Verify Docker is running
systemctl status docker

Daemon Shows Offline in Panel

  • Verify the panel_url in the config points to your panel's correct URL
  • Verify the token matches the one generated by the panel
  • Check that the daemon node can reach the panel: curl -I https://panel.your-domain.com
  • Check for TLS certificate issues: curl -v https://panel.your-domain.com 2>&1 | grep SSL

Docker Permission Issues

The daemon needs access to the Docker socket. If running as a non-root user, add the user to the docker group:

bash
usermod -aG docker badgerdaemon
systemctl restart badgerdaemon

Running as Root

For simplicity, the daemon is typically run as root since it needs to manage Docker containers and bind to privileged ports. The game server containers themselves run with limited permissions inside Docker.

Next Steps

BadgerPanel Documentation