How To Configure and Maintain Ghost from the Command Line

Introduction

Ghost is an exciting new blogging platform focused on getting back to the basics. It allows you to focus on content and presentation without the usual bloat and distractions.

In previous guides, we discussed how to deploy Ghost on DigitalOcean with our one-click install. We also covered how to manage content and how to change themes and
settings
.

In this guide, we will dive a little deeper into the configuration and discuss how to manage some aspects of the application from the command line.

How To Control the Ghost Service

The Ghost application is implemented on a daemon on our Droplet. This means that we can start, stop and restart it easily using Ubuntu’s service command.

We can control the Ghost service like any other service:

Start Ghost:

sudo service ghost start

Stop Ghost:

sudo service ghost stop

Restart Ghost:

sudo service ghost restart

Sometimes, after we’ve made changes to our configuration, it may also be helpful to restart nginx (our web server) as well:

sudo service nginx restart

You shouldn’t have to use these commands often, but they are helpful to know if you are not too familiar with a Linux environment.

How To Back Up Ghost

Backing up Ghost is trivial, so you should do it often.

Ghost stores most of its data in a database called ghost.db.

If you would like to copy this directly, you can do so, but you should stop the Ghost service first:

sudo service ghost stop

You can copy this to your own computer by typing into your local terminal:

scp root@your_ghost_IP_address:/var/www/ghost/content/data/ghost.db .

This will copy it into your current local directory.

To copy themes, issue this command:

ssh -n root@your_ghost_IP_address 'tar zcvf - -C /var/www/ghost/content/themes .' | cat - > ghost_themes.tar.gz

This will create an archive file called ghost_themes.tar.gz with all of your themes in your current local directory.

To back up your images, you can run a similar command, which will create a file calledghost_images.tar.gz:

ssh -n root@your_ghost_IP_address 'tar zcvf - -C /var/www/ghost/content/images .' | cat - > ghost_images.tar.gz

Don’t forget to restart Ghost after you’ve downloaded the data:

sudo service ghost start

Perhaps an easier way of doing this is through the web interface by visiting this page of your site:

domain_name/ghost/debug

You can click the “Export” button to download a copy of your blog content and settings:

Ghost export data

If you need to redeploy, you can always visit this page again and import the data file you just downloaded.

How To Upgrade Ghost

It is important to keep your Ghost installation up-to-date in order to keep yourself secure.

When a new version is released, you can get it from the Ghost website. You will probably have to create an account or sign in.

Search for a download link to the latest version and copy the link by right-clicking or control-clicking on the “Download Now” button and selecting “Copy Link Address” or “Copy Link Location”.

Currently, the URL for the latest version is always here, although that may change in the future:

http://ghost.org/zip/ghost-latest.zip

Log into your Ghost droplet as root. Before upgrading, back up the database to your home computer as we discussed above.

We will need the build-essential package in order to complete the Ghost upgrade. You can install it on your system by typing:

sudo apt-get update
sudo apt-get install build-essential

We will also want to stop the Ghost service before upgrading the files, so that no processes are modifying files as they are being overwritten:

service ghost stop

Change to the web root directory:

cd /var/www/

Type wget followed by the URL for the latest version of Ghost. If you copied the link location, you can paste that here:

wget url_to_ghost_download

Extract the files to the correct location to update the Ghost installation:

unzip -uo ghost*.zip -d ghost

The “-uo” options extract newer versions of files and create new files where necessary. DO NOT forget them or you may wipe out your information!

Next, you have to give control over the files to the Ghost process. You can do that by typing:

