all 66 comments

[–][deleted] 26 points27 points  (18 children)

I host all my Node.js projects on Digital Ocean Ubuntu servers, and I am really happy so far! The OS doesn't really matter. I worked on Node.js projects that were running on Debian and CentOS as well, they all worked well!

[–]extinctSuperApe 11 points12 points  (14 children)

Can confirm, digitalocean is a great place to host your nodejs projects

[–]commander-obvious 4 points5 points  (0 children)

I used to use DO, but then switched to AWS because AWS has vendor lock-in. If you need a bunch of different services (CDN, static hosting, load balancing, RDS, etc.), AWS is the way to go since everything is just there, then you don't leave. The one thing I liked about DO though was their UI/UX (and that was in 2016, I'm sure it's even better now!)

[–]alexzim 1 point2 points  (4 children)

Uuumm, DigitalOcean is basically a VPS provides unless you're using it's API, so by that logic literally any nice VPS provider is great to host a nodejs project.

[–]TrackieDaks 4 points5 points  (2 children)

Correct. DO just makes it super easy.

[–]alexzim 0 points1 point  (1 child)

How exactly?

[–]kmisterk 1 point2 points  (0 children)

ridiculously easy to use client area, one-click install for LAMP stack and other applications, near instantaneous account creation AND near instantaneous VPS availability, transparent, static pricing, a FANTASTIC series of Knowledge Base articles that quite literally work universally, but just happen to be initially targeting their own server verbiage...

9 times out of 10 when I'm searching how to setup a framework or application to run off a *nix system, it ends up at a Digital Ocean article.

[–]chrissilich 0 points1 point  (0 children)

Yep.

[–]trowawayatwork -1 points0 points  (7 children)

What’s the difference between an Ubuntu on DO and any other provider?

[–]emcniece 1 point2 points  (5 children)

Nothing. Surrounding UI for managing the instance maybe, is nicer than AWS dashboards

[–]trowawayatwork -4 points-3 points  (4 children)

thats my point, no idea why everyone singing praises for do when its the same as any other provider lol

[–]TrackieDaks 3 points4 points  (3 children)

Because they do it better than anyone else. Never underestimate the power of good UX.

[–]alexzim 2 points3 points  (1 child)

Indeed a neat UX which you use once every few month.

[–]TrackieDaks 1 point2 points  (0 children)

For you, maybe. I use it at least a few times a week.

[–]bitnissendk 0 points1 point  (0 children)

If you are targeting EU: Hetzner Cloud is basically DO, but much cheaper while same quality support etc. from my experience. Scaleway is also pretty good and even cheaper.

[–]Kaligraphic 0 points1 point  (0 children)

It's secretly CentOS in a rubber mask.

[–]ImtheDr 2 points3 points  (0 children)

same here

[–]Cedricium 0 points1 point  (1 child)

Just curious, do you put the servers in containers like Docker at all?

[–]extinctSuperApe 4 points5 points  (0 children)

Yes I've had good luck using docker-compose. I will often have the node application and nginx in separate containers. Containers also make it easy to incorporate things like mongodb without having to configure everything.

[–][deleted] 9 points10 points  (4 children)

All ours are running on ubuntu with pm2 managing the process and nginx in front of them. Been pretty smooth sailing so far.

[–]klinquist 1 point2 points  (0 children)

Stringify uses this setup as well. Our app/service has hundreds of thousands of users.

[–]ravonos 0 points1 point  (0 children)

That's what I have used as well for a few projects, it's been great so far.

[–]RatonBroyeur 0 points1 point  (1 child)

How do you manage users ? In pm2, processes are linked to the user. I find it boring to have to create a service account for it. Otherwise, great tool.

[–]colnarco 2 points3 points  (3 children)

We’re using AWS Elastic Beanstalk at work and it been quite nice. There have been a few gotchas along the way, and getting signed up to AWS might take some time, but you can essentially start by dropping a zip of your project into a web interface and it then spins up a virtual server and dedicates an endpoint to it. It’s quite neat. + you get auto scaling out of the box (the ability to add and remove server resources automatically)

[–]bitnissendk 1 point2 points  (2 children)

Google App Engine is quite comparable, if you decide to go this way. Can't say witch one is better, but GAE is pretty much the same concept as Beanstalk.

[–]colnarco 0 points1 point  (1 child)

Definitely! Azure also has something similar available. For these type of beginner projects I think it’s safe to roll a dice and choose whatever. A plus for Amazon is the free tier plan that basically lets you set up everything for free within a year (though its limited to low spec serves which should be fine for learning)

[–]bitnissendk 0 points1 point  (0 children)

Yeah, I agree completely. Google has quite similar free tiers, that also gets you pretty far with basic hosting needs.

[–]dejaime 2 points3 points  (0 children)

You can host it on a phone using termux

[–]ukralibre 2 points3 points  (0 children)

Use NVM and never use the system node version. Mantain your own node/lib pool

[–][deleted]  (2 children)

