Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Puts Debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
Let’s get to it! To create your service file, you can use Vim (if you enjoy a challenge) or Nano as your editor, and I will be using Nano. Thank you and God bless 🙏🏿. So to create your service file in the appropriate directory, you will execute the command
Every website or web application you have ever come across on the internet contains code deployed there by someone like you (or by aliens; I can't tell the extent of their involvement at this time) and for you as a web/software developer, knowing how to deploy your code to the streets of the internet via a remote server such as cloud servers is an invaluable skill to have today. There are several decent hosting services around that enable you to properly and securely host your website or web app such as Digital Ocean, Heroku, Vercel (mostly for front-end apps) and chief amongst them, Amazon Web Services (AWS).
Every website or web application you have ever come across on the internet contains code deployed there by someone like you (or by aliens; I can't tell the extent of their involvement at this time) and for you as a web/software developer, knowing how to deploy your code to the streets of the internet via a remote server such as cloud servers is an invaluable skill to have today. There are several decent hosting services around that enable you to properly and securely host your website or web app such as Digital Ocean, Heroku, Vercel (mostly for front-end apps) and chief amongst them, Amazon Web Services (AWS).
You want your application to be available on the internet whenever it is accessed on any authorized device, from any authorized location. To achieve this, you can create a service to manage your node app. This service will be managed in Systemd to reliably ensure that your application is always running smoothly (i.e. starting, stopping, restarting, monitoring and occasionally fixing issues to keep the application running). This means that Systemd will ensure that the application is available to users at all times even when your Linux terminal or/and your local computer is off as long your Instance is running remotely on your AWS account, your application should be running smoothly on the internet.
Today, you will learn how to deploy your node.js project to the internet via an Amazon Web Services EC2 Instance at little or no cost. You will learn how to create an AWS EC2 Instance and work in Amazon Linux 2, create and manage services with SYSTEMD, use NGINX as a reverse proxy and obtain an SSL certificate from Let's Encrypt to ensure your website is secure via HTTPS protocol. So let’s get to it and deploy your project to your EC2 Instance.
There are multiple ways to import your code to your Instance. You can import your code files from your Windows computer by using WinSCP or use a utility like rsync to efficiently transfer your code files from your local storage (your computer) to remote servers (your Instance) or you can be like me and use the most straight forward method which is to use git to download your code from your source code management platform which is Github in my case (and hopefully yours).