Setting up Ghost on Debian Wheezy + nginx reverse proxy

  1. Install Debian Wheezy
  2. Ghost requires Node.js 0.10.x 1

            apt-get install curl
            curl -sL https://deb.nodesource.com/setup | bash -
            apt-get install -y nodejs
    
  3. Follow the instructions to install Ghost
    curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip unzip -uo ghost.zip -d ghost Optionally, move to /var/www/ghost/

            mv ghost /var/www/                
    
  4. By default, Ghost is only accessible from itself, so edit config.js so that it can be accessible by other computers

    // # Ghost Configuration
    // Setup your Ghost install for various environments
    // Documentation can be found at http://support.ghost.org/config/
    var path = require('path'),
        config;
    config = {
    // ### Production
    // When running Ghost in the wild, use the production environment
    // Configure your URL and mail settings here
        .
        .
        .
    server: {
        // Host to be passed to node's `net.Server#listen()`
        host: '127.0.0.1', // <-- CHANGE THIS TO THE SERVER IP
        // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
        port: '2368'
    }
    
  5. Since we configured it to run in 'Production' mode, use the following command to test that it's working in the Ghost directory:

    npm start --production
    
  6. If it's up and running, you can go to http://<IP ADDRESS>/ghost and set up your admin account
  7. To have Ghost run whenever the server starts, choose one of the options for Making Ghost Run Forever
  8. Start Ghost (if using the init.d script):

            service ghost start
    
  9. Have nginx reverse proxy point to Ghost:

    location / {
        proxy_pass        http://<YOUR GHOST IP ADDRESS>:PORT/;
        proxy_redirect    off;
    }
    
  10. DONE!