Last updated: August 2018
I'm a huge fan of Ghost 2.0. It feels like Medium, but it's hosted on your own website. It also costs pennies... I have three websites on one server that costs $5 a month. I'm not going to get much traffic, so this is fine.
This is a guide to saving maybe $500 a year and gaining a lot of flexibility by hosting multiple websites yourself on one server. It’s not hard, but it’s not for the non-technical.
Why write this guide? I kept having to piece together bits of information around the internet, most of which was irrelevant/semi out-of-date. There were random bits of information in some places (like this comment by a guy named 'roelsmelt' on this page that I kept having to find... thanks guy!), and in general it was time for an up-to-date piece.
How can you save so much? A basic virtual server is $5 a month and lets you host multiple websites (as many as possible until your space or traffic limit, both of which huge, are maxed out). A web hosting company is $10 a month per blog. Most people have small websites and blogs. Conclusion: Host your own!
Secondly, I try to get ahead of problems down the line. That’s why I brush my teeth, lower my salt intake and host my websites on my own servers. For that purpose, I’m a huge fan of DigitalOcean, but I think other alternatives work fine (Linode, Amazon EC2, etc.)
The following assumes you know what a server is and how to set up the first Ghost instance. It also assumes you know what Ghost is and why someone would use it over Wordpress, etc. C’mon, Google a little. If you have no idea, check out how easy DO makes it for you with their one-click server setups that only cost $5 a month! Consider this to be Step Zero.
If this seems way too technical for you, try it anyway and see what happens. It’s how I learned everything.
Step 1: Buy the domain and point it at your Ghost server
Buy your domain at hover.com. Why there? Because they have the best customer support in the industry. They have a policy of a human picking up within one ring, and it works! Or use GoDaddy or whatever you like.
Once you’ve bought your domain, you need to point it at your DigitalOcean server using two A parameters for @ (the whole domain) and www (for people who like to type www when going to a website). Do this now! Without them both set up, you won’t be able to finish the SSL installation at the end.
Step 2: Create a user with the right permissions on your virtual server
You need to create a super user with root permissions. This is one of the first things you should do when running a server anyway. Here’s the guide from DO on how to do it. Once you’ve done that, use your terminal of choice to log in to your new super user account.
You need to set up the Ghost blog instance as the user, not the superuser (root)
Step 3: Create a new folder
You have to go to where Ghost runs and create a new folder, then change ownership to your username. It needs to be owned by you for the blog setup.
sudo mkdir hooshmand.net
sudo chown dana:dana ./hooshmand.net
Step 4: One click Ghost install (in many keypresses and clicks!)
This might sound easy but you get asked so many questions I thought it worth documenting.
The core things to understand are that you’re creating a new website, which means new data files and new database, but using the same root user for your server.
First, start the installation process for Ghost. Then, here are the questions you have to answer.
Now, you have to answer the questions it gives. Pay attention here. The instructions are different to how they are for when you set up your first blog!
It starts off the same.
Enter your blog name: http://hooshmand.netEnter your mysql hostname: (localhost) hit enter for default
Now for the MySQL questions. Here’s where it’s different. Because you already have a Ghost blog on your server, you already have a mySQL username and password.
Enter your MySQL username: root
Enter your MySQL password: password for root
Wait, what’s that? You need to find the root password that exists already. Go find it. Open up another terminal window if you need to.
cat nano /root/.digitalocean_password
dana@granada:/var/www/hooshmand.net$ sudo cat /root/.digitalocean_password
[sudo] password for dana: root_mysql_pass="someseriesofrandomcharsandnumbers"
You need the one called
root_mysql_pass, between quotes. Copy that.
Finally, it goes back to the standard flow: You can just hit enter for default in most of this, except where you have to enter a password and an email (boldfaced)
Enter your Ghost database name: (hooshmand_net_prod) hit enter for default
Password: enter your password, what you use to log in to this server
Do you wish to set up a "ghost" mysql user? hit enter
Do you wish to set up Nginx? hit enter
Do you wish to set up SSL? hit enter
Enter your email (used for Let's Encrypt notifications): email@example.com
Do you wish to set up SystemD? hit enter
Do you wish to start Ghost? hit enter
Done! You should see a series of tick marks.
Final step: Set up your blog
Go to your domain. You should see the standard Ghost template, and it should be secured with SSL (so you see the padlock sign). Success!
Go to your domain and create your first user. Don't be alarmed that the admin interface is marked as 'not secure'.
Now you can make your first post. In fact, that's where I'm making this post!
Screwed up? Go back to zero!
You can always delete the Ghost instance and start again. Do this in two commands so you remove the one hidden file.
Do this inside your ghost website folder, in my case /var/www/hooshmand.net
rm -r *
After this, you should have a clean install.
There are a few things that are mandatory in setting up any new website if you want to do anything useful with it, before even adding content. For me, these are
- Set up Google Analytics on a Ghost blog, so I can see who's going to the website and when
- Submit the sitemap to be crawled by Google
- Install a theme
- Install some core images, like header images, a site icon
Those are coming soon...