Last Updated: December 26, 2018
· avnerner

Node JS Seamless Deploy

Those coming in from the Ruby world are probably well familiar with Unicorn.
You start a few workers, you update your code, send a USR2 signal to the master process and boom a new set of workers are running with the new code.

Node JS makes this a little more painful, but there is a very nice solution to it - Naught.

We have been using Naught in production for a while now, it gives us a very clean deploy with Zero down and happy users.

I've created a simple Template repository -

It includes a stack of best-of-breed node.js modules of what we've found to be stable and performant on top of express for a production service node service.

3 Responses
Add your response

I started using naught as well. Can you explain how you make redeployments/hot-swaps smoothly? I mean, right now I have a folder with my node.js app. I ran "naught start app.js" to start the server, so now I have a "naught.ipc" file inside that folder. Now I want to deploy the updated code: Do I just "git pull origin master" in the same folder and "naught deploy", or pull the code to a different folder? Couldn't figure that out from the docs.

over 1 year ago ·

It really depends on your use case on source control being used.
We us git, and so we so we base the logic on git pull.
In the project I posted, you can also see a sample script that we use to apply the changes, using git:

Another view on deploy process is described in this issue (that was fixed since):

over 1 year ago ·

Hi Avner
Very nice template.
I'm looking to get a better understanding of testing each node before I send the 'online' message. Think you can help me you here -

Thanks !

over 1 year ago ·