Hosting a Nodejs for Free

Over the years we had talked a lot about Nodejs. Nodejs is easy to get started developing, as well it is easy to host a Nodejs application. In this post, we will cover different options available to host Nodejs applications. We will deploy our demo project on those services. Let's get started.

Free Nodejs Hosting

There are 100s of services out there that allow users to host Apache MySQL and PHP (AMP) applications. PHP and JavaScript used to work together since the dawn of the web. JavaScript handled little details on the browser, while PHP managed all the server-side tasks.

Now With the introduction of Node.js, javascript can work alone, but not all hosting provider supports Nodejs, like PHP. It does not mean, there are none. Not just hosting, but we got free hosting as well for Nodejs. These services are free, signup and start deploying the applications. No need to verify you have credits cards to pay later.

Heroku

Heroku is a container-based cloud Platform as a Service (PaaS). Developers use Heroku to deploy and manage their applications.

Let's deploy our Node project on Heroku. For this demo, we will use a Demo project. This demo was used during Nodejs Deployment with SSL certificate, where we deploy the project on an ubuntu server.

To get started, create an account with Heroku. Once you log in to Heroku, you will be on the Heroku dashboard. To deploy a new application, click on New and click on create new app.


Now Enter the App name, and choose a region. Then Click on Create app.

Now you will be on the Deploy section of your application, if you moved around click on the Deploy tab once you select your application for the dashboard.


For this demo purposes, we will deploy the application from Github. On the Deployment methods click on Github. Then click on Connect to Github Button.

Once you connect your Github, now you can search for the repo on your project. Now search for the application and click on Connect.

Now you can choose the branch you want to deploy. Then you can Enable Automatic deploy, which will deploy the changes once you pushed the changes to that branch.

Your app must listen to port   process.env.PORT .

Now on manual deploy click on Deploy Branch to deploy your application. Now you should get "Your app was successfully deployed." Click on view, you should see your application.


That's it, You successfully deployed your Nodejs Application on Heroku.

Conclusion

In this post, we successfully deployed the Nodejs Application on Heroku. There are other alternatives to Heroku as well, will add short descriptions on them as well. Also with Heroku CLI, we can have some more control over the project we deployed. For the run time log, we need to use Heroku CLI. I will keep updating the post with those aspects as well. Thank you!

Posted by Sagar Devkota

Hosting a Nodejs for Free Hosting a Nodejs for Free Reviewed by Blogger Nepal on May 01, 2021 Rating: 5

No comments:

Powered by Blogger.