Skip to main content

⚙️ CLI Tutorial: Start/Stop Environments

The platform's command line interface (CLI) allows you to perform various actions easily, including starting and stopping environments. This functionality is especially useful for development and testing environments, where temporarily shutting down can generate significant savings.


🛑 Stopping an Environment

To stop an environment that will not be used for a period (e.g., overnight), use the following command:


~/jelastic/environment/control/stopenv --envName NOME_DO_AMBIENTE

If the operation is successful, the following response will be displayed:


"result": 0

This indicates that the environment was stopped without errors.


▶️ Starting an Environment

To reactivate the environment later, use:


~/jelastic/environment/control/startenv --envName NOME_DO_AMBIENTE

Once started, the environment will be available for use again.


💡 Automation Tip

These commands can be used within scheduled scripts, such as a cronjob on Linux, to automate routines (e.g., shut down environments at 10 PM and start them at 8 AM).


✅ Conclusion

Managing environments via CLI is simple and efficient, allowing full control of the infrastructure in an automated and cost-effective way.