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

The Quincy Jones Vulture Interview

This Quincy Jones interview is great, super entertaining. There is one thing I wanted to write about though, and since I wound up writing a lot of it out in a message, I figured I'd do it here: In the interview, Jones talks about a bunch of stuff like who actually...

I Tried Cryptokitties and Also Some Other Thoughts

So I had this idea a couple of years ago that I could never really figure out: I wanted to just give away 49% of Castmate to anyone who wanted a piece. Divide it up into a billion shares and give out 100 or 1000 to anyone who asked or filled out a form. A few reasons:...

Twitter: Still a White Supremacist Website

From what I can tell, "Krang T Nelson", a left wing non-nazi normal person who wrote funny, obviously jokey tweets got in a fight with a racist, Daily-Stormer-quoting, muslim-hating, Sandy Hook/Heather Hayer truther lady, who got a bunch of other racists worked up, so...

In 3 Days This Domain Will be 20 Years Old

I don't really have anything to say about it, but I know I'll forget about this by Saturday, so I'm just going to post now. Hold up is there any way I could ask for like, cash gifts. Oh and the only reason I thought to look this up a week or two ago is because Paul...

Does Bacon Come From a Pig?

Yesterday, I did an Instagram story for my online store. At one point, for no real reason, I put a pack of bacon in front of the camera, and I said "I don't know if I should eat this bacon, it was 3 packs for $7, which seems too cheap, but I mean, it all comes from...

The Three Times I Was on TV

Paul Ford just wrote a very good guide to being interview in the media. He makes some excellent, excellent points, it's really amazing how much of it hits home for me. It got me thinking about mistakes I made long ago when dealing with media stuff. I started 2...

Eating in Nashville

I just wrote this blog post title, and then I realized it sounds like that song "Walking in Memphis". Then I wanted to change it to "Eating in Memphis? Hell No, More Like Eating in Nashville!", but I feel like people won't find that as funny as I do. I also realized...

Youtube Idea

I don't think I'll ever get around to doing this, so I guess I'll just write it here: You know how Youtube channels sometimes have celebration videos like "woo we got 5000 followers, wow!" and whatnot - I think it'd be funny to create a channel, and make the first...

adoshif

One time, I was moving, and I found notebooks of lyrics from my high school band. They weren't emotional or anything, but still so, so bad. For about a day, I thought about how badly I needed to erase their existence, in a way that could not be reversed. I cut them...

One of the Worst Topics for a Blog Post

I think back when blogs were conquering the Earth, a common slam on them was that a lot of people would just write "Sorry I haven't updated, I will soon!", and then maybe a little more detail, but not much. I keep holding myself back from doing that, because I have...

The Hidden Danger of Cryonics.

All the smart transhumanists and futurists are really into cryonics. If you're rich, it seems kind of like a no-risk situation to have your body frozen after death, with the hope that scientists will figure out a way to bring you back to life eventually. Worst case...

New Site – I’m in the Business of.. Film?

I'm in the film business. I know what you're saying: "What?". I am saying the same thing. But uhh yeah, I am running a little online store selling film. Camera film. Photo film. You know the stuff. The site is called Buy Film Canada. The main deal is that my biggest...

Domain Name Decisions

So, a quick thing: As I mentioned in a couple of earlier posts, I'm starting a little online store, and part of the idea is that I'm selling a type of product that isn't that easy to get in Canada as in the USA. You can buy this type of product at some stores, but not...