Let's talk blogging: How to set up a blog

My dear wife politely asked me (threatened with ice cream embargos) to create a document on how I set this blog up for her because some of you have been asking her to help start your own blog.

HONESTY TIME. I've always hated writing. It has never been my thing and I doubt it ever will be. For me, the effort is rarely justifiable. At the same time, I'm trying not to be a moron who only deals in absolutes. I've used writing as a very effective therapeutic tool in my life. I've found that writing helps me map my thoughts better when I'm being indecisive. I've noticed that writing helps me work through emotions that I don't perfectly understand. With that in mind, I believe that writing is a beautiful art form and hope you will find your reasons to write, beautiful and fulfilling as my wife and I do.

This document is going to cover how you can get started with blogging. You could, of course, use many of the excellent blogging services available today - Wordpress, Blogger, Ghost, or Medium. All these services are different in their own respects and allow you to start writing with little to no effort and for free. I'm not going to go into any detail on how to do that because there's enough literature on the internet explaining the process in gazillion different ways. This document will be focused on setting up a website using the Ghost blogging platform which is what we use to run this website.

The reason why we picked the Ghost platform (as opposed to the more traditional Wordpress) was because

  • Ankita was already comfortable writing posts using the simple Markdown syntax that Ghost uses.

  • I was more comfortable coding and working with NodeJS (basically server-side JavaScript) than PHP which is what WordPress is built on.

Okay, to be perfectly honest, I sort of forced the choice on her because I wasn't going to touch PHP with a ten-foot pole because I think it's a shit programming language and I'm entitled to my shitty personal opinions.

But before I start, for the sake of clarity I'm going to explain a few core concepts so that you don't feel overwhelmed.

  • A domain name is simply the name of a website, or where you tell people to go on the Internet to find your website. It's something like ankita.ink or desioutsiders.com or google.com.

  • A registrar is a company that lets you buy domain names that you fancy.

  • TLD stands for top-level domain. The TLD of ankita.ink is ink and the TLD of desioutsiders.com is com.

Domain

For a little bit of history, I got this domain ankita.ink as a birthday gift for Ankita last year from the registrar Gandi.net. They're pretty good and I don't have any complaints. Later, we bought desioutsiders.com for the new podcast she was musing about from the registrar Route53 which is part of Amazon AWS. Unless you're planning to use AWS services like S3 or CloudFront, I wouldn't recommend going down this path. Route53 is a far more powerful tool than you need it to be for simply registering a domain.

I realise that I've just dropped a lot of acronyms that you've probably not heard before and possibly confused you. That was mean of me. So, allow me to make it up to you by walking you through exactly how I set up this blog using an example.

Imagine I had the itch to write about random musings and thoughts in a blog form and I've come up with a great name for it - coconutbunch.uk. Because I don't want to spend my precious monies (earmarked for a 5-litre tub of Colombian coffee ice cream) to buy a domain name just for the sake of an example, I obtained a free domain - thengakola.tk. You're probably thinking 'But Shane, that's not the domain you wanted'. Well, stop making a fuss because coconut bunch translated into my mother tongue is thenga kola.

But more importantly, YOU CAN DO THIS TOO. There's no need to pay for a domain if you use services like FreeNom and Dot.TK, with the only catch being that you're forced to a small subset of TLDs.

One word of warning to anyone buying a domain. ALWAYS REMEMBER TO RENEW YOUR DOMAINS ON TIME. I've heard way too many horror stories of people losing their domain names because they forgot to pay in time and of opportunistic assholes parking their asses on it and bleeding the original owners dry to return it. Again, ALWAYS REMEMBER TO RENEW YOUR DOMAINS ON TIME.

Hosting

Hosting is a complicated thing. Ideally, you delegate as much of the responsibility of hosting to someone else as possible. This is so that you lose as little sleep as possible over any hosting problems.