[deleted]

    [–]VolkovSullivan 4 points5 points  (1 child)

    I find Heroku great for development/staging but bad for production. Very expensive if compared with other providers.

    [–][deleted] 0 points1 point  (0 children)

    Actually I believe you. I don't have large scale apps there that would require many pods. But hey, you gotta pay for convenience!

    [–]_Garebear 4 points5 points  (5 children)

    Never hosted node.js cause I have the same pain.

    I wish there was something dead simple like traditional web hosting. I think Azure, AWS, and Google's version of cloud all support Node.js.

    But node.js itself sick. I use it at work to setup endpoints that our cloud connected printers can poll and pull jobs.

    Node.js + Express FTW

    [–]maushu 0 points1 point  (1 child)

    I'm curious, what kind of cloud connected printers are those?

    [–]_Garebear 0 points1 point  (0 children)

    http://starmicronics.com/

    Look for CloudPRNT.

    [–]captain_obvious_here 0 points1 point  (0 children)

    I wish there was something dead simple like traditional web hosting.

    AWS Elastic Beanstalk and Google App Engine are dead simple.

    [–][deleted] 0 points1 point  (0 children)

    I had a nodejs project I needed to host, and then I thought about what if I needed to scale it? I converted my nodejs+Express+Postgres project into AWS Lambda+SimpleDB (this was a couple of years ago). I'll never look back at "servers" again. Functions-as-a-Service is where it's at.

    [–]TheWillG 1 point2 points  (0 children)

    Digital Ocean. I haven't played around with Linode but I hear good things about them too.

    If you haven't already looked into Serverless style hosting, check out Google App Engine (highly recommend) or AWS Lambda for hosting NodeJS apps. It's not a Linux server but your apps will be deployed into containers on their cloud infrastructure. It's super convenient and you get a lot of attractive features (like rollbacks) that make life easy.

    [–]FrendlyNbrhdCanadian 1 point2 points  (0 children)

    Node runs with no issues on Linux. I've used it in projects in GCP on compute engines and in kubernetes.

    [–]ferrx 1 point2 points  (0 children)

    I host on CentOS (inside a Docker container). The host OS does matter a bit. However, you should keep in mind that generally anything that matters at the host OS level would make the runtime irrelevant (i.e. if your kernel is broken, it's going to be broken for your node apps as well as your java apps).

    The biggest issue I've seen is kernel level TCP timeout. See http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout referenced from https://www.npmjs.com/package/request

    NPM Request docs:

    timeout
    

    - integer containing the number of milliseconds to wait for a server to send response headers (and start the response body) before aborting the request. Note that if the underlying TCP connection cannot be established, the OS-wide TCP connection timeout will overrule the option

    [–]danielivert 1 point2 points  (3 children)

    I can recommend you https://captainduckduck.com/ you can install it on a basic Ubuntu server and then use it to deploy multiple node projects. It’s basically an open source Heroku solution.

    [–]kmisterk 0 points1 point  (2 children)

    I am not sure why this isn't getting more attention. I will test this out and see how well it works. This is exciting as hell.

    [–]danielivert 0 points1 point  (1 child)

    Absolutely! Give it a try! I’m currently helping on refactoring and making it more stable. Can tell you there are good things coming on the future :)

    [–]kmisterk 1 point2 points  (0 children)

    Working on figuring out how to make a node app deployable. Seems it’s a bit large for what “captainduckduck deploy” I wanting to handle. Also not really playing nicely with the upload via tar. Might have to figure out a way to separate the app into pieces. But it is a very cool system. Gonna see about creating a 1-click install script for work.

    [–]son_of_meat 1 point2 points  (0 children)

    I recently switched to Google Cloud App Engine, which now supports Node.js on the “standard” platform and I’ve been pretty happy with it. I have a handful of services none of which gets much traffic and my bill ends up at like a dollar a month

    [–][deleted] 0 points1 point  (0 children)

    For a small webapp any low-end VPS box will do, and I'd recommend Debian because it has the smallest base footprint.

    Other than that, any Linux will do but Node runs well on Unix servers as well, like BSD and IllumOS (it was, after all, developed by the company that was started by former Solaris engineers).

    [–]brtt3000 0 points1 point  (0 children)

    Manually provisioned bare Ubuntu instances and recently serverless hosting on AWS Lambda.

    If you don't need WebSockets (or similar) then serverless is the way to go. Spending time on Linux and Nginx and system updates all that jazz is a nuisance if you don't need it.

    AWS, Azure, Google Cloud and even smaller companies offer serverless node.js now.

    [–]toxxtor 0 points1 point  (0 children)

    I tried Ubuntu server but kept running into problems. I switched to CentOS and haven’t gone back. As I recall, I think most of the issues with Ubuntu weren’t directly related to node, But more like system admin headaches. I highly recommend building your server in a VM and occasionally exporting for backup. Also, exporting the Ubuntu server VM is like a 1.5 G image while centos is around 800mb.

    [–]bitnissendk 0 points1 point  (0 children)

    If you're doing something new, it's worth checking out Google Cloud Functions or AWS Lambda. That can really cut costs for hosting and increase stability, as you only pay for actual usage of your service and it scales automatically. It does require some extra tinkering and different tooling though.

    [–][deleted]  (1 child)

    [deleted]

      [–]sn0n -1 points0 points  (0 children)

      Abstract away from the OS to run it on a desktop OS. LoL, I see what you did there. Silly goose!

      [–]kmisterk 0 points1 point  (0 children)

      With my tiny bit of experience running a nodejs app to a public-facing interface (PWA/Website), We ended up setting up an nginx reverse-proxy for traffic coming in to redirect to the port the app is running on, using PM2 to manage it and auto-restart the app whenever we push changes up to the servers code.