Search code examples
amazon-web-servicesamazon-ec2serveramazon-systems-manager

AWS System Manager Run Command on EC2 Failes


I'm running a fastapi server on ec2 ubuntu. Everything work fine when I ssh in to ec2 and run commands, but I want the server to be running when my local machine is off. So, I tried AWS System manager's run command. The connection looks fine but when I cd to the server code and run ls it outputs nothing. Also, when I do poetry run python main.py in the server folder, which works totally perfect when I ssh in to the server from my local machine, it says poetry: not found. Why is this happening. And is there another way I can run my server while being able to turn off my local machine.


Solution

  • There is not any kind of relation between your machine and your server in the cloud, and your ec2 its still alive and runs your services whenever you want