Syed Asad Abbas Zaidi
Syed Asad Abbas Zaidi

Reputation: 1066

Deploy my local Strongloop Code on AWS

I need to deploy my code for Strongloop onto AWS EC2. I have created a instance on AWS server and is up running. But now I don't know how to transfer my code to AWS EC2. Also I'm using Putty command line.

Upvotes: 0

Views: 178

Answers (1)

Arif Khan
Arif Khan

Reputation: 5069

You should login using SSH client like putty or you may use git bash as ssh client

yum update

yum install curl

curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -

for 4.x, you may refer install nodejs on fedora because Amazon Linux based on fedora.

Now check nodejs and npm version using node -v and npm -v after that transfer file from local to server. You may use sftp client like winscp or filezilla to transfer file from local to server.

Note: Please do not transfer node_modules folder. After successful transfer, login to server using ssh via putty and then go to inside project using cd command and then npm install

Another solution for file transfer using command line

Download git & install and then start git bash and then use following scp command (delete node_modules folder before transfer)

scp -i myAmazonKey.pem -r nodejsapp/ ec2-user@EC2_IP_ADDRESS:~/.

After successful transfer, login to ssh via following SSH command

ssh -i myAmazonKey.pem ec2-user@EC2_IP_ADDRESS

and then go to inside project and then install dependencies

cd nodejsapp/
npm install

I hope this help you

Another solution for file transfer using git

ssh -i myAmazonKey.pem ec2-user@EC2_IP_ADDRESS
yum install git 

check git install successfully git --version if yes then clone repository

git clone yourRepo
cd yourRepo
npm install

Upvotes: 1

Related Questions