Installing Ghost & Getting Started

The first steps to setting up your new blog for the first time.

Upgrading Ghost

Upgrading Ghost is super straightforward.

There is a couple of different ways you might want to go about it. The following describes what needs to happen, and then covers the process step-by-step for both doing it point-and-click style and via a command line, so that you are free to choose the method you are most comfortable with.

Back-it-up! Always perform a backup before upgrading. Read the backup instructions first!

Overview

Ghost, once installed, has a folder structure similar to that shown on the left. There are two main directories content and core, plus some files in the root.

Upgrading Ghost is matter of replacing the old files with the new files, re-running npm install to update the node_modules folder and then restarting Ghost to make it all take affect.

Remember, by default Ghost stores all your custom data, themes, images, etc in the content directory, so take care to keep this safe! Replace only the files in core and the root, and all will be fine.

Backing Up

  • To backup all the data from your database, log into your Ghost install and go to /ghost/debug/. Press the export button to download a JSON file containing all of your data. Job done
  • To back up your custom themes and images, you need to take a copy of the files inside of content/themes and content/images

Note: You can, if you like, take a copy of your database from content/data but be warned you should not do this whilst Ghost is running. Please stop it first.

How to Upgrade

How to upgrade on your local machine

WARNING: Do NOT copy and paste the entire Ghost folder over the top of an existing installation on mac. Do NOT choose REPLACE if uploading with Transmit or other FTP software, choose MERGE.

  • Download the latest version of Ghost from Ghost.org
  • Extract the zip file to a temporary location
  • Copy all of the root level files from the latest version. This includes: index.js, package.json, Gruntfile.js, config.example.js, the license and readme files.
  • Next, delete the old core directory completely, and then put the new core directory in its place.
  • For releases which include update to Casper (the default theme), delete the old content/themes/casper directory and put the new one its place
  • Run npm install --production
  • Finally, Restart Ghost so that the changes take effect

Command line only

Back-it-up! Always perform a backup before upgrading. Read the backup instructions first!

Command line only on mac

The screencast below shows the steps for upgrading Ghost where the zip file has been downloaded to ~/Downloads and Ghost is installed in ~/ghost Note: ~ means the user's home directory on mac and linux

Upgrade ghost

The steps in the screencast are:

  • cd ~/Downloads - change directory to the Downloads directory where the latest version of Ghost has been saved
  • unzip ghost-0.4.0.zip -d ghost-0.4.0 - unzip ghost into the folder ghost-0.4.0
  • cd ghost-0.4.0 - change directory into the ghost-0.4.0 directory
  • ls - show all the files and folders inside this directory
  • cp *.js *.json *.md LICENSE ~/ghost - copy all .md .js .txt and .json files from this location to ~/ghost
  • rm -rf ~/ghost/core - delete the old core directory
  • cp -R core ~/ghost - copy the core directory and all of its contents to ~/ghost
  • cp -R content/themes/casper ~/ghost/content/themes - copy the casper directory and all of its contents to ~/ghost/content/themes
  • cd ~/ghost - change directory to the ~/ghost directory
  • npm install --production - install Ghost
  • npm start - start Ghost

Command line only on linux servers

  • First you'll need to find out the URL of the latest Ghost version. It should be something like http://ghost.org/zip/ghost-latest.zip.
  • Fetch the zip file with wget http://ghost.org/zip/ghost-latest.zip (or whatever the URL for the latest Ghost version is).
  • Delete the old core directory from your install
  • Unzip the archive with unzip -uo ghost-latest.zip -d path-to-your-ghost-install
  • Run npm install --production to get any new dependencies
  • Finally, restart Ghost so that the changes will take effect

Additionally, howtoinstallghost.com also has instructions for upgrading Ghost on linux servers.

How to update a DigitalOcean Droplet

Back-it-up! Always perform a backup before upgrading. Read the backup instructions first!

  • First you'll need to find out the URL of the latest Ghost version. It should be something like http://ghost.org/zip/ghost-latest.zip.
  • Once you've got the URL for the latest version, in your Droplet console type cd /var/www/ to change directory to where the Ghost codebase lives.
  • Next, type wget http://ghost.org/zip/ghost-latest.zip (or whatever the URL for the latest Ghost version is).
  • Remove the old core directory, rm -rf ghost/core
  • Unzip the archive with unzip -uo ghost-latest.zip -d ghost
  • Make sure all of the files have the right permissions with chown -R ghost:ghost ghost/*
  • Change into the ghost directory with cd ghost
  • Run npm install --production to get any new dependencies
  • Finally, restart Ghost so that the changes take effect using service ghost restart (this can take a little while)

How to upgrade Node.js to the latest version

If you originally installed Node.js from the Node.js website, you can upgrade Node.js to the latest version by downloading and running the latest installer. This will replace your current version with the new version.

If you are on Ubuntu, or another linux distribution which uses apt-get, the command to upgrade node is the same as to install: sudo apt-get install nodejs.

Note to Ubuntu users: from Ubuntu 12.04 to 13.04, an old version (0.6.x) of Node is in the standard repository. Ghost requires Node 0.10.x. To install it, follow the instructions on Node wiki.

You do not need to restart the server or Ghost.