So I wanted to leave Medium and I did not want to use Jekyll for my daily blog environment (I still love Jekyll but I need a bit more simplicity for a blog to work with) so I searched for another option. Ghost! But not at Ghost.org, I don’t mind paying, but 29 dollar per month… I do blogging for fun not because I like to go bankrupt. So I decided to install Ghost on a Digital Ocean Droplet.
Stuff to do upfront to get Ghost on Digital Ocean
Now let me tell you one thing, installing Ghost on a Digital Ocean droplet is easy peasy! But you need to do some stuff upfront!
First, it might be an open door but you need a Domain! It can be a sub-domain or a www kind of domain or an origin… it does not matter, you need a domain!
Now you might already have a domain, but do understand you have to couple your domain to the ip address upfront to be ready for some downtime if you already have a blog on that domain.
I did not want downtime on my vandersluijs.nl site and I wanted to test and experiment with ghost so I just used my other vandersluijs domain, .XYZ.
So if you have a unused domain or you don’t mind the downtime. You are good!
Be ready to change your DNS settings to the new IP address.
The second thing you need is an SSH key on your Linux or Mac. Windows users… please find yourself somebody with real computer knowledge or just pay 29 dollars per month on Ghost.org, this is way over your head.
So generating a SSH Key is easy (if you already have one on you pc, skip all of this)
The first step is to create a key pair on the client machine (usually your computer):
ssh-keygen will create a 2048-bit RSA key pair, which is secure enough for most use cases (you may optionally pass in the
-b 4096 flag to create a larger 4096-bit key).
After entering the command, you should see the following output:
OutputGenerating public/private rsa key pair.Enter file in which to save the key (/your_home/.ssh/id_rsa):
Press enter to save the key pair into the
.ssh/ subdirectory in your home directory, or specify an alternate path.
If you had previously generated an SSH key pair, you may see the following prompt:
Output/home/your_home/.ssh/id_rsa already exists.Overwrite (y/n)?
If you choose to overwrite the key on disk, you will not be able to authenticate using the previous key anymore. Be very careful when selecting yes, as this is a destructive process that cannot be reversed.
You should then see the following prompt:
OutputEnter passphrase (empty for no passphrase):
Here you optionally may enter a secure passphrase, which is highly recommended. A passphrase adds an additional layer of security to prevent unauthorized users from logging in. To learn more about security, consult our tutorial on How To Configure SSH Key-Based Authentication on a Linux Server.
You should then see the following output:
OutputYour identification has been saved in /your_home/.ssh/id_rsa. Your public key has been saved in /your_home/.ssh/id_rsa.pub. The key fingerprint is: a9:49:2e:2a:5e:33:3e:a9:de:4e:77:11:58:b6:90:26 username@remote_host The key's randomart image is: +--[ RSA 2048]----+ | ..o | | E o= . | | o. o | | .. | | ..S | | o o. | | =o.+. | |. =++.. | |o=++. | +-----------------+
You can copy your SSH key by opening it with
Just copy what’s inside, you will need it later.
New Digital Ocean Droplet for Ghost
As you know Ghost is a fully open source, adaptable platform for building and running a modern blog or publication. On Digital Ocean there is a so called Ghost 1-Click App that allows you to self-host your own Ghost instance up and running in two minutes.
YES, 2 MINUTES!
That is if you know what you are doing! 🙂
If you click the above button, you will start building your Ghost droplet under 2 minutes in a few steps! And if you are new to digital ocean You will get $100 in credit over 60 days. Yes… $100 in credit for FREE!!
So the steps are:
- Click the darn button!
- Choose a plan: If you don’t have a big audience yet, pick the “Standard” $5 per month plan!
3. Choose a datacenter region: Pick a Data Center near where you live. Im in The Netherlands so I pick Amsterdam
4. Authentication: Remember you copied your SSH key? You need it in this step. Click the New SSH Key button, paste your key, name it and click “Add SSH Key”. Select the new key for your droplet.
5. Scroll down, and click “Create Droplet”
And you are done!
Well almost! In the background Digital Ocean will setup your environment. This will take like a few minutes so just grab a coffee, I also like coffee by the way!
Getting your Ghost DNS ready
When you Ghost droplet is ready you will see something like this.
If you hover over the IP address (that’s the 126.96.36.199 in the above image) you can click and copy it.
You need this IP address for your domain.
Go to what ever webhost / domain host provider you have and create an A DNS record and use the just copied IP address.
Use your own IP address not the IP address I used in this article. If you use my IP address you will connect your domain to a my IP address.
Now you have to wait! It depends on your domain provider. As you can see I’ve got my TTS at 10 minutes (that’s crazy short, normal is 4 or 8 hours), but you have to wait until the whole of internet knows that your domain is connected to the IP address.
You can test it as following. Go to the MXToolbox. Use your domain, press DNS Lookup and when you see the right IP address, you are ready to go to the next step!
If you mix up the steps within this article you will be having a site without https protocol, and Google does not like that very much.
Getting Ghost running on Digital Ocean
So, now you can really set up the Ghost environment. From a terminal on your local computer, connect to the Droplet as
root. Make sure to substitute the IP address of the Droplet.
As soon as you log in, the Droplet will automatically make sure it’s running the most recent version of Ghost, and will prompt you to press
ENTER to finalize the setup.
Ensuring Ghost-CLI is up-to-date… … Ghost will prompt you for two details: Your domain Add an A Record -> your_droplet_ip & ensure DNS has fully propagated Or alternatively enter http://your_droplet_ip Your email address (only used for SSL) Press enter when you’re ready to get started!
Follow the installation prompts to configure Ghost.
As soon as you’re done, make sure to configure the admin user using the administrative interface at
http://use_your_droplet_ip/ghost (making sure to substitute the Droplet’s IP address in the URL). Until you configure the admin user, anyone who discovers the site can configure the administrative user, take control of the Ghost site, and potentially take control of the Droplet.
Once the installation and setup is fully complete, you can access the new Ghost site by visiting the domain address in your browser.
That’s all, you are done!
To upgrade or maintain the Ghost install in future, you’ll always have to become the
ghost-mgr user in order to have the correct permissions:
sudo -i -u ghost-mgr
So there you have it. A fresh start with newly created Ghost blogging platform.