Node.js hosting / deployment on my own hardware

There are several websites that host your node.js server for you. But what if I want to deploy it on my own hardware, making it visible with example.com? How can I do it? Thanks.

This should not change, but just in case it is the software that I use: I use express.js, node.js, socket.io and Linux (one of my developers makes the OS specifically for my application, or, as he says, we can just use the installed distribution, still in the planning process).

+6
source share
1 answer

There are several ways to host node.js projects.

You can connect it to nginx or apache, so they will perform a static file exchange, but since you want to use web files, then this should not be a good idea.

You can also use just node.js, and it can be customized in millions of ways based on your needs. Starting with your simple express project, run node app.js. But most likely you want to use something like forever http://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever to keep your node instance alive.

I liked cluster.js but it is deprecated.

Some more links with good info:

There is more information there, your developers just have to dig and find out what works best for your project. Also, the deployment descriptions for Amazon EC2 are pretty much the same as any hardware you have.

PS Also the main things: point your domain to your ip-server, run node with port 80, and you will be fine.

+7
source

Source: https://habr.com/ru/post/911021/


All Articles