- Start new EC-3 instance and downlod the key file in your computer
- Select your instance from deshboard and click security group
- Add inbound rule to allow All Traffic(ipv4)
- Open your terminal and navigate where you have downloaded your pem file and run
ssh -i your_file_name.pem ec2-user@<-- YOUR INSTANCE PUBLIC IP -->
# Example
ssh -i Ec_2_secret.pem [email protected]
# If it throws error try running
chmod 400 Eather_Server_3.pem
By now you should have connection with your instance
- Install git
sudo yum install git -y
- Clone your repo
git clone https://github.com/----YOUR_REPO_LOCATION---.git
- Install NVM and configure (run the commands)
# Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
# Export nvm path
. ~/.nvm/nvm.sh
- Install Node (for avoiding node issues make sure you install node version that you used in local development )
nvm install v16.13.0
- Now(if you have) you need to add your .env or secret files (that are need to run the server)
touch .env
# open using vim
vim .env
# vim insert mode
i
# copy and paste from your local file in terminal
:x
# vim save and exit
- Start your server
# Install packages
yarn install
# Start your server
yarn (or) npm start
- Install package
# System config
sudo yum install system-config-firewall
# httpd
sudo yum install httpd
# start the service
sudo service httpd start
- Reached heap limit Allocation failed - JavaScript heap out of memory
export NODE_OPTIONS="--max-old-space-size=8192"
- Access the server on http port
http://3.110.130.198:4000/graphql