This Is How I Deploy My First NestJS Application into AWS EC2

What is AWS EC2?

Let’s Get Our Hands Dirty

ssh -v -i /Users/jsantos/Downloads/my-nest-application.pem ec2-user@ec2–18–188–20–
  • -v is a flag to show logs when running the command (not required)
  • -i is a flag to specify where the pem key is located (required)
ec2-user@[Public DNS]
  • ec2-user@ is the username for some AWS Linux machines (Amazon Linux 2 or the Amazon Linux AMI). We are using Amazon Linux AMI.
Permissions 0644 for '/Users/jsantos/Downloads/my-nest-application.pem' are too open.It is required that your private key files are NOT accessible by others.This private key will be ignored.Load key "/Users/jsantos/Downloads/my-nest-application.pem": bad permissionsdebug1: No more authentication methods to Permission denied (publickey).
chmod 400 /Users/jsantos/Downloads/my-nest-application.pem
curl -o- | bash
. ~/.nvm/
nvm install node
node -v 
# Perform a quick update on your instance:sudo yum update -y# Install git in your EC2 instancesudo yum install git -y
git clone
cd typescript-starter && npm install
npm run build
npm run start:prod



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store