Fast-track local install for getting Ghost running on your computer or setup for doing theme development

Overview

Running Ghost locally is the easiest way to get your own copy of the software running and be able to do some local development with it. By the end of this guide you will have completed a local Ghost install that runs in development mode using SQLite3.

This install is not suitable for production use or contributing to core.


Prerequisites

To install Ghost locally you will need the following:


Install Ghost-CLI

Ghost-CLI is a commandline tool to help you get Ghost installed and configured for use, quickly and easily. The npm module can be installed with npm or yarn on a local machine, depending on your preference.

npm install ghost-cli@latest -g

Once installed, you can always run ghost help to see a list of available commands.


Install Ghost

In your terminal, cd into an empty directory and run the install command:

ghost install local

Once the install is finished you'll be able to access your new site on http://localhost:2368 and http://localhost:2368/ghost to access Ghost Admin ✨

That's it! You're done.

  • Your publication is setup in development mode with less caching
  • The SQLite3 database is auto-setup and located in /content/data/
  • Logs only go to stdout

Starting & Stopping

Ghost runs in a separate background process and remains running until you stop it or restart your computer. So you may find these commands useful for taming it:

  • ghost stop to stop Ghost
  • ghost start to start Ghost
  • ghost log views logs
  • ghost ls to list all running Ghost blogs

Troubleshooting

For troubleshooting and errors, try searching this documentation and FAQ section to find information about common error messages.


Developing Themes

To work on a Ghost Handlebars Theme locally, your custom theme should always be placed in the top-level /content/themes/ directory.

Live reloading

All edits made to Ghost theme files will automatically reload. If you add any new files to your theme during development, you'll need to restart Ghost to see the changes take effect.

Validating with GScan

GScan is a tool that validates Ghost themes for compatibility with the latest versions of Ghost. Ghost automatically runs this tool when a theme is uploaded or activated. For development purposes, your can also run these checks yourself by locally installing it.

# Install gscan globally
npm install gscan -g

# Scan a theme directory for compatibility
gscan /path/to/ghost/content/themes/casper

# Scan a theme zip file for compatibility
gscan -z /path/to/downloads/theme.zip

GScan can also be accessed at gscan.ghost.org, where you can sign up for the latest updates as a Ghost theme developer.

What's next

You've completed a local Ghost install — congrats! You can now put Ghost through its paces and see what it’s all about, or jump right into developing a custom Ghost theme.

When you're ready ship your site to production, follow one of these guides.

For more information about theme development read the Handlebars theme documentation and check out the tutorials.