- Create an AWS EC2 Instance with Ubuntu AMI.
- SSH into the EC2 instance.
- Install fnm :
curl -fsSL https://fnm.vercel.app/install | bash
- Select a Node version to install. For example :
fnm use 20
(Will install Node v20) - Install pnpm:
npm i -g pnpm
and setup :pnpm setup
- Clone your backend into EC2.
- Install
pm2
:pnpm i -g pm2
. - Install project depedencies:
pnpm install --frozen-lockfile
- Put Environment Variables in
.env
. - If you have a domain for the API, go to manage DNS records and create an A record with value as the EC2 Public IP.