Select Page
I run this blog on WordPress, but I’m always interested in WP alternatives, and one of the biggest right now seems to be Craft CMS.

This post is not about debating Craft CMS vs. WordPress though – I just wanted to document the process of installing it on a Digital Ocean VPS (err, “Droplet”), because it’s something I tried and gave up on a few months ago.

I don’t remember the exact details, but the first time I tried to install it, I got to some stage where I was getting a pretty inscrutable error, and couldn’t find any way to get it running. I was only installing it for fun, so I didn’t really care too much, but I recently wanted to try it for something else, so I gave it another go, with mixed results.

Installing it was not really that simple, and it took me a while, but I got it going. I don’t know how often they update the Craft CMS docs, but I ran into some trouble, and a few of the issues took a fair amount of time to fix – and I’m very comfortable with installing anything on a LAMP server.

Again, I’m not trying to do compare it to WordPress, but I do think that a very large reason that WP has become such a behemoth is because they worked incredibly hard on making the installation process quick and easy. Even if you happen to run into an error, I’m pretty sure there are good instructions on how to fix it, and I don’t think Craft is there yet. But luckily, if you just follow this procedure step-by-step, you should probably not have to worry about that – unless Digital Ocean change something, or Craft does.

So let’s jump to it. If something becomes outdated, please comment here. I am not the fastest at replying to comments, so if you have a question about this specific installation guide (I am not a Craft CMS expert, or even a real user yet), feel free to tweet @bn2b about it.

This guide is specifically about installing on a Digital Ocean Droplet (VPS). I would imagine that it should work on any Ubuntu server with a LAMP stack going, but your mileage may vary.

Steps:

1. You need a Digital Ocean account. If you don’t have one, sign up here. (It’s an affiliate link but I’m not shilling – Digital Ocean are great and I wrote a few articles featuring them before even realizing they had an affiliate program.)

2. Now you’re going to create a droplet. Inside your Digital Ocean dashboard, go to the Droplets page, and then click the big green Create button and click “Droplets

I can’t link these directly because D.O. seems to create links with unique strings in the URL, and I have a feeling the ones I get won’t work for you, so here’s a screenshot:

3. You should now be at a page titled “Create Droplets“. You want to click the “One-click apps” tab, and then “LAMP on 16.04” (it could be that by the time you read this, it’s a different version number, but it should probably be fine). Again, D.O. create links with unique IDs so I’m going to add a screenshot instead of links:

 

4. At this point, you’ll have the choice of sizes/prices, and a few other options you can choose yourself. I leave all this as default myself, and I’m sure the cheapest plan should be fine. There’s an option here to add an SSH key you want.

5. At this point, you’re going to get your login information. Digital Ocean will email you a temporary password – I’m not sure if they do this if you specified an SSH key in the last step. Use this info to log into your server using SSH (I feel like explaining this process strays too far from the point of this tutorial), and set up a new password.

6. So now you’re logged into your server. I’m going to give you a bunch of commands to paste in here without much explanation. My theory is that you don’t understand what these commands are doing (which is fine), you probably don’t care anyway.

cd /var/www/
apt install unzip
wget https://craftcms.com/latest-v3.zip
unzip latest-v3.zip
mv html/ /tmp/
mv latest-v3.zip /tmp/

7. Now you need to do a very quick and easy edit an Apache config file on the server. I’m going to assume you’re happy to use Pico (the best editor). Just in case you’re not used to it, remember Ctrl-O is Save and when you’re done editing, Ctrl-X will Exit the program. So run this command:

pico -w /etc/apache2/sites-enabled/000-default.conf

Once the file is open, you’ll see about 18 lines of text. Two of these lines contain the string /var/www/html and all you need to do is change it to /var/www/web in both spots, save the file (Ctrl-O) and exit (Ctrl-X).

8. Okay, back to sticking commands into the server. Some of these are interactive, so if you paste the whole block at once, I don’t think it’ll work – go line by line.

apt-get update
apt-get upgrade
sudo apt-get install php-mbstring
sudo apt-get install php-mcrypt
sudo apt-get install php-imagick
sudo apt-get install php-curl
sudo apt-get install php-xml
sudo apt-get install php-zip

sudo a2enmod rewrite
service apache2 restart

chown -R www-data:www-data /var/www/

9. You now have to edit the config/general.php file and set a securityKey in it. Open the file using the command below:

pico -w ./config/general.php

and set some random string in the spot shown below. This is what it’d look like if you changed it to blahblahblah-somerandomstringeogihoeihfioh3249863982:

 'securityKey' => 'blahblahblah-somerandomstringeogihoeihfioh3249863982',

10. Now you’re going to want to check what your default MySQL password is and change it. The commands below will show you your password, and then let you change it, as well as disabling remote login (recommended):

cat /root/.digitalocean_password
mysql_secure_installation

11. Now you’re going to use your new password to log into MySQL and create a database for your Craft CMS blog:

