Daemon Configuration
BadgerDaemon is configured through a YAML file located at /etc/badgerdaemon/config.yml. This file is generated during installation but can be modified for advanced configurations.
Restart Required
After changing the configuration file, restart the daemon for changes to take effect:
systemctl restart badgerdaemonConfiguration File
The default configuration file location is /etc/badgerdaemon/config.yml. You can specify a different path using the --config flag:
badgerdaemon --config /path/to/config.ymlFull Configuration Reference
# ===========================================
# BadgerDaemon Configuration
# ===========================================
# Panel connection settings
panel_url: "https://panel.your-domain.com"
token: "your-node-authentication-token"
# Data directory where server files are stored
# Each server gets a subdirectory: <data_directory>/<server-uuid>/
data_directory: "/var/lib/badgerdaemon/servers"
# Temporary directory for installations, transfers, etc.
tmp_directory: "/tmp/badgerdaemon"
# ===========================================
# SFTP Configuration
# ===========================================
sftp:
# Enable or disable the built-in SFTP server
enabled: true
# Port to listen on
port: 2022
# Address to bind to (0.0.0.0 for all interfaces)
bind_address: "0.0.0.0"
# ===========================================
# Docker Configuration
# ===========================================
docker:
# Path to the Docker socket
socket: "/var/run/docker.sock"
# Docker network name for game server containers
network: "badgerpanel"
# Container stop timeout in seconds (SIGTERM, then SIGKILL)
stop_timeout: 30
# Maximum log size per container before rotation
log_max_size: "10m"
# Number of rotated log files to keep
log_max_files: 3
# ===========================================
# Resource Monitoring
# ===========================================
monitoring:
# Interval for reporting system stats to the panel (in seconds)
stats_interval: 15
# Interval for checking container resource usage (in seconds)
container_stats_interval: 5
# Disk usage check interval (in seconds)
# Disk checks are more expensive, so this runs less frequently
disk_check_interval: 60
# ===========================================
# Server Management
# ===========================================
servers:
# Automatically restart crashed containers
crash_detection: true
# Number of crashes within the window before giving up
crash_limit: 3
# Time window for crash detection (in seconds)
# If <crash_limit> crashes happen within this window, auto-restart stops
crash_window: 600
# Delay before restarting a crashed container (in seconds)
crash_restart_delay: 5
# ===========================================
# Logging
# ===========================================
log:
# Log level: debug, info, warn, error
level: "info"
# Log file path (leave empty for stdout only)
file: "/var/log/badgerdaemon/daemon.log"
# Maximum log file size before rotation (e.g., "50m", "1g")
max_size: "50m"
# Number of rotated log files to keep
max_backups: 5Configuration Options
Panel Connection
| Option | Description | Default |
|---|---|---|
panel_url | Full URL of your BadgerPanel instance | Required |
token | Authentication token generated by the panel | Required |
The panel_url must be reachable from the daemon node over HTTPS. The token is generated when you create the node in the admin panel and can be regenerated from the node's settings page.
Token Security
The authentication token provides full control over the daemon. Keep it secret and never commit it to version control. If compromised, regenerate it immediately from the panel admin area.
Data Directory
| Option | Description | Default |
|---|---|---|
data_directory | Root directory for server files | /var/lib/badgerdaemon/servers |
tmp_directory | Temporary directory for operations | /tmp/badgerdaemon |
Each game server's files are stored in a subdirectory named by the server's UUID:
/var/lib/badgerdaemon/servers/
├── a1b2c3d4-e5f6-7890-abcd-ef1234567890/
│ ├── server.jar
│ ├── server.properties
│ └── world/
├── b2c3d4e5-f6a7-8901-bcde-f12345678901/
│ └── ...Storage Considerations
Use fast SSD storage for the data directory. Game servers benefit significantly from low-latency I/O, especially games like Minecraft that perform frequent disk reads/writes.
SFTP Configuration
| Option | Description | Default |
|---|---|---|
sftp.enabled | Enable the built-in SFTP server | true |
sftp.port | Port for SFTP connections | 2022 |
sftp.bind_address | Address to bind the SFTP server | 0.0.0.0 |
Users connect to SFTP using their panel credentials. The SFTP server scopes each user to their server's data directory, preventing access to other servers or the host filesystem.
SFTP connection details for users:
- Host: Your node's IP or FQDN
- Port: 2022 (or your configured port)
- Username: Panel email address
- Password: Panel account password
Docker Configuration
| Option | Description | Default |
|---|---|---|
docker.socket | Path to the Docker daemon socket | /var/run/docker.sock |
docker.network | Docker network for game server containers | badgerpanel |
docker.stop_timeout | Seconds to wait for graceful shutdown before SIGKILL | 30 |
docker.log_max_size | Maximum container log size before rotation | 10m |
docker.log_max_files | Number of rotated log files to retain | 3 |
Docker Network
The daemon creates a Docker bridge network for game server containers. This provides network isolation between containers while allowing outbound internet access for downloads and updates.
Resource Monitoring
| Option | Description | Default |
|---|---|---|
monitoring.stats_interval | How often to report system stats to the panel (seconds) | 15 |
monitoring.container_stats_interval | How often to check per-container resource usage (seconds) | 5 |
monitoring.disk_check_interval | How often to check disk usage (seconds) | 60 |
These intervals affect:
- How frequently the panel receives updated system statistics
- How quickly resource limit violations are detected
- How much overhead monitoring adds to the node
Crash Detection
| Option | Description | Default |
|---|---|---|
servers.crash_detection | Enable automatic restart of crashed containers | true |
servers.crash_limit | Maximum restarts within the crash window | 3 |
servers.crash_window | Time window for counting crashes (seconds) | 600 |
servers.crash_restart_delay | Delay before restarting a crashed container (seconds) | 5 |
When a game server container exits unexpectedly, the daemon will automatically restart it. If the server crashes more than crash_limit times within crash_window seconds, the daemon stops restarting and marks the server as crashed. This prevents infinite restart loops.
Logging
| Option | Description | Default |
|---|---|---|
log.level | Minimum log level to output | info |
log.file | Path to the log file (empty for stdout only) | /var/log/badgerdaemon/daemon.log |
log.max_size | Maximum log file size before rotation | 50m |
log.max_backups | Number of rotated log files to keep | 5 |
Log levels:
| Level | Description |
|---|---|
debug | Verbose output for development and troubleshooting |
info | Standard operational messages |
warn | Potential issues that do not prevent operation |
error | Errors that may affect functionality |
Debug Logging
Setting log.level to debug produces a large volume of output and may affect performance on busy nodes. Only use debug logging temporarily when troubleshooting specific issues.
Viewing Logs
Since the daemon runs as a systemd service, you can view logs through journalctl:
# Follow logs in real-time
journalctl -u badgerdaemon -f
# View the last 100 lines
journalctl -u badgerdaemon --tail 100
# View logs from the last hour
journalctl -u badgerdaemon --since "1 hour ago"
# View only errors
journalctl -u badgerdaemon -p errIf a log file is configured, you can also read it directly:
tail -f /var/log/badgerdaemon/daemon.logCommand-Line Flags
The daemon binary supports the following command-line flags:
badgerdaemon --help| Flag | Description | Default |
|---|---|---|
--config | Path to configuration file | /etc/badgerdaemon/config.yml |
--version | Print version and exit | -- |
--debug | Override log level to debug | -- |
Next Steps
- Installing the Daemon -- Installation guide
- Upgrading the Daemon -- How to update the daemon
- Troubleshooting -- Common issues and solutions