Rapid Application Deployment Engine

Deploying node.js Applications

Deploy your node.js applications using git and git alone, with our without Web Server proxying.


When you initialize Rapp on your node.js application, we’ll always look for a server.js file. If this file is not found, the deployment will fail.

When you run wn init for the first time, Rapp will try to search inside your server.js file for the node.js listening port.

It searches for the /listen\((\d+)\)/ regular expression that matches the usual code. For instance, if you have this:

http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/html"});
  response.write("<html><head><title>Node, node, node</title>
  response.write("<a href='http://www.youtube.com/watch?v=C526lxeHo-M'>
    Node, Node, Node!</a>\n");

When you initialize, it will default to port 1234, as can be seen below:

$ wn init
Webbynode Rapp - http://rapp.webbynode.com

Current Webbies in your account:

  1. hasmany.info (
  2. sandbox (
  3. wbno.de (
  4. wcdcompany (

Which Webby do you want to deploy to:

Set deployment Webby to wcdcompany.
[Webbynode] Initializing application nodeapp with dns nodeapp

Configure NodeJS Application

  Proxy requests (Y/n) [Y]? 
     Listening port [1234]:

In case we don’t have a match, or a wrong match, you can always override the value yourself.

The other question we ask when initializing is whether you want to proxy your node.js app or not. If you do, we’ll make sure that the Web Server maps your requests from port 80 and a given domain (for instance, nodeapp.webbyapp.com) to your app port. This way you can deploy multiple node.js applications in the same server and make it work parallel to Rails, Rack, and other apps you want.


To publish your app, just run the usual wn push command:

$ wn push
[Webbynode] Pushing napp
Counting objects: 18, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (18/18), 1.71 KiB, done.
Total 18 (delta 4), reused 0 (delta 0)
remote: Checked out master branch
remote: ----------------------------
remote:   Webbynode git deployment 
remote: ----------------------------
remote: Nginx+Passenger webserver detected...
remote: Setting up DNS...
remote: Deploying application napp as napp.webbyapp.com...
remote: Configuring addons...
remote: Configuring node.js application...
remote:   => Configuring nginx vHost...
remote:   => Configuring database...
remote:   => Configuring monit...
remote:   => Starting app...
remote: napp deployed successfully.
remote: Created http://napp.webbyapp.com/
To ssh://git@
 * [new branch]      master -> master

[Webbynode] Finished pushing napp


After your application is pushed to the server, we create a upstart script to start and stop your app quickly, and also make sure you app gets started between reboots.

Whenever you want to stop it, you can run this from the command line:

$ wn remote sudo stop napp

And then start it again:

$ wn remote sudo start napp

We also install and configure monit service for each application. So, if for any reason your application halts, it will be automatically restarted.

Installing npm packages

To install npm packages, just run:

$ wn remote npm install [package]

The goodness

Along with your application, we created an upstart script (so your application is always started when your Webby reboots) and a monit script, so if your application goes down, we attempt to restart it.

The monit script is always installed to /etc/monit/services/your_app_name and the upstart script to /etc/init/your_app.conf, in case you need to customize them for your needs.


As you can see, we do all the heavy lifting for you. When you first push a node.js app, we install and configure node.js and all its dependencies, along with monit and npm.

And here’s a summary of what takes place when deploying each app:

  1. Transfers all application files to the remote server;
  2. Creates a new dns in the format appname.webbyapp.com;
  3. If you answer Y to proxy, adds a new vHost to the WebServer (nginx or Apache), pointing to your node.js app;
  4. Creates a new database and database user for your app (MySQL or PostgreSQL) — this will become optional soon;
  5. Creates an upstart script for stopping and starting your node.js app;
  6. Creates a monit service for monitoring your node.js app;
blog comments powered by Disqus