How to Enable and Verify Discloud's Automatic Bot Restart Feature
Discloud's automatic restart feature restarts your bot when it exits with a non-zero status code. Learn how to enable it, set delays, and verify it's working correctly.
08 Jul 2026, 02:20 UTC

Problem: Keeping Your Discord Bot Running Without Manual Intervention
If your Discord bot crashes or exits unexpectedly, you lose functionality and user trust. Discloud offers automatic restart capability to maintain uptime, but it must be configured correctly to work reliably.
Prerequisites
- Active Discloud account with at least one deployed bot
- Access to the Discloud dashboard with edit permissions
- Basic understanding of your bot's exit codes and resource usage
Enabling Automatic Restart
- Navigate to your bot's configuration page in the Discloud dashboard. Locate the "Process Management" or "Auto-Restart" section.
- Toggle the restart option to enabled. This tells Discloud to monitor the bot process and restart it when it exits with a non-zero status code.
- Set an appropriate restart delay. The default is typically 5 seconds. Use a longer delay (10-30 seconds) if you need time to capture crash logs before the process restarts.
- Save your configuration. Changes take effect immediately for new process starts.
Understanding the Restart Mechanism
Discloud monitors your bot container through two methods:
- Exit code monitoring: When the container exits with status 0, Discloud assumes a clean shutdown and does not restart. Non-zero exit codes trigger an automatic restart after the configured delay.
- Heartbeat pings: If your bot stops responding to health checks for the configured timeout (typically 60 seconds), Discloud terminates and restarts the process.
Resource Limits and Restart Behavior
Important: Discloud enforces resource limits. A bot that consistently exceeds CPU or memory caps may be throttled rather than restarted. Check your bot's resource usage in the dashboard to ensure it stays within allocated limits.
Expected Checks After Configuration
- Verify the restart status column in your bot's dashboard listing. It should show "Enabled" with your configured delay value.
- Simulate a crash by sending a SIGTERM or SIGKILL signal to the process (use the dashboard's restart button or kill command). The process should automatically restart after your delay period.
- Check log files for entries showing "Process terminated" followed by "Process started" with timestamps matching your configuration.
Monitoring Automatic Restarts
Visit the bot's status page in the Discloud dashboard. The "Restart" column displays recent automatic restarts with timestamps. Each entry shows whether it was triggered by an exit code or heartbeat timeout.
Common Pitfalls and Mitigation
- Too short restart delay: Set delays long enough (10+ seconds) to capture meaningful log output before the process restarts and overwrites previous logs.
- Discord rate limiting: Excessive restarts can trigger Discord's rate limits. If your bot crashes frequently, investigate the root cause rather than relying on automatic restarts.
- Free tier limitations: Discloud's free tier imposes a maximum number of restarts per hour. Monitor your usage and consider upgrading if you need higher reliability.
Recovery Options
If automatic restarts fail or your bot enters a crash loop:
- Check the bot's logs for error patterns indicating why it's exiting
- Verify resource usage stays within limits
- Manually restart via the dashboard to confirm the process can start successfully
- Disable auto-restart temporarily to prevent restart loops while troubleshooting
Verification Summary
After enabling auto-restart, confirm it works by checking: (1) the dashboard shows "Restart: Enabled" with correct delay, (2) logs show "Process terminated" and "Process started" sequences after a crash, and (3) the restart status column in your bot listing shows recent automatic restarts with timestamps.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.