Configuring Ghost for Production

The installation and configuration to support a Ghost deployment in production is straight forward.

Nginx is a fast multithreaded webserver that can proxy all the connections to the ghost instance. forever is a nodejs tool that ensures scripts continue to run and will automatically restart them if they fail.

  1. Install nginx sudo pacman -S nginx
  2. Install the forever module for node sudo npm install forever -g
  3. Configure ghost vim config.js

    production: {
        url: 'http://production.url.com',
        ...
    
  4. Configure nginx sudo vim /etc/nginx/nginx.conf

    server {
        listen 80;
        server_name localhost;
        client_max_body_size 10m;
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $http_host;
            proxy_pass http://127.0.0.1:2368;
        }
    }
    
  5. Execute a production instance of Ghost NODE_ENV=production forever start index.js
  6. Login to your Ghost instance and enjoy! http://production.url.com/ghost/

Enjoy!