Skip to content

Upgrading BadgerDaemon

This guide covers how to upgrade the BadgerDaemon binary on your game server nodes. Daemon upgrades are typically required when the panel is updated to ensure protocol compatibility.

Version Compatibility

The panel and daemon should always run compatible versions. After upgrading the panel, check if a daemon upgrade is required. The panel admin area shows each node's daemon version and will indicate when an update is available.

Before You Begin

Check Current Version

bash
badgerdaemon --version

Or check in the admin panel under Admin > Nodes -- each node shows its running daemon version.

Plan for Downtime

Upgrading the daemon requires a brief restart. During the restart:

  • Game servers continue running (Docker containers are independent of the daemon process)
  • Console streaming and power actions are temporarily unavailable (typically 5-10 seconds)
  • SFTP connections are disconnected and must reconnect

Active Installations

If any servers are currently being installed, wait for installation to complete before upgrading. Interrupting an installation may leave the server in a broken state.

Upgrade Process

The simplest way to upgrade is to re-run the installation command from the panel. It will detect the existing installation and update the binary in place.

  1. In the panel admin area, navigate to Admin > Nodes
  2. Click on the node you want to upgrade
  3. Go to the Installation tab
  4. Copy the installation command
  5. Run it on the node:
bash
curl -sSL https://panel.your-domain.com/api/v1/nodes/install/<node-id> | bash -s -- --token <auth-token>

The script will:

  1. Download the latest daemon binary from the panel
  2. Stop the daemon service
  3. Replace the binary at /usr/local/bin/badgerdaemon
  4. Restart the daemon service
  5. Preserve your existing configuration

Option B: Manual Upgrade

Step 1: Download the New Binary

bash
# Download the latest binary from your panel
curl -o /tmp/badgerdaemon \
  "https://panel.your-domain.com/api/v1/daemon/download?arch=amd64"

chmod +x /tmp/badgerdaemon

Step 2: Verify the Download

bash
# Check the new version
/tmp/badgerdaemon --version

Step 3: Stop the Daemon

bash
systemctl stop badgerdaemon

Step 4: Replace the Binary

bash
# Back up the old binary (optional)
cp /usr/local/bin/badgerdaemon /usr/local/bin/badgerdaemon.bak

# Install the new binary
mv /tmp/badgerdaemon /usr/local/bin/badgerdaemon

Step 5: Restart the Daemon

bash
systemctl start badgerdaemon

Step 6: Verify

bash
# Check service status
systemctl status badgerdaemon

# Check logs for successful startup
journalctl -u badgerdaemon --tail 20

# Verify version
badgerdaemon --version

Post-Upgrade Verification

After upgrading, verify the following in the panel admin area:

  1. Node status -- The node should show as online (green indicator)
  2. Daemon version -- Should reflect the new version
  3. System stats -- CPU, memory, and disk statistics should be reporting
  4. Server console -- Open a running server's console and verify output is streaming
  5. Power actions -- Test start/stop on a non-production server if possible

Upgrading Multiple Nodes

If you have many daemon nodes to upgrade, you can script the process:

bash
#!/bin/bash
# upgrade-daemons.sh
# Run this on each node, or use SSH to execute remotely

PANEL_URL="https://panel.your-domain.com"
ARCH=$(uname -m)

case $ARCH in
  x86_64) ARCH="amd64" ;;
  aarch64) ARCH="arm64" ;;
  armv7l) ARCH="arm" ;;
esac

echo "Downloading latest daemon binary ($ARCH)..."
curl -o /tmp/badgerdaemon "$PANEL_URL/api/v1/daemon/download?arch=$ARCH"
chmod +x /tmp/badgerdaemon

echo "Stopping daemon..."
systemctl stop badgerdaemon

echo "Replacing binary..."
cp /usr/local/bin/badgerdaemon /usr/local/bin/badgerdaemon.bak
mv /tmp/badgerdaemon /usr/local/bin/badgerdaemon

echo "Starting daemon..."
systemctl start badgerdaemon

echo "Verifying..."
systemctl status badgerdaemon --no-pager
badgerdaemon --version

Parallel Upgrades

It is safe to upgrade multiple daemon nodes simultaneously since they operate independently. However, stagger upgrades if you want to minimize the window where console/SFTP access is unavailable.

Rolling Back

If the new daemon version causes issues:

bash
# Stop the daemon
systemctl stop badgerdaemon

# Restore the backup
cp /usr/local/bin/badgerdaemon.bak /usr/local/bin/badgerdaemon

# Start with the old version
systemctl start badgerdaemon

Panel Compatibility

If you roll back the daemon, ensure the panel version is still compatible with the older daemon version. Check the release notes for minimum required daemon versions.

Troubleshooting Upgrades

Daemon Won't Start After Upgrade

bash
journalctl -u badgerdaemon --tail 50

Common causes:

  • Configuration format changed -- Check if new configuration options are required. Compare your config with the latest example.
  • Permission issues -- Ensure the binary is executable: chmod +x /usr/local/bin/badgerdaemon
  • Architecture mismatch -- Verify you downloaded the correct binary for your system: uname -m

Game Servers Offline After Restart

Game server Docker containers should survive a daemon restart. If servers show as offline:

  1. Check that Docker containers are still running: docker ps
  2. The daemon may need a moment to re-discover existing containers
  3. If containers stopped, start them from the panel using the power button

Next Steps

BadgerPanel Documentation