---
title: "Sails Quickstart"
date: "2016-01-13"
category: "node"
slug: "sails-quickstart"
---

This guide walks through setting up a [Sails.js](http://sailsjs.org/) application with Passenger.

## Quickstart

1. **Prerequisite:** Ensure local npm bin paths are in your search path (see [[adding-npm-bin-path-to-command-search-path]])
2. Login to the [[accessing-terminal]]
3. Create a folder for your Sails application (using `/var/www/sails` in this example):

    cd /var/www
    mkdir sails
    cd sails

4. Install Sails from npm:

    npm install sails

5. Create a new application called `app`:

    sails new app

6. Switch to the new `app/` directory and create a Passenger-compatible [[passenger-application-layout]]:

    cd app
    mkdir public tmp log

7. Designate this as a Node [[running-node-js]] application by adding the necessary [[htaccess-guide]] directive:

    echo 'PassengerNodejs /usr/bin/node' > public/.htaccess

8. Connect `/var/www/sails/app/public` to a [[creating-subdomain]] or [[creating-addon-domain]] within the [[logging-into-the-control-panel]] via **Web** > **Subdomains**

9. Access your Sails application in the browser.

    ![Default welcome screen for a newly minted Sails application](kb-image:sails-welcome-page.png)
*Default welcome screen for a newly minted Sails application*

## See Also

- [Sails documentation](http://sailsjs.org/documentation/concepts/) (sails.org)
