Create-React-App AWS EC2 Deployment Auto Restart

When you deploy a React App on an AWS EC2 instance that was created with “create-react-app” is there a way to ensure that the app automatically restarts in the case the app crashes?

I figured out how to deploy the app and have it hosted on an AWS EC2 instance, but kind of afraid if it crashes I have to ssh into the instance over and over again and manually restart the app.

I believe what you are looking for is a process manager that will keep your app running. There are many approaches to running a Node process, but supervisord, systemd or solution like https://pm2.keymetrics.io/ might get what you want.

If its literally Creat React App, the app isn’t started in the first place (it’s an HTML page with some JS used for interaction), so it can’t be restarted. That is done by a user refreshing their browser (and you only need S3 to.host it if is the case that it’s just CRA)

If you mean a Node app, then EC2 should auto-restart it on crash, so you should be fine (you’d need to check this though)

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.