Architecture Overview
The daemon implements a daemon-per-node architecture:- API Server (Hono + PostgreSQL) - Central control plane
- Web Panel (Next.js 15) - Real-time dashboard
- Daemon Nodes (Rust) - One per physical server, manages Docker containers
- Database (PostgreSQL) - Single source of truth
- Manages Docker containers for game servers
- Provides SFTP access for file management
- Streams real-time console output via WebSocket
- Reports resource usage to the API
- Handles backups and archives
Prerequisites
Before installing the daemon:- Docker 20.10+ installed and running
- Rust 1.70+ (for building from source)
- Linux or macOS (Windows via WSL2)
- Port 8080 available (configurable)
- Port 2022 available for SFTP (configurable)
Installation
Option 1: Binary Release (Recommended)
Download the pre-built binary for your platform:Option 2: Build from Source
Clone and build the daemon:Configuration
The daemon uses a TOML configuration file. Create/etc/stellar-daemon/config.toml:
Configuration Reference
API Section
| Option | Type | Default | Description |
|---|---|---|---|
host | string | 0.0.0.0 | Address to bind HTTP server |
port | integer | 8080 | Port for API endpoints |
upload_limit | integer | 100 | Max upload size in MB |
trusted_proxies | array | [] | IP addresses of trusted reverse proxies |
System Section
| Option | Type | Default | Description |
|---|---|---|---|
root_directory | string | .stellar | Root data directory |
data_directory | string | .stellar/volumes | Server volume mounts |
backup_directory | string | .stellar/backups | Backup storage |
archive_directory | string | .stellar/archives | Transfer archives |
tmp_directory | string | .stellar/tmp | Temporary files |
log_directory | string | .stellar/logs | Daemon logs |
username | string | stellar | User for file ownership |
timezone | string | UTC | Timezone for scheduling |
disk_check_interval | integer | 60 | Disk usage check interval (seconds) |
Docker Section
| Option | Type | Default | Description |
|---|---|---|---|
socket | string | Auto-detected | Docker socket path |
tmpfs_size | integer | 100 | Tmpfs mount size in MB |
container_pid_limit | integer | 512 | Max processes per container |
dns | array | ["1.1.1.1", "1.0.0.1"] | DNS servers for containers |
Remote Section
| Option | Type | Required | Description |
|---|---|---|---|
url | string | Yes | API server URL |
token_id | string | Yes | Node token ID from panel |
token | string | Yes | Node authentication token |
timeout | integer | No | Request timeout in seconds |
Running the Daemon
Manual Start
Run the daemon with your config file:Systemd Service
Create/etc/systemd/system/stellar-daemon.service:
Node Registration
Before the daemon can communicate with the panel:- Navigate to Admin → Nodes in the panel
- Click Create Node
- Fill in node details:
- Name: Descriptive name (e.g., “US-East-1”)
- FQDN: Daemon’s public hostname
- Port: Daemon API port (default 8080)
- Protocol: HTTP or HTTPS
- Location: Logical grouping
- Copy the generated Token ID and Token
- Add them to your daemon’s
config.tomlunder[remote] - Restart the daemon
Diagnostics
Run the built-in diagnostics:- Docker connectivity
- Network configuration
- File permissions
- API connectivity
- Configuration validity
Troubleshooting
Daemon won’t start
Check Docker socket permissions:Cannot connect to API
Test connectivity:Containers not starting
Check Docker logs:Security Considerations
Dropped Capabilities
For security hardening, the daemon drops these Linux capabilities from containers:SETPCAP,MKNOD,AUDIT_WRITENET_RAW,DAC_OVERRIDE,FOWNERSYS_ADMIN,SYS_MODULE,SYS_BOOT- And 20+ more (see source code)
Next Steps
Docker Configuration
Deep dive into container settings
Custom Domains
Set up custom domains for servers