TYLOR.TECH

Search
Close this search box.

Install WordPress Ubuntu 16.04.3

Create a MySQL Database and User for WordPress

mysql -u root -p
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;

Download WordPress

cd /tmp
curl -O https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php
mkdir /tmp/wordpress/wp-content/upgrade
sudo cp -a /tmp/wordpress/. /var/www/html

Configure the WordPress Directory

Adjusting the Ownership and Permissions

sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod g+s {} \;
sudo chmod g+w /var/www/html/wp-content
sudo chmod -R g+w /var/www/html/wp-content/themes
sudo chmod -R g+w /var/www/html/wp-content/plugins

Setting up the WordPress Configuration File

curl -s https://api.wordpress.org/secret-key/1.1/salt/

vim /var/www/html/wp-config.php

define('FS_METHOD', 'direct');

Share this Post:
Scroll to Top