I have a webserver, an EC2 instance running on AWS based on a bitnami lampstack image. I am using VS Code to connect to it over SSH, using the default/builtin remote connect functionality. This installs something called VS Code Server on the remote machine when I log in (whatever it is) and I can then browse the remote filesystem and edit files as needed.

Occasionally, however, the connection drops and the server becomes unresponsive, meaning that the website is not accessible and I cannot connect to the server, either from VS Code or in any other ways. I have to stop the server in AWS console, boot it again and then can reconnect.

This seems to be happening at random – it is happening even on low usage. The server is a t3a.small EC2 instance – nothing powerful, but should be quite enough considering how simple of a website I am runnning here.

I would be grateful for any advice how to resolve this.