Thanks for reading this tutorial on how to deploy nodejs app on amazon ec2 instance. This article gives you the clear-cut picture about configuring a node js HTTPS server on an AWS EC2 instance with SSL certificate. PM2 will be installed on the server globally. you will install PM2 (Production manager 2) to keep live our app after closing our terminal or disconnect from the remote server. ![]() The app is running as soon as you open the terminal and it will terminate as you will close the terminal. Your application can now be deployed live when you run: Then install Node dependencies which will create the node-modules folder by running: Git might already be installed on the instance. You will clone a git repository containing a simple node app from Github, modify it and deploy. ![]() Use a process manager to run the application (such as pm2). Git is a free and open-source distributed version control system. Create an EC2 instance running Amazon Linux Update packages (might include security updates). Next install git with the following command: Then install the latest version of NodeJS by running the following commands:Ĭonfirm NodeJS is install by checking the version of NodeJs installed with this command: Once you are connected to your aws ec2 instance with terminal or ssh, update the packages by running the command: ![]() Step 12: Install NodeJS and Deploy your Application Step 11: Connect Instance to Terminal Using PuttyĬonnect aws ec2 instance via ssh for Windows, mac and linux user. And wait a few minutes to completely launch your instance or web server. Click on the Launch instances button to launch your instance.
0 Comments
Leave a Reply. |