Deploy Node.js App To Digital Ocean Server

Deploy Node.js App To Digital Ocean Server

In this video we will go step by step to deploy a Node.js application to a Digital Ocean server/droplet. Here is a rundown of what we will do…

1. Setup a Digital Ocean droplet (Use link below for $10 free)
2. Add SSH Keys Using PuttyGen
3. Connect using Putty, create new user
4. Secure server by disabling root
5. Install Node.js and Git
6. Clone Node/Express app from Git
7. Install PM2 to run app as a process
8. Run app on port 80
9. Connect a domain name to our app


Blog Post –



48 thoughts on “Deploy Node.js App To Digital Ocean Server

  1. If somebody wants to copy the commands then currently this page is not available anymore, but possible copy-paste here

  2. This is really helpful indeed! These days running curl before "sudo apt-get install nodejs" doesn't seem to be necessary, though.

    There's a number of other details that may be worth mentioning, but I'll probably won't mention them until I research them more (aspects regarding TypeScript + pm2, running multiple node apps, installing DB, https and others).

  3. I'm new to Digital Ocean and Ubuntu. Are there plans where the server doesn't reset? I am used to AWS/Windows.

  4. great tutorial man. because this was 3 years ago. is there an updated steps for this or should i just follow everything?

  5. That link to the blog instruction post doesn't work anymore. Is there a newer version of this video for 2020 that anyone knows about?

  6. Hi brad and everyone, I’m currently finding ways to deploy my mern stack application to digital ocean. Was just wondering if this video is still applicable in 2020? Also, I also want to ask, if we want to run both front end and backend using pm2 , do I put it like this? pm2 start index.js && pm2 start client/index.js? Thank you!

  7. The blog post is not longer a valid link, does anyone have a new one? Also, you didn't install an Apache/Nginx server, I'm guessing you already had one installed seeing that you have a /var directory… I thought web files had to be placed inside the /var/www/html folder to be displayed on the web?

  8. if my host shuts down or restarts the server for some reason, do I need to login and run pm2 start app.js or will it automatically start?

  9. Hey Brad – do you know if it is possible to run a MERN app on DigitalOcean that pulls from a MongoDB Atlas database?
    Followed one of your guides for deploying MERN to Heroku. Looking to move to DO. Would love your thoughts on this.

  10. I kind of confuse about disabling the root authorization, is it because lets say prevent people to not gonna do something like "brute forcing" our login? And the disabling password part, is it disabling the re-asking confirmation password for something we do with sudo even though we already an administrator?

    By the way, its nice tutorial, Brad. Thank you for being our one of the best online teacher out there.

  11. Amazing. I liked the way you provided apart from the topic, you provided more information and demonstrated what would be the result if certain things were not done. That's what is called: TEACHING. I do love your videos, but this one is simply the best I've watched.

    I would appreciate to have more topics around deployment on digital Ocean especially for databases in the case of a mobile App hosted on any store.

    Thanks again.

  12. Blog URL is not working. Please update it asap, thanks for the video I really learn a lot of things from this.

Leave a Reply

Your email address will not be published. Required fields are marked *