Guides

Host WordPress on your server

Demo Author

Published: 1 min read

A pine forest in warm amber haze, a soft light at the end of the path

WordPress needs a web server, PHP and a database. This guide sets them up on Ubuntu, then adds a free certificate.

Install the web server, PHP and the database

sudo apt install nginx mariadb-server php-fpm php-mysql installs everything in one go. Then run sudo mysql_secure_installation to lock down the database.

Create a database for WordPress

Open the database console with sudo mysql and create a database and a user that only WordPress will use. Keep the password: the installer asks for it.

A pine forest in teal mist, a bright path running between the trees

Download WordPress

Unpack the latest release into the web folder: curl -O https://wordpress.org/latest.tar.gz, then sudo tar xzf latest.tar.gz -C /var/www. Point an nginx site at /var/www/wordpress and hand .php files to PHP-FPM.

Add a free certificate

With your domain pointing at the server, install Certbot with sudo apt install certbot python3-certbot-nginx and run sudo certbot --nginx -d example.com -d www.example.com. It renews the certificate on its own.

Note: Finish in the browser

Open your domain to run the WordPress installer. Stuck on a step? Contact support.

Related posts

  • Log in with SSH keys

    Technology

    Create a key pair, copy it to your server, then turn off password logins. About eight minutes.

    A pine forest at night in green mist, with a soft light behind the trees