In the earlier post, created the node.js sample application. Now we will learn how to deploy node.js application to Heroku.
Installation process I have checked in Ubuntu system.
Prerequisites of Heroku
To deploy to Heroku, we need to push our application code to remote repository.
Step 1: We need download and install Heroku toolbelt by below command.
Step 2: To verify that your installation is successful, run the following command in your terminal
Output:
heroku-cli/5.2.39-010a227 (linux-amd64) go1.6.2
Step 3: Once toolbelt is running, then log in and use it
Email :
Password:
Deploying to Heroku
Create New App in Heroku, App name and select the region. In few seconds your app will ready.


Go to settings page and get the Git URL.

Run the below commands in your terminal
Step 1:
cd [APP Folder]
[APP Folder] – specify your application name
Step 2: Initialise the Git
Step 3: Add the remote Git repository application
Step 4: Check the versions
npm -v
git --version
Step 5: Create Procfile file with below content
Step 6: To add files to Git
Step 7: To commit with message to Git
Step 8: To push files to Heroku



Once you have done this process, Heroku starts building our application and deploys as well. After deployment is finished then your application will be access at https://anillabs.herokuapp.com/