You can always take a note from my wife on this. Your website goes down while you're obsessively typing out your new fancy schmancy post at 3AM? Kick your husband in the balls to have him wake up and fix the issue while you go flop back onto your comfy bed like a dead body. Don't have a husband/partner who is willing to let you torture him? That's okay. There might even be a better way. Ghost platform service pricing starts at 19$/month and it comes with a lot of bells and whistles. This is the most simple and straightforward way to set up your Ghost blog much like you would set up a paid Wordpress blog and I strongly recommend you do this.

Now, I didn't choose to do this at the time for ankita.ink because I thought it'd be fun to set it up and maintain on my own. There's also the fact that we pay about $6 a month now instead of $80 a month which is what we'd be forced to pay if we were to move our website to the paid service right now. This is because the Ghost service packages are priced based on the number of page views you get.

So, if you've come this far and brazenly ignored my recommendation to spare your sanity, I'll get started on how we set up our hosting solution. And again, the following bit requires a basic level of technical knowledge and if you find it difficult to follow, then you're going to have an even harder time maintaining it. To be clear, maintaining servers are hard and strenuous and you should always leave it to more capable hands.

We use a service called DigitialOcean. Once you've signed up for the service, this link should get you started with setting up the environment, which they refer to as a droplet. Because DigitalOcean, and it's a new droplet. Get it?

In case the link didn't work, or my lame attempt at explaining the joke confused you hard - here are some screenshots.

This handy one-click app is so satisfyingly simple to use and it comes with so much of the setup done for you.

Obviously pick the cheapest option here when you're starting out. We're close to 100K views every month and the 5$ droplet can easily handle this.

Pick the region closest to your readers or to you. For obvious reasons.

I'd highly recommend that you enable 'Backups' even though it makes your droplet cost about 20% more. Backups are very important. I shouldn't have to stress it's importance.

Once you press the Create button, you should be dropped into a page with this progress bar.

Once that's done, you'll be shown the IP address of your droplet and you should now have received your password for the admin account named 'root' for the droplet in your email.

Now you need to point the domain that you own to this droplet. Start off by setting the nameservers of the domain to the nameservers that DigitalOcean runs. You can find out how to do this for common registrars here.

NS1.DIGITALOCEAN.COM  
NS2.DIGITALOCEAN.COM  
NS3.DIGITALOCEAN.COM  

Now, go to this page to point your domain to your droplet.

Go to your favourite terminal and SSH into the droplet (replace the IP address in this command with your droplet's IP address): ssh [email protected]
Once you're logged in, you'll be forced to change your password. SECURITY! YAAY!
Now, you can start setting up the blogging software on the droplet.
Start by running the command mysql_secure_installation
Just follow the instructions carefully and you should be fine. The root password for the MySQL installation can be found in this file /root/.digitalocean_password
I'd recommend you delete the file once you're done with it.

(The following instructions to finish setting up the blog were taken from this page from Step 2 onwards.)

But it's not over yet. Now we need to inform the Ghost installation of your domain name.

nano /etc/nginx/sites-available/ghost  

Run the above command and change the current 'server_name' to 'thengakola.tk'.

nano /var/www/ghost/config.js  

Run the above command and change the production url to 'http://thengakola.tk'.

sudo service ghost restart  
sudo service nginx restart  

Now, go to the page http://thengakola.tk/ghost/signup to finish setting up the Ghost blog.

And tada, the blog is now live at http://thengakola.tk/

There are quite a lot more things you can do now. Set up SSL, global CDN & security protection, and custom themes. These are harder to do and I'll try to write them up if there's enough interest.

P.S. Today, while checking the system logs of the droplet for ankita.ink trying to debug an issue, I found evidence of multiple entities trying to brute-force the password via SSH. Now, I have to go deal with that. Seriously, there is always a never-ending stream of issues when you have to maintain your servers. So again, seriously - Pay for the service. It's pretty cheap when you're starting out and you can always pay someone to transfer and maintain your blog in DigitalOcean or a similar service once you start getting bigger and want to run a tighter ship.