Categories
Uncategorized

How to Install WordPress on Ubuntu in 2020

I’ve installed WordPress a few times over the past decade or so. I have never managed to keep a blog up and running for more than a few years. In the end I end up not renewing the domain and/or terminating the VPS it’s installed on. Hopefully this blog stays longer. At $5 / mo, it’s much easier to justify paying for this VPS than the $10 I was paying a few years ago. I’ll go through some basics about how I set this up (FYI this is not a full tutorial).

I first launched a new Linode running Ubuntu, and secured it a little bit (changing SSH config, setup the firewall rules). I installed mysql-server 8, nginx, php5-fpm and downloaded WordPress. I was following some tutorial online and I got stuck once I had setup nginx config, the mysql db, user and password and had wp-config.php setup with the proper credentials. I tried loading my WordPress site through my browser but it wasn’t loading properly. I forget exactly what I saw, but after googling around for a while, I finally found someone’s blog post which posted the solution.

ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypassword';

Mysql 8 changed their authentication method! This was super frustrating, but I’m glad that someone discovered the fix and I was able to get WordPress setup.

I also setup https using Letsencrypt (free!), which I highly recommend.

You need to create a Diffie-Helman params (takes a while):

openssl dhparam -out /etc/letsencrypt/certs/dhparam.pem 4096

and also run certbot:

certbot certonly -d iiilx.dev,www.iiilx.dev --standalone --cert-name iiilx.dev

Leave a Reply

Your email address will not be published.