Cloud Deployment of Node.js Applications with Nodejitsu

Share this article

SitePoint is releasing its new book, Jump Start Node.js, tomorrow. In celebration of the book launch, JSPro is bringing you a special Node.js article today. Today’s article will teach you how to deploy your Node.js applications in the cloud using Nodejitsu.

About Nodejitsu

Headquartered in the heart of New York City, Nodejitsu Inc. is a cloud computing company. To be more specific, they provide platform as a service (PaaS) offerings focused on Node.js. Nodejitsu also provides tools for easily deploying applications in their cloud. They also provide a free tool called Haibu (Japanese for hive) which you can use to spawn a Node.js cloud on your own hardware. While I felt obligated to at least mention Haibu, today we will be targeting the Nodejitsu production stack.

Signing Up with Nodejitsu

Before you can utilize the Nodejitsu cloud, you need to register for an account. Luckily, Nodejitsu offers a free plan for individual developers. To register for an account, head over to the Nodejitsu Home Page. Locate the “Try Nodejitsu for free” button and click it. Next, create a new username and provide your email address. You can optionally add a description of the types of applications you plan to deploy with Nodejitsu.

After submitting your registration, you will receive a confirmation email with further instructions. You will need to install Nodejitsu’s command line utility, jitsu. To install jitsu with npm, use the following command. On Unix systems, you should execute the command using sudo.

npm install jitsu -g

Next, confirm your account using jitsu. The confirmation email you received should include a command similar to the one shown below. After running the command, you will be prompted to create a password for your new account. Once you create your password, you’re ready to start deploying applications!

jitsu users confirm your_username confirmation_code

Creating a Nodejitsu Application

JSPro recently ran an article on creating a very basic HTTP server in Node.js. We’re going to use this simple web server as our first Nodejitsu application. The code for the web server is shown below. Add this code to a file and save it as “web_server.js”.

var http = require("http");
var server = http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/html"});
  response.write("<!DOCTYPE "html">");
  response.write("<title>Hello World Page</title>");
  response.write("Hello World!");


Next, use jitsu to deploy the application. The command to do this is shown below.

jitsu deploy

The package.json File

Before your application can be deployed, it needs a “package.json” file. In the Node.js world, projects should contain a “package.json” file that specifies metadata about the project. As the file extension implies, “package.json” contains JSON data. A typical package file will contain the package’s name, dependency information, version information, and any other relevant configuration data.

When you attempt to deploy a project that does not contain a “package.json” file, jitsu will create one for you after stepping through a short wizard. The listing shown below contains the relevant wizard data. The App name is the name of your application. You will use the subdomain to access your application online, and therefore it should include your username. The scripts.start field denotes the script file used to launch your application. The version field represents the version of your application. Finally, we do not need to specify a value for engines.node, as any 0.8 version will suffice for our purposes.

App name:  web_server
subdomain:  webserver.your_username
scripts.start:  web_server.js
version:  1.0.0
engines.node:  (0.8.x)

Once you’ve finished the wizard, your package.json file should resemble the one shown below.

  "scripts": {
    "start": "web_server.js"
  "version": "1.0.0",
  "engines": {
    "node": "0.8.x"
  "name": "web_server",
  "subdomain": "webserver.your_username"

Finally, type yes to confirm the settings.


If everything is configured correctly, your web server should now be running in the Nodejitsu cloud. You can access the server by navigating to You should substitute subdomain with the the subdomain value in your “package.json” file. For example, my server is running at

Of course, this is just the tip of the Nodejitsu iceberg. I suggest experimenting with jitsu. For example, a list of commands for managing your applications is available by typing jitsu apps. You should also check out the Nodejitsu Handbook.

Do any of our JSPro readers have any experience with Nodejitsu?

Colin IhrigColin Ihrig
View Author

Colin Ihrig is a software engineer working primarily with Node.js. Colin is the author of Pro Node.js for Developers, and co-author of Full Stack JavaScript Development with MEAN. Colin is a member of the Node.js Technical Steering Committee, and a hapi core team member. Colin received his Bachelor of Science in Engineering, and Master of Science in Computer Engineering from the University of Pittsburgh in 2005 and 2008, respectively.

Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week
Loading form