Running Ghost on IIS

Running Ghost on IIS is fairly simple. First of all you have to make sure that Node.js and iisnode are installed on your machine.

Follow the installation instructions in Ghost's and verify that the application pool has read and write permissions to the target directory.

Add a web.config file to your application root and insert the following lines, which tells iisnode to use index.js as the startup file. The rewrite rule (URL Rewrite should be installed as well!) is required to pipe all incoming requests through the index.js file and let Ghost process them.


      <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
    <defaultDocument enabled="true">
        <add value="index.js" />
        <rule name="Ghost">
          <match url="/*" />
            <add input="{PATH_INFO}" pattern=".+\.js\/debug\/?" negate="true" />
          <action type="Rewrite" url="index.js" />
      See for information regarding iisnode specific configuration options.
    <iisnode node_env="%node_env%" loggingEnabled="false" debuggingEnabled="false" devErrorsEnabled="false" />

Last but not least you have to modify ./core/server.js OR your ./config.js, because we don't want to hook up another server on a different port beside IIS. Gladly iisnode provides the current port as an environment variable:

iisnode port


$environment: {        
    server: {
        host: '',
        port: process.env.PORT

Original ./core/server.js

// ## Start Ghost App
    function () {

Modified ./core/server.js

// ## Start Ghost App
    typeof process.env['PORT'] !== 'undefined' 
        ? process.env.PORT 
        : ghost.config().server.port,
    function () {


Since I am currently not that familiar with Node.js, I am not sure if this is the way you should do it. Nevertheless it works on my machine(s) pretty good.