Back
Discord Bots

Keep the bot online (auto-restart)

How Victus keeps your bot running: the panel manages the process and can auto-restart on crash, and Schedules can restart it on a timer. Plus why you should NOT run pm2 inside the container.

auto-restartcrashuptimeschedulespm2always onlinekeep alive

On Victus your bot runs as a supervised process, not a script you leave open in a terminal. The panel daemon watches the process, and you have a few tools to keep it up 24/7. The key mental model: the panel manages the one main process — you should not try to manage it yourself from inside the container.

Crash detection (automatic)

When your bot process exits unexpectedly, the panel detects the crash and can automatically restart it. This handles the common case: an unhandled exception or a transient network blip takes the bot down, and it comes straight back without you touching anything. You will see the restart happen live in the Console.

Crash loops are throttled

If a bot crashes immediately and repeatedly (for example a bad token), the daemon stops auto-restarting to avoid a boot loop. That is a signal to fix the underlying error rather than expecting restarts to paper over it — check the Console and see "View logs and debug a crashing bot".

Scheduled restarts

  1. 1Open the Schedules tab and create a new schedule.
  2. 2Set a cron expression — for example day-of-week/hour/minute for a 4am daily restart.
  3. 3Add a task of type Power with the action Restart.
  4. 4Save and enable the schedule. A nightly restart is a cheap way to clear slow memory leaks and reconnect cleanly.

Do not run pm2, forever, nodemon or systemd inside the container

Process managers fight the panel. The daemon tracks the process it started; if pm2 forks your bot into the background, the panel sees the foreground process exit and marks the server as stopped — while pm2 keeps a zombie running you cannot see or stop from the Console. Just run node/python directly and let the panel supervise.

Write code that survives

  • Handle promise rejections and reconnects rather than letting one error kill the process. discord.js and discord.py both auto-reconnect to the gateway on their own.
  • Do not call process.exit() on a recoverable error — throwing or logging keeps the library in control of reconnection.
  • If you deliberately want the process to end and be restarted, exit with a non-zero code so the panel treats it as a crash and restarts it.

Free bots still need renewal

Auto-restart keeps a running bot alive, but a free plan must still be renewed weekly or it pauses and is eventually deleted regardless of uptime. Paid plans do not have the weekly-renewal requirement.