- To run the Backend locally on Port
8080
and8081
cd Backend
npm install && npm run server
cd..
- Create an EC-2 instance in Aws on Ubuntu 18.
- Associate it with an Elastic IP.
- Clone your App.
- Install Dependencies on Server.
cd Backend
sudo npm i pm2 -g
pm2 start server.js
pm2 startup ubuntu
- You should now be able to access your app using your IP and port. Now we want to setup a firewall blocking that port and setup NGINX as a reverse proxy so we can access it directly using port 80 (http)
sudo ufw enable
sudo ufw status
sudo ufw allow ssh (Port 22)
sudo ufw allow http (Port 80)
sudo ufw allow https (Port 443)
sudo apt install nginx
sudo nano /etc/nginx/sites-available/default
- The Comments should be sufficient to guide you.
# Check NGINX config
sudo nginx -t
# Restart NGINX
sudo service nginx restart
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
# Only valid for 90 days, test the renewal process with
certbot renew --dry-run
- To run the Frontend locally on Port
3000
cd Frontend
yarn install && yarn start
- To Deploy on Netlify
npm run build
npm install netlify-cli -g
netlify login
netlify deploy --dir=public --prod