node.js droplet Subdomain SSL

Posted January 13, 2016 6.3k views


following setup:
We do have a droplet with node.js (ubuntu) and need to secure it via ssl. Let’s say we have the domain - we just using the node.js server for some parts (chat, etc.).

Thus for me the question is, how to achieve that we can use ssl with it. Should we create a subdomain like and direct that subdomain to the ip of our droplet via dns and then buy the certificate for that ?

Some hints would be great, thanks!

Best, Nico

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I would recommend setting up nginx as a reverse proxy for your Nodejs application. Take a look at the following tutorial (ignoring anything related to Apache):

If you have Nodejs set up and ready to go, you can skip straight to the Set Up Reverse Proxy Server section. You will want to replace APP_PRIVATE_IP_ADDRESS in nginx’s config with

Once you’ve done that, configure your Nodejs app to listen on or any other port that is unused and over 1024 (make sure you update the nginx config with the new port as well).

To install an SSL certificate, follow this tutorial:

by Mitchell Anicas
This tutorial will show you how to acquire and install an SSL certificate from a trusted, commercial Certificate Authority (CA). SSL certificates allow web servers to encrypt their traffic, and also offer a mechanism to validate server identities to their visitors. The...