SSH into your server
ex) ssh -i ./kp-2023-2-23.pem ubuntu@ec2-3-34-189-211.ap-northeast-2.compute.amazonaws.com
ls -al
sudo chmod 777 [your binary]
700 only me
ls -al (check your binary)
sudo ./[your binary]
possible options
cd /etc/systemd/system
sudo nano hello.service
(place this code inside)
[Unit]
Description=Go Server
[Service]
ExecStart=/home/username/exepath
User=root
Group=root
Restart=always
[Install]
WantedBy=multi-user.target
ctrl + o
ctrl + x
sudo systemctl enable hello.servie
sudo systemctl start hello.service
sudo systemctl status hello.service