What is Nodejitsu?
Nodejitsu is a simple and reliable hosting platform for Node.js apps. The platform has a few great things going for it:
- If you are hosting an open source project, chances are Nodejitsu will host it for free
- Support for continuous deployment
- WebSocket support
- Built using Node.js, soup to nuts
- Ability to choose your infrastructure provider
- Uses npm for deployments – just like StrongLoop
- No special tweaks required for your app to run. If it’s Node, you are good to go
- Support for a variety of datastores, including: CouchDB, Redis, MongoLab, and MongoHQ
If you want to watch a quick 2 minute video to see how StrongLoop is installed via npm, check this out:
Assumption: You already have Node running locally
If you don’t already have Node installed, you can download the latest version from nodejs.org for your particular platform.
Step 1: Install the StrongLoop Command Line Interface (cli) locally
$ npm install -g strong-cli
Note: If you get permission errors, re-run commands with sudo
Step 2: Verify your installation
$ slc version
Step 3: Install the sample LoopBack application
$ slc example
$ cd sls-sample-app
Step 4: Install and setup the StrongOps agent
$ slc strongops --register
Step 5: Provide your full name, email and password when prompted.
Step 6: Create a StrongLoop account to access your StrongOps dashboard
Note: Use the “email” you provided in Step #5 as your “email” plus use the same ”password”.
Step 7: Your dashboard is ready here:
Note: You will not see any data until your application has been running for a few minutes. So, please make sure to execute the next step.
Step 8: Explore the sample application by running it and then visiting the URL below:
$ slc run .
To view the LoopBack sample application go to the browser and open up localhost (0.0.0.0), specifying port 3000 like so:
Now, let’s stop the sample app and deploy it on Nodejitsu!
Step 9: Sign up for Nodejistu
Step 10: Install the jitsu command line tool (CLI)
$ [sudo] npm install jitsu -g
Step 11: Execute the user confirmation command and code you got in your sign up email.
It should look something like…
$ jitsu users confirm [user name] [a bunch of numbers and letters]
Step 12: Login
You’ll be prompted for your password to login.
Step 13: Deploy the StrongLoop sample application to Nodejitsu
Inside of the sls-sample-app directory execute:
$ jitsu deploy
You’ll get prompted for a subdomain name, make it a good one!
Next, you’ll get prompted for a Node engine. I picked what was offered, 0.10.x and confirmed the selection.
At this point Nodejitsu will do a few checks, upload your app and then give you a URL and port assignment where you can view it.
You should note that locally, the LoopBack sample application if configured by default on port 3000, while Nodejitsu deploys the app by default on 80.
You should also be able to go back to your StrongOps dashboard and view your app on Nodejitsu being monitored.
If you run into any issues, normally an application restart gets things back in order. To do this, execute:
$ jitsu list
…to see the status of your apps. Then restart the one you want by executing:
$ jitsu apps restart [name of app]
To stop your app, execute:
$ jitsu apps stop [name of app]
Redeploy an app (executed from with your apps folder) with:
$ jitsu apps deploy
And finally, if you’ve made total scrambled eggs of things, you can destry an app with:
$ jitsu apps destroy [name of app]