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?
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 my referral here 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.
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 email@example.com
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!
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)
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.
Next, I need to find the line that looks like this:
Then, change default port 22 to 1234 (up to you)
# What ports, IPs and protocols we listen for
Finally, restart ssh service with
service ssh restart
Now, try to open another terminal and access to Digital Ocean with:
ssh firstname.lastname@example.org -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
Then, Add CNAME record for www to point to ip address like this (in case user type phonbopit.com and www.phonbopit that will be the same server.
If you use Google App Mail, You can choose Select Record Type -> MX -> ADD GMAIL MX RECORD
After that, DNS Setup look like this:
Next, change your name servers from your domain registrar and change to:
In my case, I use name.com. After login, go to Account -> Domain -> DNS Record
When I finish setup I can verify that the new name servers are registered by running this command:
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
Change my-ghost-blog.com to yoursite.com
Next, config Ghost by open config.js
Scrolling down to Production section, change
to your domain name
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 : Mailgun + DigitalOcean
Next, in /var/www/ghost/config.js add mailgun setup :
Finally, restart ghost service and see your blog alive.
service ghost restart