How to Run Keystone.js within IIS

2015/07/313 min read
bookmark this
Responsive image

Table of Contents

Introduction

This is an instruction guide for how to install Keystone.js (a Node.js CMS) on Windows 7 IIS as a web application.

Install MongoDB

Install MongoDB as a Windows service. See the MongoDB installation guide.

Install Node.js

Keystone.js runs on top of Node.js, so you'll need to install Node.js for Windows.

Setup Keystone.js

Now it's time to set up the Keystone.js web application running on Node.js. Go to the Keystone home page and look through their instructions, or you can follow these steps:

  1. Open Command Prompt as Administrator and navigate to the folder where you want to add Keystone.js.
  2. Type npm install -g generator-keystone
  3. Type yo keystone
  4. The above two commands will set up your Keystone application.
  5. Open the Node.js command prompt and type node keystone
  6. If you can access localhost:3000, then you're ready to set up Keystone.js on IIS with IISNode.

Install IIS

How to install IIS (IIS 7 on Windows 10, Windows 8, or Windows 7):

  1. Press Windows + C, open "Programs and Features" from the command or go to Control Panel to open "Programs and Features."

Install IISNode

  1. Install iisnode for IIS 7/8 (x64).
  2. Run a test to make sure iisnode is installed correctly:
    • Go to /Program Files/iisnode
    • Click setupsamples.bat. This batch file will tell you how to set up a sample website in IIS using iisnode.

Install URL Rewrite Module

Install URL Rewrite 2.0.

Create Website at IIS

Create a website at IIS and point it to your Keystone.js folder.

Add IUser and the local login user with modify permission to the entire Keystone.js folder.

Add Web.config to Root Folder

This is very important for using Node.js and Keystone.js with IIS. The following is a working web.config you can reference:

IIS Bindings

Now you can set up IIS bindings. You can map your mydomain.com to this IIS website.

Conclusion

Running Keystone.js on IIS requires setting up MongoDB, Node.js, IISNode, and the URL Rewrite module. With the proper web.config configuration and IIS bindings, you can host a Keystone.js CMS application on a Windows IIS server.