DocPad websites can be deployed anywhere. Here are a few of the most common deployments.

To a Node.js Hosting Provider

Inside your website's directory

  1. Add the following to your website's package.json file. Add all the dependencies you are using and make sure their versions are correct - as well as ensure all commas are correctly placed.

     "engines" : {
         "node": "0.12",
         "npm": "2"
     "dependencies": {
         "docpad": "6",
         "docpad-plugin-blah": "2"
     "main": "node_modules/.bin/docpad-server",
     "scripts": {
         "start": "node_modules/.bin/docpad-server",
         "test": "node_modules/.bin/docpad generate --debug --silent",
         "info": "node_modules/.bin/docpad info --silent"
  2. For Travis CI support, add a .travis.yml file that contains:

     # March 17, 2015
     language: node_js
     script: "npm test"
       - "0.12"
         - node_modules

For deployment to Heroku

  1. Create a Procfile file inside your project that contains:

     web: node_modules/.bin/docpad-server
  2. Set your heroku instance to run in production mode

     heroku config:add NODE_ENV=production
  3. Follow the rest of the Heroku guide here

For deployment to AppFog

  1. Create a app.js file inside your project that contains:

     module.exports = require(__dirname+'/node_modules/docpad/out/bin/docpad-server');
  2. Follow the rest of the AppFog guide here

For deployment to Windows Azure

  1. Create a deployment script that triggers the static content generation. To create the script run the following command using the Windows Azure Cross-Platform Command-Line Interface:

     azure site deploymentscript --basic -t bash
  2. Modify the file by changing the # Deployment section to the following lines. You can see a complete example of the file here.

     echo Handling deployment.
     # 1. Install npm packages
     if [ -e "$DEPLOYMENT_SOURCE/package.json" ]; then
       npm install --production --silent
       exitWithMessageOnError "npm failed"
       cd - > /dev/null
     # 2. Build DocPad Site
     echo Building the DocPad site
     ./node_modules/.bin/docpad generate
     exitWithMessageOnError "DocPad generation failed"
     # 3. KuduSync
     echo Kudu Sync from "$DEPLOYMENT_SOURCE/out" to "$DEPLOYMENT_TARGET"
     $KUDU_SYNC_COMMAND -q -f "$DEPLOYMENT_SOURCE/out" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.deployment;" 2> /dev/null
     exitWithMessageOnError "Kudu Sync failed"
  3. Last, create a web.config file in the static directory of your site with the URL rewrite rules shown below. These rules remove the HTML extensions from your URLs. You can see the main portions of this web.config file below. You can download the complete file here.

     <rule name="RemoveHTMLExtensions" stopProcessing="true">
         <match url="^(.*)\.html$" />
         <action type="Redirect" url="{R:1}" appendQueryString="true" />
     <rule name="RewriteHTMLExtensions" stopProcessing="true">
         <match url="(.*)" />
             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
         <action type="Rewrite" url="{R:1}.html" />
  4. Follow the rest of the Azure guide here

For deployment to Modulus

  1. Follow getting started guide

For deployment to Docker

  1. There is a docker file that should help with deployments.

Optional: Custom domains

If you're also wanting to use custom domains for your website, follow the Heroku Guide here, or alternatively here is a generic guide:

  1. Login to your domain's DNS manager

  2. Create an CNAME Record for your domain pointing to your app url (e.g.,

To Static Servers (Apache, Nginx, etc.)

  1. Perform a generation for a static production environment using docpad generate --env static

  2. Upload the generated directory to your server's public_html or htdocs directory

    1. If you use rsync, checkout our DocPad rsync deploy script

For deployment to GitHub Pages

  1. Install the GitHub Pages Plugin

     docpad install ghpages
  2. Deploy to GitHub Pages using the plugin

     docpad deploy-ghpages --env static

For deployment to a Cloud Data Storage Provider (AWS S3, Google Storage, etc.)

  1. Checkout the DocPad Sunny Plugin
IRC Chat