How It Works
StellarStack monitors server activity and automatically stops servers that exceed the configured inactivity timeout. The system checks for inactive servers every 60 seconds.Activity Tracking
A server’s activity timer is reset when:- The server transitions to
RUNNINGstatus - A console command is sent to the server
- A power action (start/restart) is performed
The inactivity timer is based on the
lastActivityAt field. If this field is not set, the system falls back to using the server’s updatedAt timestamp.Configuration Levels
Auto-shutdown can be configured at two levels:1. Global Auto-Shutdown
Applies to all servers that haven’t explicitly disabled auto-shutdown.2. Per-Server Auto-Shutdown
Overrides global settings for specific servers.Configuration Priority
Per-server settings take precedence over global settings:autoShutdownEnabled = true
Server will always auto-shutdown after the specified timeout (uses per-server timeout or global timeout as fallback).
autoShutdownEnabled = false
Server will never auto-shutdown, even if global auto-shutdown is enabled.
Configuration Examples
Enable Global Auto-Shutdown
To enable auto-shutdown for all servers by default:Default Timeout
The recommended timeout is 60 minutes for development servers and 30 minutes for test environments.
Per-Server Configuration
Enable for Specific Server
Disable for Specific Server
Exempt a critical server from auto-shutdown:Auto-Shutdown Events
When a server is automatically shut down:1. Plugin Hook (Before)
Theserver:beforeStop hook is triggered:
2. Server Stopped
The server status changes toSTOPPING, then STOPPED.
3. Activity Logged
An activity log entry is created:4. Webhook Dispatched
If you have webhooks configured forserver.auto_shutdown, a notification is sent:
5. Plugin Hook (After)
Theserver:afterStop hook is triggered:
Monitoring Auto-Shutdown
View Activity Logs
Check which servers have been auto-shutdown:Set Up Notifications
Receive Discord/Slack notifications when servers auto-shutdown:Use Cases
Development Servers
Automatically stop development servers after hours:Test Environments
Stop test servers after CI/CD pipelines complete:Staging Servers
Longer timeout for staging that may have intermittent usage:Production Servers
Disable auto-shutdown for always-on production servers:Best Practices
Set Appropriate Timeouts
Development: 30 minutes, Staging: 60-120 minutes, Production: Disabled
Monitor Activity Logs
Review auto-shutdown logs to optimize timeout values and identify usage patterns.
Use Webhooks
Set up notifications to track when servers are automatically stopped.
Exempt Critical Servers
Explicitly disable auto-shutdown for production and critical infrastructure.
Troubleshooting
Server not auto-shutting down
Server not auto-shutting down
Check that:
- Auto-shutdown is enabled (globally or per-server)
- The server has been inactive for longer than the timeout
- The server is in
RUNNINGstatus - The server is not suspended
- The node is online and reachable
Server shuts down too quickly
Server shuts down too quickly
Increase the timeout value. Remember that activity is tracked based on console commands and power actions, not player connections.
Cannot disable auto-shutdown for a server
Cannot disable auto-shutdown for a server
Set
autoShutdownEnabled to false explicitly. Setting it to null will inherit the global setting.Node offline during auto-shutdown
Node offline during auto-shutdown
If the node is offline when auto-shutdown attempts to stop a server, the operation is skipped and logged. The server will remain in
RUNNING status until the node comes back online.Technical Details
Check Interval
The auto-shutdown checker runs every 60 seconds.Source Code Reference
Auto-shutdown logic:apps/api/src/lib/auto-shutdown.ts:76
Activity Updates
ThelastActivityAt timestamp is updated in:
apps/api/src/routes/servers.ts(power actions)apps/api/src/routes/console.ts(console commands)- Server process manager (status transitions)
If your application needs to prevent auto-shutdown, send periodic keepalive commands or implement a custom activity tracking mechanism via the API.