Sponsored Content This post is about a commercial product that we think will appeal to DailyJS readers.
EvenNode is a new hosting service that is dedicated to Node.js. You can get a free app instance which even includes MongoDB, so it's great for quickly deploying MEAN apps. The paid tiers start at €6, which gets you 1GB storage and 256MB RAM. One interesting thing about the paid tiers is they all get unlimited custom domain names, so it's easy to use multiple domain names for each application.
EvenNode supports multiple versions of Node, starting at 0.8.6. You can deploy with Git, and WebSockets are supported out of the box. For more technical details, take a look at the documentation. Sign up only requires an email address and password, so you don't even have to hand over credit card details to try it out!
Mozaik (GitHub: plouc/mozaik, License: MIT, Demo) by Raphaël Benitte is a Node-based web-app for showing dashboards. It includes some widgets for CI and monitoring, but you can add more. It also comes with five themes. Of course, you can create your own widgets and themes.
Other than the very clear and attractive design, one feature that I liked was rotating dashboard layouts. This would be cool if you've got multiple teams in the same office that perform different roles. You could rotate between support information, developer tickets/CI, and server monitoring.
Mozaik is built with React and Express.
Marko (GitHub: raptorjs/marko, License: Apache 2.0, npm: marko) by Patrick Steele-Idem is a templating language for Node and browsers that uses HTML with custom tags. It's being used at eBay as part of their Node stack, and it has been covered by some cool blogs like the StrongLoop blog.
There's a live demo where you can try out the syntax. The markup uses attributes for data binding and iteration, so you can say if="notEmpty(data.colors)" and repeat elements with for="color in data.colors". I haven't seen this syntax before, but I think it would be easy to learn if you're used to declarative template systems.
One thing about Marko that makes a huge amount of sense to me is the fact it's asynchronous. You can stream output with Node's HTTP response objects, which will fit in extremely well with frameworks like Express. The design philosophy statement for Marko says "it should be possible to render HTML out-of-order, but the output HTML should be streamed out in the correct order", and I think this is extremely useful.
Modulus.io is a new hosting platform dedicated to Node. Why "platform"? Well, Modulus provides a complete stack for web application development: MongoDB is used for the database and file storage, and WebSockets are supported out of the box. Applications running on the Modulus stack get metrics -- requests are logged and analysed in real-time. Horizontal scaling is supported by running multiple instances of your application.
Pricing is determined by the number of instances (servos) that you run, and storage used. The Modulus pricing page has some sliders, allowing you to see how much it'll cost to run your application per-month.
I asked Modulus about using different versions of Node Node, as Heroku supports 0.4 to 0.10. However, at the time of writing only Node 0.8.15 is supported. Ghuffran Ali from Modulus said that they're working on supporting multiple Node versions as soon as Monday (27th May), so keep an eye on the Modulus blog for details on that.
It's easy to get started with Modulus -- there's a sample project, plus you can sign in with GitHub so it doesn't take too much effort to get a basic application running. They're also offering $15 free credit, so you could run something more substantial there to see how everything works.
Modulus uses a web-based interface for managing projects that allows various settings to be changed, like environmental variables, and a global SSL redirect. There's also a command-line client -- if you sign in with GitHub make sure you use modulus login with -g so you can sign in with your GitHub account.
This means that our users will be able to deploy their applications and databases from the same set of tools all backed by node.js. If you’re an existing IrisCouch user you will be notified and given ample time to migrate your IrisCouch account into a Nodejitsu account.
It's impressive to see so much innovation in the Node hosting/PaaS space!
During the publication of our Let's Make a Web
App tutorial series, people have
been posting comments about hosting Node apps. In particular, the
comments on Node Tutorial
13 are quite detailed.
In this article I've summarised Node hosting approaches so you can pick
the approach that suits you.
In the wider web development community there are some amazing
plug-and-play solutions for hosting web apps. Hosting Node apps isn't
quite as easy, yet, but there are some excellent solutions that are both
fast and easy to understand.
Upstart is a replacement for the
/sbin/init daemon. You can use it to start, stop, and
restart Node processes. If you're using Ubuntu you should already have
it, if you're using Debian or another Linux distribution it's fairly
easy to install. It actually comes with replacements for the sysvinit scripts that come with Debian. The Upstart
Getting Started guide
has more details.
This is an upstart script in /etc/init/myapp.conf that I
knocked up to manage a Node app on EC2:
Cluster has many interesting features, from zero-downtime reloading to a
commnad-line console for real-time administration.
I asked TJ Holowaychuk how he manages production Node apps, and
apparently he's using
Cluster evolved from an older project called Spark, so it seems like
it's got some pedigree.
The age old problem of hosting web software is port 80: binding to this
port requires root. There are ways around this: some firewalls can
redirect traffic from port 80 to a non-privileged port. An alternative
to this is authbind, which can be easily installed in many
distributions. In Debian it's just a case of apt-get install
Once it's installed, create a file in /etc/authbind/byport/80 and chown it to the
user you want to run your Node app as. Then, if you're using Monit or
Upstart, make sure your Node process is launched with authbind and run it as that user.
The previous Upstart example would have to be adapted to work with
start on runlevel 
su -c 'authbind /usr/local/bin/node /data/apps/myapp/app.js 2>&1 >> /var/log/node.log' www-data
Almost a year ago I wrote a tutorial on using nginx to host Node
apps. Servers like Apache and nginx can sit in front of your app and the
web. This means you don't need to run on a privileged port, and the web
server can do jobs it's good at like serving static files.
This may fit in better with your current hosting set up. You could still
use a service monitor with Cluster to manage the Node processes.
I deployed my Upstart/Authbind/Cluster combo to EC2 without any trouble
at all. I used the AWS Console to
create EBS storage devices to keep my Mongo database, application, and
static assets. After that it's basic Linux sysadmin.
Just remember to add your IP address and port 22 to the security policy,
else you won't be able to connect!