Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js hosting/deploying on my own hardware [closed]

Tags:

node.js

There are a handful of websites out there that will host your node.js server/app for you. But what if I want to deploy it on my own hardware, making it viewable from example.com? How do I do that? Thanks.

This shouldn't make a difference, but just in case, this is the software I'm using: I'm using express.js, node.js, socket.io, and Linux (one of my developers is making an OS specifically for my app, or so he says. We may just use an established distro, but we're still in the planning process).

like image 808
Matt Avatar asked Mar 18 '12 07:03

Matt


People also ask

How do I run NodeJS server permanently?

js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.

Can I run NodeJS without server?

Initiating a server is just part of what NodeJS does. Assuming that you just want to do something functional or scripts, just write a . js file as it is, using NodeJS's libraries, then run it by executing node binary on the file.


1 Answers

There are several ways of hosting node.js projects.

You can hook it up behind nginx or apache, so they would do the static file exchange, but since you want to use websockets, then it shouldnt be good idea.

You can also use just plain node.js and it can be set up in millions of ways based on your needs. Starting with your plain express project just run by 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 loved cluster.js set up but its outdated.

Some more links with good info:

  • http://clock.co.uk/tech-blogs/deploying-nodejs-apps
  • http://dailyjs.com/2011/03/07/node-deployment/

There are more info out there, your developers will just have to dig and figure out whats best for your project. Also deployment descriptions for Amazon EC2 is pretty much the same as on any hardware you own.

P.S. Also basic stuff: point out your domain to your server ip, run node with port 80, your good to go.

like image 131
rskuja Avatar answered Sep 20 '22 21:09

rskuja