How to Backup your Ghost Blog


With a default install of Ghost, your blog content is saved in a database located at /content/data/ghost.db. Also in your content directory, there is an images directory which contains any images which have been uploaded.

There are two ways currently to back up your Ghost blog. One is through the admin interface and the other is by backing up the entire Ghost folder on your server.

If you use the admin interface, it will give you a file with all of your blog's posts and pages in it. Unfortunately, for now this will not back up your images, just the written content. While that is usually the most important information, to back everything up, you can use the command line.

If you are hosting on a platform like Ghost(Pro) where you don't have access to the file structure, you can still backup via the Admin interface. For the images, you can probably email them asking for them to have as a backup or ask what their backup solution is for your stuff.

Admin Interface

To backup your blog using the admin interface:

  1. Navigate to the labs section in your Ghost admin (http://www.yourblog.com/ghost/settings/labs/).
  2. Click on the 'Export' button at the top and download the file.
    How To Backup Your Ghost Blog - Debug Interface - Export Button
  3. This file contains all the posts and page content. Keep this file as the backup.
  4. If you need to restore the data, on the same page, upload the file and click on the "Import" button.

Command Line

To back up using the command line, you need to be using a host that provides you access to the core files of Ghost. This means that services like Ghost(Pro), or ASmallOrange, or shared hosting platforms will not be able to do this (although I'm sure if you just ask they can provide you a full backup).

  1. SSH into the server where your Ghost blog is living
  2. Stop Ghost from running
    • service ghost stop (on DigitalOcean)
  3. Move to where your Ghost folder lives
    • cd /var/www (for most platforms Ghost lives here)
  4. Copy Ghost to a backup folder
    • sudo cp -r ./ghost ./ghost_backup
  5. Start Ghost back up again
    • service ghost start (on DigitalOcean)
  6. To restore from a backup, stop Ghost, move the entire ghost_backup folder back into where it should be, make sure the permissions are correct (aka owned by the Ghost user), and start Ghost back up again.

That will make a copy of your entire Ghost directory so if something happens, you have a backup. It may also be a good idea for you to move that folder completely off the server so if the whole server disappears you have it backed up elsewhere in case the whole server gets corrupted.

Good luck and let us know if you have any questions!