Actually, I should qualify this.
If you use a PaaS (platform as a service, e.g. Heroku, DO App Platform, AWS EB), they might assume your app to be stateless and do things like restart it at will.
If you use a VPS (virtual private server, e.g. DO Droplet, AWS EC2), this certainly shouldn’t happen, but of course it requires some Linux skills to maintain your VPS.
So it’s basically a trade-off between engineering your app to fit a PaaS or hand-managing your VMs (though the latter is usually the cheaper option).