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
$10 FREE SIGNUP LINK:
https://m.do.co/c/5424d440c63a
Blog Post – http://www.traversymedia.com/deploying-node-js-to-digital-ocean/
SUPPORT THIS CHANNEL WITH A CUP OF COFFEE PER MONTH:
http://www.patreon.com/traversymedia
ONE TIME DONATIONS:
http://www.paypal.me/traversymedia
Amazon Auto Links: No products found.
Thanks bro, perfect explaining.
Bravo!!! man…you nailed it….
Nice one
So, I cloned my repository without using a SSH Key, since the server allowed me to do that for some reason. I have a SSH connection to the server; and, when I get into the project folder, and run my node app, the console says “server started” (as my index.js indicates to); however, when I try to connect to the server at my serverip:8080/, it just never connects (time exceed). I tried changing the port several times, and using both Firefox and Chrome, but nothing. Do you have any idea why this is happening? I do not have NGINX nor a certificate from Lets Encrypt installed.
Great tutorial! but process is to long. Is not easy for beginner
Awesome tutorials my dude. Learning so much!
The blog post is not working brad.
Brad you are a life saver! I had two days for a sudden deadline to deploy and this step by step really saved me! Thank you man… I was trying to deploy a Nuxt app through Dokku as suggested in it’s documentation but i was stuck with the ssh ( through windows… ) , the support hasnt helped for 5 hours now ( might have been a noob error or something ) so i tried your way with clean ubuntu and it worked after a couple minor things… Thanks man…
Also you can use Filezilla in place to winscp.
For the curious, this tutorial should be just as applicable to Vultr.com, Linode servers as it is Digital Ocean. The only difference between Digital Ocean and other cloud-hosting providers is of branding and a bit or two of hardware. Other than that, they all provide Linux machines. So any command that works for Digital Ocean MUST work for Vultr.com, or Linode.com or Amazon Web Services.
http://www.traversymedia.com/deploying-node-js-to-digital-ocean/ this link is not working 404 error
man thank you so much! I’ve been trying to find someone who can teach me how to use the digital ocean droplet for so long, and since i haven’t used linux before it was a pain in the A**! Thanks alot!
Great video! Question: What if you wanted to run multiple Node.js apps, each with a different domain name? Possible?
Hello brad I am not able to run change port 80 command.
If I make a change to my git repository that was cloned how would I go back and update it to see the changes?
Thank you very much, you are so handsome.
I see my app is running message in console. But i can’t see it in browser. I wrote the address as instructed. “IP address + :5000” What can be a problem, any idea?
Putty is for window. For mac which tool i can use?
Awesome guide, I found this link https://m.do.co/c/7f7024d46fc6 I signed up and received free 10$ 🙂
wow this video saved my life! I’ve been researching about this for a while, I got stuck with SSH part, now with your video, everything is clear to me! thanks man!
excellent tutorial. which one would you recommend based on your experience? heroku or digital ocean for a relatively medium sized web app?
Excellent tutorial!
Thanks!
it is necessary to open the port with “sudo ufw allow 5000”
Great video! got my site up and running!
I can’t change any files. Nothing I do will edit the index.js file. Been changing the “Hello World” to anything either using sudo or the winscp
Hello Brad,
Thank you for all the awesome tutorials and courses that you’ve posted!! This comment is for a video request.
Could you do a video to dockerize a Node JS application and run it in a container? Love you channel!!
what happened to that Blog post?? 404 not found.
Please make video on Google cloud
Followed along the whole way and it was really helpful. Thanks!
putty showing me connection time out. any help please
I would like to install on a subdomain like “http://testing.codelearnet.net/” my React versión to test my software and work with git. Is it possible? Who can I do it? Thank you!
Thank you, You are the best
your are life saver, i really appreciate your work and i learned a lot your channel. I hosted my app on AWS EC2 free tire and suddenly it crashed and said my account is not valid. Then follow your video and my site is up again in 30 min. Thanks mate
Good video. A few things I’d suggest: Maybe use systemd instead of pm2. I just would rather focus on using tools that are available on the system than reaching outside for 3rd party stuff. libcap2 seems a bit hacky too. I can see that it works but Linux is actually designed to not allow non-root owned processes on ports lower than 1024 for a reason. I would expect to see something like reverse proxy or iptables being used, though for testing that is probably fine. A Google search seems to suggest that it’s even possible to have an express app drop privileges after it binds to the port, that would be something I’d be interesting in knowing how to do since it’s going to be necessary at some point. Which brings me to my final observation – SSL. how could this be run on SSL and how do you integrate the certificate into the app? I understand this final point might be outside the scope of this tutorial but I still think that is something that is something you’re going to need to know eventually. All in all though a great starter video on how to deploy to a Digital Ocean server. Thank you, though you really make me want to do some Linux tutorials. Windows people work so hard at not doing things the easy way with Linux tools.
Thanks!!
Very nice video, Brad! Could you repost the blog for this tutorial, please?
Man, you just made it happen!!!! Thank you so much to initiate me to server administration!!! I just mention that i followed your tutorial to deploy on another hosting company with a mac and it works!!!! Best regards!!! Max
Wow this is great thanks (:
The Blog Post link is down. It shows 404 Error
Hey the blog post doesnt exit?
Thank you ^ 100. You helped me deploy a website in an hour. Do you have any tutorial to add SSL certificate to the newly created website?
For every student following this course you can get $50 free on DigitalOcean via https://education.github.com/pack
Thanks
create ssh key is easy 6:37
Thank you so much! my project is online now BUT HOW DO I UPDATE MY CODE once winscp pm2 start index.js ?? Please comment back here @Traversy Media
Excellent Job!!!
really your tutorial is very helpful bro, very great..,
Ok Another Question: HOW DO I COMPILE TYPESCRIPT once I change the .ts file? @Traversy Media
sh: 1: tsc: Permission denied <-- error on ubuntu
Get $10 credit from this signup link http://www.digitalocean.com/?refcode=588259f170dd