tjhack
tjhack

Reputation: 1022

How to deploy node.js app to cloud server

I want to automate my deployment of my node.js app from my machine to the cloud server?

It currently using expressjs.

Is there anything out there like this. Have tried googling but no luck

Cheers

Upvotes: 1

Views: 842

Answers (2)

Mike
Mike

Reputation: 1

I'm not sure this is what you're asking for, but companies like Heroku allow for automated deployment of apps from the desktop to the cloud. No relation, just a (free) customer.

Dave Winer has put together a very nicely documented how-to on this very subject:

http://scripting.com/2014/02/06/herokuForPoetsBeta.html

Upvotes: 0

alex
alex

Reputation: 12265

First of all, you need a private registry server. For example, this one, since it's easiest to install. You'll publish your node.js app there, so cloud servers will download it.

Secondly, you need to execute npm update on all your servers whenever you publish something there.

So my usual deployment process is this:

  1. run npm publish --reg http://my.private.registry:4873/ on local package
  2. run npm update --reg http://my.private.registry:4873/ on each of the remote servers (this can be automated using puppet)
  3. restart all instances on each of the remote servers (pm2 restart all in my case, but you can use different supervisor)

PS: 2 and 3 steps can even be automatic when this gets implemented, so it'll just be npm publish

Upvotes: 1

Related Questions