Setup Ghost blog on DigitalOcean VPS

Just set up my blogs on the DO VPS. Here I share how I did it.

1. Create a Ghost droplet

Use the Ghost image directly to create a droplet on DigitalOcean.
The current Linux version underneath this Ghost image is Ubuntu 14.04.3 LTS, with Nginx 1.4.6. The version of Ghost is 0.7.

2. Setup Ghost

After you created the droplet, you would get a live Ghost blog immediately without config anything. Try it our using the IP address of your DO droplet in your favourite browser. You will see a Ghost setup page. Use your email to set it up, then you will get a Ghost blog.

3. Import old posts

You can import your previous blog posts easily on the Labs page of Ghost settings. You can see all the setting buttons at your.site.address/ghost. One thing for import is that, if you saved photos in your previous Ghost blogs locally, you have to copy the old /content/images to the new one . That's why putting images online is a good idea when you want to move them around.

4. Change post width

If you like me prefer wider post content and front page, you can edit the screen.css file in /var/www/ghost/content/themes/casper/assets/css/ folder. Change the max-width as you wish. They are at line 919 and 1488. I set mine as 960px.

/* Every post, on every page, gets this style on its tag */
.post {
    position: relative;
    width: 80%;
    max-width: 710px;
    margin: 4rem auto;
    padding-bottom: 4rem;
    border-bottom: #EBF2F6 1px solid;
    word-wrap: break-word;
}

......

/* The main wrapper for our pagination links */
.pagination {
    position: relative;
    width: 80%;
    max-width: 710px;
    margin: 4rem auto;
    font-family: "Open Sans", sans-serif;
    font-size: 1.3rem;
    color: #9EABB3;
    text-align: center;
}

5. Inject analytics code

If you'd like to track your blog visited data, you can use third-party service such as Google Analytics to get this done effortless. Just go to Google Analytics register your account and your domain. Google Analytics will generate the code needs to be injected on your site for you automatically. You just need to paste it on the Code Injection page of your Ghost blog's settings. To verify your GA setting, you can go to the real time data page on your GA account. You will see the real time visitor number. Using another browser tab open your blog to check it. For other information, it might take a few hours or a day to collect them.
You will know how exactly popular your blog is if you write something interesting.

Now you have your blog set up and enjoy writing.


Please read my next post for how to set up another Ghost blog on the same VPS using Docker.