Guide for new Backend Project setup on Ubuntu VM (AWS/GCP/OCI)
This is my personal guide to quickly get a new Ubuntu Linux based AWS-EC2 instance or any other VM up and running in minutes. I’ve used it on OCI(Oracle Cloud) as well.
Step-1: Create an Ubuntu VM/Instance
Use any Cloud provider. Remember to:
- Open Ports 443, 80 (remove after HTTPS setup)
- Upload public ssh key/ download ssh key pair to login to instance
- Assign a public IP.
Check ufw, iptable etc. and ensure ingress on 443 and 80 is allowed.
This answer helped fix firewall on OCI https://stackoverflow.com/a/54810101/5449226
Verify a port is open, run a python file server. Example command to run on port 80.sudo python3 -m http.server 80
Then jump to <ip>:80
in your browser it should show a directory listing. Remember to close the python server.
Step-2 (optional): Add swap space
Handles abrupt memory spikes and prevents instance from freezing.
https://github.com/leangaurav/docs/blob/main/guides/add_swap_space.md
How much to add ? Probably follow this guide or below table which I copied from here
Step-3: Install Docker
Copy paste command from below github gist. Or use the official doc link mentioned in the gist.
Step-4: Setup github ssh access
Required to clone your private git repositories.
Step-5: Setup Backend with HTTPS