Enabling Auto Restart
You configure Auto Restart in your application’s configuration file. If you don’t have one yet, create a file namedvirtuscloud.app or virtuscloud.config in the root directory of your project.
Open your configuration file
Create or open your
virtuscloud.app or virtuscloud.config file in the root of your project. This file controls runtime settings for your application on the platform.Learn about the configuration file
The
virtuscloud.app file defines your application’s name, description, version, entry point, memory allocation, and feature flags — including Auto Restart.Locate or add the AUTORESTART parameter
Search the file for an existing
AUTORESTART entry. If it’s not there, add it on a new line. The parameter must appear in the root of the file, not nested inside another block.Set the value to true
Set
AUTORESTART=true to activate the feature. Your configuration file should include the following line:virtuscloud.app
How Auto Restart Works
When Auto Restart is enabled, the platform monitors your running application continuously. If the process exits, the system runs through a series of validation checks before deciding whether to restart. All conditions must pass for a restart to occur.Application goes down
Your application’s process exits or becomes unresponsive. The platform detects the exit event and checks whether
AUTORESTART=true is set in your configuration file. If it is, the restart evaluation begins.Uptime verification
The platform checks how long your application was running before it exited. If the uptime was greater than 60 seconds, the evaluation continues. Applications that crash almost immediately are considered to have a configuration or code error — restarting them in a tight loop would consume resources without resolving the underlying issue.
Exit status verification
The platform inspects the process exit code. If the exit status is 1 (a general runtime error), the evaluation continues. A status of 0 typically means the process exited cleanly and intentionally, so no restart is needed.
Recent restart verification
The platform checks whether the application was already restarted within the last 60 minutes. If it has not restarted recently, the evaluation continues. This cooldown prevents a crash-loop from hammering your application and consuming your resource allocation.
Exception log verification
The platform scans the application’s recent log output for known unrecoverable error patterns. If any of the excluded errors are detected, the restart is cancelled — because restarting won’t fix a syntax error or a missing dependency. The excluded patterns are:
Best Practices
Following these practices helps you get the most value out of Auto Restart while avoiding false negatives where the feature declines to restart a genuinely recoverable failure:Review your logs after every restart
Review your logs after every restart
Each time Auto Restart triggers, open the Logs panel in the dashboard and read the output from the previous session. Recurring restarts usually signal an underlying problem — a memory leak, an unhandled promise rejection, or a third-party API that returns unexpected data. Addressing the root cause is always better than relying on Auto Restart indefinitely.
Keep your MAIN and MEMORY parameters accurate
Keep your MAIN and MEMORY parameters accurate
Auto Restart can only save your application from recoverable runtime errors. If your
MAIN file path is wrong or your MEMORY value is too low for your actual workload, the application will keep crashing in ways that may not trigger a restart. Review both parameters whenever you update your project structure or increase its complexity.Fix excluded errors before relying on Auto Restart
Fix excluded errors before relying on Auto Restart
If your logs contain a
SyntaxError, MODULE_NOT_FOUND, or INVALID_DEPENDENCY message, Auto Restart will never fire — by design. Fix the code or dependency error first, redeploy, and then Auto Restart will be active for genuine runtime failures.Don't use Auto Restart as a substitute for proper error handling
Don't use Auto Restart as a substitute for proper error handling
Auto Restart is a safety net, not a primary reliability strategy. Wrap critical async operations in try/catch blocks, use process-level
uncaughtException and unhandledRejection handlers in Node.js, and add proper exception handling in Python to ensure your application recovers gracefully from expected edge cases without needing a full restart.