How to deploy a Ghost blogging platform to Digital Ocean

Chai Phonbopit
Jan 21, 2016 · 4 min read

This post I am going to talk about how to install ghost blogging platform, set up DNS, Config Digital Ocean droplet and create articles on Digital Ocean.

Why I use Digital Ocean?

Image for post
Image for post
DigitalOcean Home Page

Because most of shared hosting provider doesn’t support Node.js. Then I looking for VPS instead and I found Digital Ocean, it offer just only $5 a month and one-click “application” installation. It’s mean you can create a ghost blogging just a minute. That’s easy!

If you need a Digital Ocean account, you can register with to get $10 free.

Step 1: Create Droplet

Firstly, Login to your Digital Ocean account, then click Create Droplet button, Choose One-Click Apps and select Ghost 0.8.0 on Ubuntu 14.04, select size and select datacenter depend on your.

Image for post
Image for post
Create Ghost with One-click apps

Then click Create and waiting for less than 1 minute, your droplet information (username and password) will be send to your email.

Login to your host, If your machine is Windows use PuTTy, if you used *nix you can run on Terminal. (Assuming 123.456.7.8 is your droplet ip)

$ ssh root@123.456.7.8

You’ll see welcome message like this

Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-71-generic x86_64)


* Documentation: https://help.ubuntu.com/

After logged in, System will force you to changing a password.

$ Changing password for root.
$ (current) UNIX password:
$ Enter new UNIX password:
$ Retype new UNIX password:

Now your ghost is available. When you put URL to 123.456.7.8 you will see your Ghost, Cool!

Image for post
Image for post

Setup 2 : Secure a droplet

Back to my droplet, every time when I access to droplet with ssh default port is 22 and user is root, I should change default port and user root for protected

Create a new user named chai (you can change a name whatever you like)

adduser chai

and then there is a prompt to fill additional information and strong password.

Add permission to allow chai user run super user command:

gpasswd -a demo sudo

Then, disable remote SSH access to the root account.

vi /etc/ssh/sshd_config

Next, I need to find the line that looks like this:

PermitRootLogin yes

change to

PermitRootLogin no

Then, change default port 22 to 1234 (up to you)

# What ports, IPs and protocols we listen for 
Port 1234

Finally, restart ssh service with

service ssh restart

Now, try to open another terminal and access to Digital Ocean with:

ssh chai@123.456.7.8 -p 1234

You can access like a root user. Well done!

Note: Use -p follow by port_number in case you change your default port

Step 3: Config DNS

This step to config DNS for mapping domain name, use domain name instead of typing ip address.

Back to your Digital Ocean Control Panel, click -> Networking -> Domains and then click Create Record

Image for post
Image for post

Then, Add CNAME record for www to point to ip address like this (in case user type phonbopit.com and that will be the same server.

Image for post
Image for post

If you use Google App Mail, You can choose Select Record Type -> MX -> ADD GMAIL MX RECORD

After that, DNS Setup look like this:

Image for post
Image for post

Next, change your name servers from your domain registrar and change to:

ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com

In my case, I use . After login, go to Account -> Domain -> DNS Record

Image for post
Image for post

When I finish setup I can verify that the new name servers are registered by running this command:

whois phonbopit.com

Step 4: Setup Ghost

Back to VPS, after setup DSN, now change the nginx configuration to match your domain name and ghost configuration.

setup nginx by open default.conf

vi /etc/nginx/sites-available/ghost

Change my-ghost-blog.com to yoursite.com

Next, config Ghost by open config.js

vi /var/www/ghost/config.js

Scrolling down to Production section, change

url: 'http://my-ghost-blog.com'

to your domain name

url: 'http://yourdomain.com'

Next, setup mail server for send email to you when you forgot a password, I use , after registered,

After created, you need to verify ownership of your domain by adding some DNS records to you domain to more detail here this very useful article :

Next, in /var/www/ghost/config.js add mailgun setup :

mail: {  
transport: 'SMTP',
options: {
service: 'Mailgun',
auth: {
user: 'username@mailgun.com',
pass: 'mailgunpassword'
}
}
}

Finally, restart ghost service and see your blog alive.

service ghost restart

That’s it!

Today I Learned ❤️Chai

Chai's learning journey about Web development (Node.js

Chai Phonbopit

Written by

I make web stuff with JavaScript (Node & React), Blogger at https://devahoy.com 🤖(Web Development) and https://indyrover.com 🚀 (Lifestyle)

Today I Learned ❤️Chai

Chai's learning journey about Web development (Node.js + React), Lifestyle, Travel and Self Improvement.

Chai Phonbopit

Written by

I make web stuff with JavaScript (Node & React), Blogger at https://devahoy.com 🤖(Web Development) and https://indyrover.com 🚀 (Lifestyle)

Today I Learned ❤️Chai

Chai's learning journey about Web development (Node.js + React), Lifestyle, Travel and Self Improvement.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface.

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox.

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store