How to Install Ghost on HostGator


  1. Head over to Hostgator and Click on "VPS Hosting"
  2. Select your Size (cannot be the smallest size, not enough memory to install and run Node.js) and whether or not you want register a new domain. Complete the rest of the order.
  3. Once you have completed the order, wait for the email from HostGator saying your VPS has been setup
  4. Once you receive their email with your VPS instructions, ssh into your server (use the username, password, and IP address they sent you):
  5. ssh root@192.254.168.240
  6. Update the Server:
    sudo yum update
    sudo yum upgrade
    sudo yum groupinstall "Development Tools"
  7. Install Node.js:
    curl -sL https://rpm.nodesource.com/setup | bash -
    yum install -y nodejs
  8. Install Ghost:
    sudo mkdir -p /var/www/
    cd /var/www/  
    curl -L -O https://ghost.org/zip/ghost-latest.zip
    sudo unzip -d ghost [Name-of-Ghost-zip].zip     
    cd ghost
    sudo /usr/local/bin/npm install --production
  9. Configure Ghost:
    cp config.example.js config.js
    sudo vi config.js
  10. In the "Production" section, change the following:
    host: '127.0.0.1',
    to
    host: '[your HostGator public IP]',
  11. HostGator comes with Apache installed and running. You need to stop Apache and remove it:
    /usr/sbin/httpd -k stop
    rm -rf /usr/local/apache
  12. Create Ghost User:
    sudo adduser --shell /bin/bash --gecos 'Ghost application' ghost
    sudo chown -R ghost:ghost /var/www/ghost/
    
  13. Log into Ghost User:
    su - ghost
    cd /var/www/ghost/
  14. Start Ghost:
    npm start --production
  15. In a web browser head to the IP address with :2368 at the end (ex 123.456.78.901:2368) that was given to you and you should see Ghost up and running!

Proxy from Port 80 and Keep Ghost Running

There you have it, Node.js is installed, Ghost files are located in /var/www/ghost, and Ghost has been started. You can keep Ghost the way it is currently setup if you do not mind adding :2368 to the end of your url, but we would highly recommend you check out the following two articles to help get your Ghost blog ready:

  • How to Proxy Port 80 to 2368 for Ghost with Nginx

  • Keep Ghost Running with PM2
  • Next Steps:

    Learn Ghost from the Ground Up
    Head to "Ghost for Beginners" to learn everything you need to know about learning and customizing Ghost

    Find the Perfect Ghost Theme
    Go to our Ghost themes section of this site to browse all of your Ghost theme options in one place.