chown -R ghost:ghost ghost/*

We will get new dependencies by changing into our ghost directory and using the npm command:

cd /var/www/ghost
npm install

To implement your changes, restart the Ghost service:

service ghost start

How To Test Ghost Configuration Changes

Ghost executes using a number of pre-configured “environments”. Environments dictate which database to use, which URLs to respond to, and how to talk to the back-end server.

We usually run our instance of Ghost in the “production” environment. This is, for the most part, configured correctly to serve your blog on a public-facing site.

If we wish to experiment with some of the settings, we can do so safely by creating a new environment, and then specifying those environments while starting Ghost.

Environments are configured in the config.js file in the document root. Open this file with your text editor:

nano /var/www/ghost/config.js

Inside, you will see some code that looks like this:

var path = require('path'),
    config;

config = {
    development: {
        . . .
        . . .
    },

    production: {
        . . .
        . . .
    },

    otherEnvironments: {
        . . .
        . . .
    }
}

Each of the section titles in red defines an environment. If we want to test changes in a new environment, we can copy the “production” environment and make our modifications there.

To do this, we would copy everything between:

production: {

And the matching closing bracket (prior to the start of the next “testing” environment):

},

Directly under the production block that we just copied, we can paste the chunk.

production: {
    . . .
    . . .
},
production: {
    . . .
    . . .
},

Next, change the second “production” to the name of our temporary environment. We will usetemporary.

production: {
    . . .
    . . .
},
temporary: {
    . . .
    . . .
},

Now, we have a new block to experiment with. You can adjust the settings here without worrying about messing up your regular site.

When you are done, save and close the file.

After we are done modifying the “temporary” block, we need to tell Ghost to use this new block. We will do this by adjusting the value in the init script that starts Ghost.

Open the Ghost init script by typing:

nano /etc/init.d/ghost

Find the line that specifies the production environment:

export NODE_ENV=production

Change this to reference your new “temporary” environment:

export NODE_ENV=temporary

Save and close the file.

Now, we can restart Ghost to use our new settings:

service ghost restart

Depending on the changes that you used, you may have to restart nginx as well:

service nginx restart

When you have thoroughly tested your new configuration, you should move your changes from your temporary environment into your production environment.

After that, re-open the init script and change the environment rule back to “production”:

nano /etc/init.d/ghost
export NODE_ENV=production

Again, restart Ghost:

service ghost restart

How To Configure Email for Ghost

Ghost doesn’t use email for very many things. At the time of this writing, it only uses it to send password reset emails. However, without this configured, you will see an annoying banner:

Ghost configure email banner

We need to configure email to get this to go away.

First, we can choose a provider. You can use a number of different email services. Check here for a list of well-known email services that work with Ghost’s emailing system.

It is recommended that you create a new email address associated with the blog. You need to find the SMTP settings for your service. Use google to search:

your email choice SMTP

Some services have different login names and passwords for SMTP than for their regular services. Make sure you find out the information you need. For a Gmail account, for instance, you can use your normal login credentials.

Open the config.js file to input your mail settings:

nano /var/www/ghost/config.js

You need to find the line in the “production” section that deals with mail:

. . .
production: {
    url: 'http://example.com',
    mail: {},
    database: {
    . . .

Between the open bracket { and the closing bracket } of the mail line, you need to enter the following information:

mail: {
    transport: 'SMTP',
    options: {
        service: '',
        auth: {
            user: '',
            pass: ''
        }
    }
},

Now, you need to fill in the service, user, and pass fields with the appropriate values. For theservice, use the name as it is referred to here.

mail: {
    transport: 'SMTP',
    options: {
        service: 'service_name',
        auth: {
            user: 'SMTP_login_name',
            pass: 'SMTP_password'
        }
    }
},

Save and close the file.

Restart Ghost to implement your changes:

service ghost restart

Now, if you log out and click the “forgot password” link, an email will be sent from the SMTP email you just configured to your account email.

Ghost forgotten password

Conclusion

By now, you should have a pretty good grasp on how to do some behind-the-scenes configuration and maintenance for Ghost. You will only have to complete some of these steps once, while others (like backing up) should be run regularly.

How to use Feedburner with your Ghost blog

The following guide outlines how to integrate email subscriptions with your Ghost blog using Feedburner, a is a free service that pushes your blog content to readers who subscribe.

Note: This tutorial assumes that you already have access to an HTML editor capable of recognizing “.hbs” files. If you do not have an HTML editor, there are several free options, such as Brackets.

Setup Feedburner with your Ghost blog

Every Ghost blog has it’s own RSS feed. Your blog’s RSS feed is located atyour-ghost-blog.com/rss. To begin, go to Feedburner and log into your Google account if you aren’t already signed into one. If you do not have a Google account, you can always create one for free. Once logged in, Feedburner will prompt you to enter your blog’s RSS feed URL (i.e. http://your-blog.com/rss).

Burn feed

The next screen will prompt you to enter in a title for your feed as well as allow you to customise the feedburner link.

Give feed title

When you’ve finished, click “Next” to continue.

Congrats

Once your title has been set, the next screen will prompt you to either click “Next” to add additional Feedburner stats to your “feed” or skip ahead to manage your feed. For the purpose of this tutorial, select “Skip directly to feed management” to continue.

Access the “Publicize” settings

Once on the main feed management screen, click on the “Publicize” tab from the top of your screen.

Publicize

Click on “Email Subscriptions” from the “Services” menu

Next, click “Email Subscriptions” from the left side navigation menu to access your email subscription settings.

Email Subscriptions

Activate the email subscription service

Once you’ve reached the email subscription section, you will need to activate the service. To do this, simply click on the “Activate” button.

Activate

Add an email subscription form to your theme

Once email subscriptions have been activated, Feedburner will provide a snippet of form code. You will need to copy this code to your clipboard, so that you can add it to your theme files.

Form snippet

You can place the form snippet anywhere you’d like the subscription form to appear on your theme, however if you’d like the form to appear on every page/post of your blog, the default.hbs file may be an ideal location. Regardless of where you place it, you will need to open the file in an HTML editor, and paste the form code into the file where you’d like the form to display.

You can modify all aspects of the form (i.e. remove or change the style), so long as you retain the form’s action, method, target, onsubmit, and the type="hidden"elements.

Link directly to a signup page
If you’d prefer to link visitors directly to your email subscription signup page when they click on the “Subscribe” button, rather than include a form, you will need to copy the subscription link that appears just below the form code snippet.

Subscription link

Next, you will need to open up your theme files, and replace all links within your theme that reference your RSS URL, {{@blog.url}}/rss/, with your new Feedburner subscription link. In the default Casper theme, you will need to update the navigation.hbs file (found in the partials directory).

Note:If you want to retain the custom RSS feeds for each tag, you will need to create separate feedburner feeds for each tag, using the tag’s specific RSS feed – i.e {{@blog.url}}/tag/{{tag.slug}}/rss/.

When you’ve finished editing your theme, save the file(s) and upload your theme to your blog. When finished, your visitors will be able to subscribe to your blog using their email address, and you will be able to manage and see how many people have subscribed to your blog via Feedburner.

Other RSS to Email Solutions

If you’d prefer to use a different service to push content notifications to subscribers, you can always integrate a subscription form using MailChimp or Campaign Monitor, both of which have an RSS to email service that can work directly with your blog’s RSS feed.

Changing the copyright notice on your blog

Note: This tutorial assumes that you already have access to an HTML editor capable of recognizing “.hbs” files. If you do not have an HTML editor, there are several free options, such as Brackets.

Download a copy of Casper

To start, grab a copy the latest version of Casper, the default theme pre-installed with Ghost.

Extract the theme files

Extract the theme folder from the compressed file to a location on your computer that you can work from.

Extract Casper theme

Open the theme’s default.hbs file

Once you’ve extracted, find and open the default.hbs file in your HTML editor.

Open file

Locate the copyright information code

Now that you’ve opened the default.hbs file, scroll down towards the bottom of the file. You should see a piece of code that looks similar to this:

Copyright code

Update the code

Once you’ve located the copyright code, you can edit and format it (or delete it entirely) to suit your needs. For example, you may want to remove the link to Ghost, or remove your RSS information. Anything you change here will update across the bottom of your entire website.

Save your default.hbs file

After you’ve updated your copyright information, save the file.

Save theme file

Upload your theme

Now that you’ve saved your theme, you can then upload it to your blog. Once uploaded, your new copyright notice information will be reflected immediately.

How do I configure Ghost (blog)?

After running Ghost for the first time, you’ll find a file called config.js in the root directory of Ghost, along with index.js. This file allows you to set environment level configuration for things like your URL, database, and mail settings. If you haven’t yet run Ghost for the first time, you won’t have this file yet. You can create one by copying the config.example.js file and calling it config.js – that’s what Ghost does when it starts.

As part of installing Ghost, you will need to configure the url and mail settings. To configure your Ghost settings, open config.js in your favourite editor (if you don’t have one, we recommend brackets, and start changing the settings for your desired environment. If environments aren’t something you’ve come across yet, please read of the about environments section below.

Using Mailgun?If you want to use MailGun for your email service, you can use the official Mailgun config.js generator to create a config.js file with the correct url and mail settings.

Configuration options

Ghost has a number of configuration options which you can add to change things about how Ghost works. The first two options, url and mail need to be edited when you first start your Ghost blog, in order for it to function correctly.

Name Required? Description
url Yes Set the public URL for your blog
mail Yes Add a mail service so that Ghost can send emails such as forgotten password and user invite emails
database Yes The type of database that Ghost uses. This is configured to sqlite3 by default and does not need editing
server Yes Host and port, or socket for Ghost to listen on
compress No Disable gzip compression
fileStorage No Disable storage in the local file system
updateCheck No Deprecated Please use privacy.useUpdateCheck instead
privacy No Disable the Ghost features listed in PRIVACY.md, e.g. update check, rpc ping, and google fonts
forceAdminSSL No Force SSL (secure HTTP or https) for the admin panel
urlSSL No Define a second url for use with SSL (secure HTTP or https)
paths No Customise Ghost’s internal paths, e.g. to the content directory

URL

One of the first things you’ll need to do after installing a Ghost blog, is set the URL for your blog inconfig.js. This URL must match the URL you will use to access your blog, if it is not set correctly you may get the error Access Denied from url as well as finding that RSS and other external links do not work correctly.

url should be set to the full URL for your blog including http:// or if you are using SSL for your blog and want both the admin and frontend to always be served securely, use https://. See the section on SSL configuration for more information about how to configure your URL if you want to use SSL for just the admin or only for secure requests.

If you want to Ghost to appear on a subpath or subdirectory of your domain, e.g.http://my-ghost-blog.com/blog/ the full path needs to be specified in the url field. This option is only available when self-hosting Ghost.

If you get the error Access Denied from url: someurl.com. Please use the url configured in config.js, this means there is a mismatch between the url configured in your config.js, and the url you used to access your blog’s admin panel. To solve this you must either update your config.js file so the url is correct, or change to using the url already configured in config.js when accessing the admin panel.

Note: As with any config.js change, once you’ve updated your url field so that your url is correct, you’ll need to restart Ghost for it to take effect.

Email

Possibly the most important piece of configuration is setting up email so that Ghost can let you reset your password if you forget it. We have a separate guide to email configuration which will guide you through this process. This includes documentation on mail.from which allows you to customise the email address which mail is sent from.

SSL

Ghost has a number of configuration options for working with SSL, and securing the URLs for the admin (/ghost/) and the frontend of your blog. SSL is very important for the admin panel, without SSL your username and password are sent in plaintext. SSL ensures your details are kept private.

For details of how to setup SSL, please follow our SSL Guide

If you just setup SSL for your blog, and leave your url starting with http://, Ghost will serve requests made via HTTPS securely, and leave plain HTTP requests alone. Insecure and secure requests will both be available, and there will be no redirects from one to the other.

If you setup SSL for your blog and change your url to https://, Ghost will serve all requests securely, all requests made via plain HTTP will be redirected to HTTPS. Your blog will always be secure.

If you only want to serve your admin panel (i.e. /ghost/) via SSL, then you can leave your url as starting with http:// and instead set the following option:

forceAdminSSL: true

This will force any HTTP requests for the admin to be redirected via HTTPS. If you would prefer to reject insecure requests (403 error), rather than redirect them, you can enforce this by setting forceAdminSSL as follows:

forceAdminSSL: {redirect: false}

If you’d like to serve the SSL version of your blog from a different URL to the one configured in urlyou can do so by configuring an alternative:

url: http://myblog.com,
urlSSL: https://secure.myblog.com

Database

By default, Ghost comes configured to use an SQLite database, which requires no configuration.

Alternatively Ghost can also be used with a MySQL database by changing the database configuration. You must create a database and user first, you can then change the existing sqlite3 config to something like:

database: {
  client: 'mysql',
  connection: {
    host     : '127.0.0.1',
    user     : 'your_database_user',
    password : 'your_database_password',
    database : 'ghost_db',
    charset  : 'utf8'
  }
}

You can also limit the number of simultaneous connections should you wish, by using the pool setting.
The default values are min: 2, max: 10, which means Ghost will always maintain 2 active database connections. You can set min: 0 to prevent this.

database: {
  client: ...,
  connection: { ... },
  pool: {
    min: 2,
    max: 20
  }
}

Ghost can also be used with PostGreSQL. Support for Postgres is currently second class compared to SQLite & MySQL – there is a build run against it, but very minimal manual testing. At present we are considering downgrading support to ‘community’ – this means we will permit the builds to fail, accept patches, but not manage support or any manual testing within the core team. Therefore using pg with Ghost should only be done if you’re comfortable patching issues.

More details about the database configuration can be found in the knex library documentation.

Server

The server host and port are the IP address and port number that Ghost should listen on for requests. In the majority of cases this will not need to be changed, with requests being routed from port 80 to Ghost by either nginx (recommended) or apache.

server: {
    host: '127.0.0.1',
    port: '2368'
}

Unix Sockets

Ghost can also be configured to listen on a unix socket by changing the server config to something like:

server: {
    socket: 'path/to/socket.sock'
}

The default permissions are 0660, but this can also be configured by expanding the socket config:

server: {
    socket: {
        path: 'path/to/socket.sock',
        permissions: '0666'
   }
}

Gzip Compression

As of Ghost 0.5, gzip compression is enabled by default. This results in significant improvements to page load speed. You can disable this feature with the following option:

compress: false

Privacy

As of Ghost 0.5.2, there are a set of configuration options available to turn off all of the features listed in the PRIVACY.md file. All of these feature are enabled by default, but users may choose to turn them off in order to protect their privacy.

If you simply want to turn off all of these features, you can do so by adding the following to your config.js (please note once the useTinfoil flag is set to true, no other privacy flags will take effect):

privacy: {
    useTinfoil: true,
}

Alternatively, you can configure each of the features individually.

privacy: {
    useUpdateCheck: false,
    useGoogleFonts: false,
    useGravatar: false,
    useRpcPing: false,
    useStructuredData: false
}

Update Check

Ghost 0.4 introduced an automatic update check service to let you know when a new version of Ghost is available (woo!). Ghost.org collects basic anonymous usage statistics from update check requests. For more more information, see the update-check.js file in Ghost core.

See PRIVACY.md#automatic-update-checks for more details.

Disable with:

privacy: {
    useUpdateCheck: false
}

Please be sure to subscribe to emails from Ghost, or the dev blog, so that you are still informed about new versions.

Google Fonts

See PRIVACY.md#google-fonts for more details.

Disable with:

privacy: {
    useGoogleFonts: false
}

Please Note this will not disable any Google Fonts used by your theme.

Gravatar

See PRIVACY.md#gravatar for more details.

Disable with:

privacy: {
    useGravatar: false
}

RPC Ping

See PRIVACY.md#rpc-pings for more details.

Disable with:

privacy: {
    useRpcPing: false
}

Structured Data

See PRIVACY.md#structured-data for more details.

Disable with:

privacy: {
    useStructuredData: false
}

File Storage

Some platforms such as Heroku do not have a persistent file system. As a result of this, any uploaded images are likely to go missing at some point. It is possible to disable Ghost’s file storage features:

fileStorage: false

When file storage is disabled, Ghost’s image upload tools will prompt you to enter a URL by default, thereby preventing you from uploading files that will go missing.

Paths

If you wish to use a content directory that does not live inside the Ghost folder, then you can do this by specifying a paths object with a new contentPath:

paths: {
    contentPath: path.join(__dirname, '/path/to/content/dir/')
},

Please note that if you are using an SQLite database, you will also need to update the path to your database to match the new location of the data folder. The content directory must contain sub directories for apps, data, images and themes or Ghost may fail to start. In future it’s intended that Ghost will offer more fine-grained control via the paths object.

About Environments

Node.js, and therefore Ghost, has the concept of environments built in. Environments allow you to create different configurations for different modes in which you might want to run Ghost. By default Ghost has two main built-in modes: development and production. There are also configurations for several testing environments in the config.js file. You do not need to remove configuration you aren’t using.

The differences between the two modes mean that development is geared towards developing and debugging Ghost, whereas production is intended to be used when you’re running Ghost as a real live blog. You’ll find the log output is different in the two modes, the level of concatenation and minification of assets like js and css is higher in production mode, development mode provides more warnings about potential problems with themes and possibly the most noticable difference is that theme template files are cached in production mode so you’ll want to use development mode when creating themes. Essentially, production mode gives priority to performance, whereas development mode gives priority to information.

As Ghost progresses, these differences will grow and become more apparent, and therefore it will become more and more important that any public blog runs in the production environment. This perhaps begs the question, why development mode by default, if most people are going to want to run it in production mode? Ghost has development as the default because this is the environment that is best for debugging problems, which you’re most likely to need when getting set up for the first time.

Using Environments

In order to set Ghost to run under a different environment, you need to use an environment variable. For example if you normally start Ghost with node index.js you would use:

NODE_ENV=production node index.js

Or if you normally use forever:

NODE_ENV=production forever start index.js

Or if you’re used to using npm start you could use the slightly easier to remember:

npm start --production

Why use npm install –production?

We have been asked a few times why, if Ghost starts in development mode by default, does the installation documentation say to run npm install --production? This is a good question! If you don’t include --production when installing Ghost, nothing bad will happen, but it will install a tonne of extra packages which are only useful for people who want to develop Ghost core itself. This also requires that you have one particular package, grunt-cli installed globally, which has to be done with npm install -g grunt-cli, it’s an extra step and it’s not needed if you just want to run Ghost as a blog.

What is the Ghost (blog) markdown?

Blog posts in Ghost are written using Markdown. Markdown is a minimal syntax for marking up your documents with formatting, using punctuation and special characters. For those new to Markdown, this guide will help you become familiar with the full list of shortcuts and a few of our own additions. Ghost’s version of markdown is a combination of standard Markdown, GitHub Flavored Markdown, and other useful features like footnotes.

Note:All HTML is valid Markdown. If you’re stuck not able to format your content how you would like (for example using tables) you can always use plain HTML instead of Markdown.

Markdown Help

The most common formatting options have keyboard shortcuts to make them easier to add:

Result Markdown Shortcut
Bold **text** Ctrl/⌘ + B
Emphasize *text* Ctrl/⌘ + I
Strike-through ~~text~~ Ctrl + Alt + U
Link [title](http://) Ctrl/⌘ + K
Inline Code `code` Ctrl/⌘ + Shift + K
Image ![alt](http://) Ctrl/⌘ + Shift + I
List * item Ctrl + L
Blockquote > quote Ctrl + Q
H1 # Heading
H2 ## Heading Ctrl/⌘ + H
H3 ### Heading Ctrl/⌘ + H (x2)

Headers

Headers are set using a hash before the title. The number of hashes before the title text will determine the depth of the header. Header depths are from 1-6

  • H1 : # Header 1
  • H2 : ## Header 2
  • H3 : ### Header 3
  • H4 : #### Header 4
  • H5 : ##### Header 5
  • H6 : ###### Header 6

Text Styling

  • Links : [Title](URL)
  • Bold : **Bold**
  • Italicize : *Italics*
  • Strike-through : ~~text~~
  • Highlight : ==text==
  • Paragraphs : Line space between paragraphs
  • Line break : Add two spaces to the end of the line
  • Lists : * an asterisk for every new list item.
  • Quotes : > Quote
  • Inline Code : `alert('Hello World');`
  • Horizontal Rule (HR) : --------

Images

To insert an image into your post, you need to first type ![]() into the Markdown editor panel. This will create an image upload box in your preview panel.

add image box

You can drag and drop images (.png, .gif, .jpg) from your Desktop over the image upload box to include it into your post, or alternatively click the image upload box to use a standard image upload popup. If you prefer to include an image url, click the “link” icon in the bottom left corner of the image upload box, this will then present you with the ability to insert an image URL.

image url

To title your image, all you need to do is place the title text inbetween the square brackets, e.g; ![This is a title]().

Be sure read How to Add an Image to Your Post for a full instruction on image handling with your Ghost blog.

Footnotes

Footnotes can be added to the body of your text using placeholders like this: [^1]. Alternatively you can use ‘n’ rather than numbers [^n] so you don’t have to worry about which number you are on. At the very end of your post, you can define your matching footnotes as shown below, URLs will be turned into links:

[^1]: This is my first footnote
[^n]: Visit http://ghost.org
[^n]: A final footnote

Writing Code

Inline code can be added using single back-ticks E.g. `alert('Hello World')`.

For code blocks, Ghost supports both standard markdown code blocks and the syntax from GitHub Flavored Markdown (GFM). Standard markdown works by indenting code lines with 4 spaces:

    <header>
        <h1>{{title}}</h1>
    </header>

GFM uses triple back-ticks ```

```
<header>
    <h1>{{title}}</h1>
</header>
```

Examples

Link Markdown Example

This is a paragraph that contains a [link to ghost](http://ghost.org).

List Markdown Example

This paragraph contains a list of items.

* Item 1
* Item 2
* Item three

Quote Markdown Example

This paragraph has a quote

> That is pulled out like this

from the text my post.

More Resources: HTML.com

How To Use the DigitalOcean Ghost Application

Introduction

Want to create a simple to use and beautiful blog with Ghost? Thanks to DigitalOcean’s one-click “application” installation, you can create a droplet with Ghost pre-installed, running and ready to go in just a few short minutes!

The instructions below will take you from zero to blog, but they do assume that you already have an account with DigitalOcean. If you haven’t, then head on over to the sign up page.

Step 1: Create a Ghost Droplet

In your DigitalOcean control panel, press the Create Droplet button, to be taken to the creation screen.

Droplet Hostname: You’ll first be asked for a “hostname” – this is the name of your Droplet so you can identify it if you have a few. The name should not contain any spaces or special characters.

Select Size: There are 6 size options, but the smallest 512MB should be plenty for the majority of blogs. If you run out of resources, you can always upgrade later.

Select Region: Choose the region closest to you, or to your target audience.

Select Image: This is the important part! Under ‘Select Image’ choose ‘Applications’ and then select ‘Ghost on Ubuntu 12.04’.

Ghost

You’re nearly there! Hit the big green ‘Create Droplet’ button, and a new Droplet will be created for you, with all of the things you need to run Ghost – such as Node.js, nginx and including Ghost itself – already configured and setup.

Creating a new droplet

Once your Droplet is ready, you’ll see a screen like this one:

Droplet ready

If you open the IP address – which is 162.243.43.52 in the example above – in your favourite browser, you’ll see your new Ghost blog is already up and running!

Step 2: Setting up a domain name

You now have your very own Ghost blog, but accessing it via an IP address probably isn’t what you want. There are 3 steps to setting up a custom domain.

  1. Change the nginx configuration to match your domain name.In your control panel, select your droplet, and choose ‘access’, then press the ‘Console Access’ button. Once your console loads you’ll need to log in. You should have received an email from DigitalOcean with the login details for your new droplet.

    Type nano /etc/nginx/sites-available/ghost to open the nginx config file for editing in thenano editor. Change the current server_name from my-ghost-blog.com to your domain name.

    nginx config

    Note on using nano: Use the arrow keys to move the cursor around not the mouse. When you’re finished, press ctrl + x to exit. Nano will ask you if you want to save, type y for yes, and pressenter to save the file.

  2. Edit the Ghost configuration fileStill in the control panel, enter nano /var/www/ghost/config.js to open the Ghost configuration file for editing.

    The Ghost config.js file contains configuration for different environments, your Droplet is automatically configured to run in production mode. Production mode comes second in the configuration file, after development mode. Move down the file until you find the production url setting, and change this to your domain name.

    Ghost config

    There are several other options in this file which can be configured, see the Ghost usage documentation for more information.

  3. You’ll need to follow DigitalOcean’s instructions on how to point your domain name at your server.

Step 3: Get Blogging

Browse to your newly configured blog, and then change the url to your-url/ghost. You’ll see the Ghost sign up screen. Enter your details to create your admin user account. You’ll be automatically logged in when you’re done.

Ghost signup

Once you’ve logged in, you’ll be taken to the Ghost content screen. You’ll see a welcome blog post, and a green + button. Press that button to get started writing your first blog post in Ghost.

Maintaining your blog

You now have a fully working Ghost blog. Your Ghost Droplet is setup to make it as easy as possible to look after your blog in the long term.

Starting and stopping Ghost

Under certain situations, such as installing themes or upgrading, you may need to start, stop, or restart your Ghost blog. You can do this by using the start, stop and restart commands provided by the Ghost service. For example, after installing a theme, you can restart Ghost by typing service ghost restart. To see the current status of your Ghost blog just type service ghost status.

Upgrading Ghost (updated as of Ghost 0.4)

  • First you’ll need to find out the URL of the latest Ghost version. It should be something likehttp://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
  • Remove the old core directory by typing 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 your Ghost directory with cd ghost, then run npm install --production to get any new dependencies
  • Finally, restart Ghost so that the changes take effect using service ghost restart

Conclusion

DigitalOcean’s one-click application feature (and the image created by Sebastian Gierlinger) makes it incredibly easy to get started blogging with Ghost.

This article details 3 steps, but Ghost is running and ready for you to add blog posts by the end of the first, head over to the Ghost Guide for more information on how to get the most out of Ghost.

We hope you enjoy blogging with Ghost, and continue to find maintaining your Ghost installation on DigitalOcean straightforward!

Original Article by Hannah Wolfe 

How do I change the excerpt to show all content?

To display the full content of your Ghost posts from within your post list, follow these simple steps below to get started.

Open the index.hbs file of your theme

From within your theme directory, find and open your index.hbs file in your HTML editor. The index.hbs template is the template for the homepage, and gets passed a list of posts which should be displayed (and how they should be displayed).

open index.hbs file

Locate the {{excerpt}} helper

The {{excerpt}} helper outputs content, but strips out all HTML, creating an excerpt of each post. In some cases, you may wan to show the full content, rather than the excerpt. To do this, locate the{{excerpt}} from within your index.hbs file, found in the partials directory.

NoteIf using the default theme, Casper, you will need to edit the loop.hbs file, found in the partials directory

find excerpt helper

To show full content, change {{excerpt}} to {{content}}

To output the full text of the post on your post list, change the {{excerpt}} to {{content}} as shown in the below:

switch excerpt for content

Create a custom excerpt that includes HTML

If you’d like create a custom excerpt, that includes HTML, you can change {{excerpt}} to {{content words=”100″}}` which will output 100 words of HTML, with correctly matched tags. So, for example, our code would look like this below:

custom exerpt

Save your theme

Once you’ve modified your index.hbs file to accommodate the type of content you want to display, and how it should look, save your theme and upload it to your blog for the changes to take effect immediately.

Original Article from Ghost.org