To install WordPress, download the latest WordPress source from their website at https://wordpress.org. Before doing that, navigate to the /html folder where we will download our WordPress zip file.
cd /var/www/html/
and get the most recent WordPress files:
wget https://wordpress.org/latest.zip
Now, install unzip to unpack our WordPress files.
apt-get install unzip
Unzip the WordPress files located in the directory /var/www/html.
unzip -q latest.zip
Subsequently, set the appropriate permissions for the directory.
chown -R www-data:www-data /var/www/html/wordpress
chmod -R 755 /var/www/html/wordpress
Next, create an /upload directory within the /wp-content folder to facilitate content creation and file uploads.
mkdir -p /var/www/html/wordpress/wp-content/uploads
Finally, enable the web server to read and write to this directory by assigning user and group ownership to the files. This can be achieved by:
chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads
WordPress is now installed. The next step involves configuring WordPress to make it functional for use.