For best results, use this guide
https://ubuntu.com/tutorials/install-and-configure-wordpress#6-configure-wordpress-to-connect-to-the-database
Install WordPress. To install WordPress, use following command: sudo apt update sudo apt install wordpress
Configure Apache for WordPress. Create Apache site for WordPress. ...
Configure database. ...
Configure WordPress. ...
Write your post.