mysql -uroot -p
mysql> create database craftblog;
mysql> \q

12. Now, edit the config/db.php file to include the new info you’ve set up. You’ll have to change the username, host, password and database name here:

pico -w /var/www/config/db.php

13. Almost done! Now you can visit your installation in your browser and it’ll ask you a few things and let you log in! You just need to go to http://xxx.xxx.xxx.xx/admin in your browser (with the xxx.xxx.xx.xx being the IP of your Digital Ocean droplet).

Okay, you’re ready to use Craft CMS now! This article wasn’t really written to help you past this point, I just wanted to document the steps I took to get it set up successfully. If there’s any interest in this article, I’d be happy to compare it to WordPress at some point, and give a general overview/review of it. Let me know in the comments I guess!

Also let me know if there are any errors in this – I tested this again as I wrote this post, but there’s always the chance that something changes and this document needs to be updated accordingly.

Welcome to My Blog

Here is a masonry blog layout with no sidebar

Human Consciousness

I've always wanted to figure out the whole deal with human consciousness, so, a while ago, I got a book about it. In the past week, I finally got around to reading it, and guess what: The author doesn't know what human consciousness is. I don't want to get too angry...

Punctuation

For 95% of my life, I used apostrophes when I wanted to show possession. An example: The dog's hat is bigger than Dan's hat. but in the last year, I read something that said this was incorrect. Some website about grammar explained that using apostrophes that way was a...

A Little Trick to Make Food Taste Better

When I travel on a plane, I don't go out of my way to plan out any food. I usually eat before going to the airport, but I'm always careful to not overeat, in case it makes me ill or something. Sometimes I think how amazing it'd be to have some really nice food, like...

1972 Polaroid Promotion Film by the Eames Office

When I started watching this video, I was confused, and thought it was a modern video someone had made, trying to parody the style of 1970's corporate films. I guess it was because of the video quality - this is 480p but looks pretty decent. A minute or so in, I was...

How This Site Got Its Admittedly Dumb Name

I just got an email reminder that this domain name is going to be auto-renewed tomorrow. This will be the 19th renewal, yikes. I know what you might be saying: "Andrew, this domain is 19 years old? You're so young, when did you register it, were you 5 years old?" The...

Streaming Vector Face Chat App (Great Post Title haha)

Streaming Vector Face Chat App (Great Post Title haha)

This is an app idea I've thought about a bit. I've used Facetime, Skype and Google Hangouts to do video chat over the years, and the video quality hasn't gotten much better over that time. The small improvement is, I think, mostly due to laptops/phones/tablets having...

Longreads

I figured out the thing about "longreads" that I don't like: They're really long. They should invent shortreads.

Iceland

I don't think many of my recent entries have been very short, but when I started updating this site again, I wanted to really focus on frequency, and not on quality (obviously). Part of the idea is that basically anytime I have something to say that doesn't fit on...

Can I Not Look at My Own Face for a Year

The other day, I was wearing a pretty ludicrous, misshapen sweatshirt that I own. I looked pretty dumb, and I passed my camera to someone, so that I could get a photo. I got home and as I began to go through the six or sevens photos, it occurred to me that maybe I...

The Screaming Heads of Burk’s Falls

A few weeks ago,  saw something about the site Atlas Obscura, because they have a new book out. The site is basically what it says: An atlas of obscure, odd places all over the world. I checked out what odd places are close to me, as everyone probably does, and the...

Food Startup Idea

I thought of what would be a good food startup: Instead of delivering me food from a restaurant menu, give me the option of sending a recipe that I found online, and have them make it, and then deliver it to me. I guess this is like having a personal chef, but one a...

Owned At The Airport

Almost 2 years ago, I went to NYC to an event with this company I was doing some contract work for. On the way home, I got so humiliated online, and it still makes me laugh so hard thinking about it. I was at the airport, waiting for my flight at the gate. There were...

Almost All Vintage Guitars are Fake

This is a subject I've been meaning to write about for a while, but I feel like I have too much to say about it, and I may organize my thoughts badly. Tonight on Instagram, I saw a vintage guitar collector describe how he was scammed by a guitar dealer, but the...

LGTM

I did some contract work earlier this year for a company that was fairly corporate. Early on, I noticed that whenever a developer would put in a pull request, someone would code review it, and if the code didn't have any issues, they'd write "LGTM" along with a little...

Flossers

I have to tell you a product that changed my life. It didn't change it a lot, but at least a little bit. The product is: Flossers. You already knew that from the subject line. This is a flosser: You buy them at a drugstore, and they make flossing so, so much easier....

Iconic Canadian Male Singers

That is one terrible blog title. I was at the park a couple of weeks ago, and a lady had a shirt on that said: AVRIL SHANIA ALANIS JONI CELINE Actually, here's a copy I found on the web. To me, that's a very smart t-shirt - very marketable. I got thinking about what...