Set Up Continuous Delivery for Your Node.js Application

Beginner’s Guide for automatic deployment of a Node.js app

Technology used:

GitLab CI

post-receive git hook

pm2

digital ocean droplet

Hey everyone!

I am working on a small startup with a friend as a side project. It’s a job-search board for tech in Germany, called clusterjobs.de. Recently I had an idea to optimise some resources and find something cheaper than Heroku. Heroku was extremely expensive — two machines for a web application with 512mb RAM each were $50 per month.

After recent Hacktoberfest (which I really enjoyed and can only advise you to participate in next year), I got my eyes on Digital Ocean and found that they provide 1 CPU and 3gb RAM server for $15 per month.

Also, I found that as a Hacktoberfest participant I got a welcome $100 there!

The caveat was that Heroku got all tools integrated and enabled, a CD is done through a couple of clicks and everything is working magically. On the other hand, in a Digital Ocean camp, you would need to set up all the stuff on your own, but you pay much less.

That sounded like an interesting and rewarding challenge, so, after some days of Christmas doing-nothing, I decided to go back to work and set things up.