How to install WordPress with lamp on ubuntu LTS

Using website with WordPress is an website which a good quality on safety and structure of picture, paragraph, video, and so on that you can use with it and WordPress has using worldwide.
Below is shown how to install Ubuntu Last version or Ubuntu 18.04 which is the last version.

System requirement: Ram 1.5G or better, CPU 2G or better, HDD 30G or better.

We recommend you to use SSH (for remote control Ubuntu) #Ubuntu enable root login and remote putty

The first you need install PHP because WordPress need PHP packages for running web code app (Hypertext Preprocessor) on browser.

Ubuntu install PHP

$ sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip

Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04

$ sudo apt install apache2

When install apache2 on running will ask you y or n So you need type y and enter for install continue.

Ubuntu Firewall to Allow Web Traffic

$ sudo ufw app list

 Available applications:
  Apache Full
  Apache Secure

$sudo ufw app info “Apache Full”

OutputProfile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web


$ sudo ufw allow in “Apache Full”

Now install apache finish so you Should test open service by open public IP address, IP Address or Server name on your browser.



Installing MySQL

$ sudo apt install mysql-server

Install Mysl server system will ask you y or n So you should type Y and enter for continue process to install.

$ sudo mysql_secure_installation

This will ask you to create security so you should input for more information for create security.

$ mysql -u root -p

When you switch to use mysql system will as root user so you need input your password Mysql.

mysql> CREATE DATABASE sitewordpress;

Create Mysql Database.

mysql> CREATE USER `sitewp_admin`@`localhost` IDENTIFIED BY ‘mypassword’;

Create a new user mysql.

mysql> GRANT ALL ON sitewordpress.* TO `sitewp_admin`@`localhost`;

Grant your new user permissions on the database.


mysql> exit

Install PHP

$ sudo apt install php libapache2-mod-php php-mysql

Get WordPress on server

On the WordPress package that need Download soft code from So you need use command wget for download website WordPress.

$ cd /tmp

$ curl -O

$ tar xzvf latest.tar.gz

$ touch /tmp/wordpress/.htaccess

$ cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php

Create directory upgrade for can upgrade site WordPress.

$ mkdir /tmp/wordpress/wp-content/upgrade

Note: You make sure that address /var/www/wordpress this is address data your site.

$ sudo cp -a /tmp/wordpress/. /var/www/wordpress

$ sudo chown -R www-data:www-data /var/www/wordpress

$ sudo find /var/www/wordpress/ -type d -exec chmod 750 {} \;

$ sudo find /var/www/wordpress/ -type f -exec chmod 640 {} \;

Need to changes the main WordPress configuration file.

$ curl -s

define('AUTH_KEY',         '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H');
define('SECURE_AUTH_KEY',  'E2N-h2]Dcvp+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3');
define('LOGGED_IN_KEY',    'W(50,{W^,OPB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%3]R6DUth[;88');
define('NONCE_KEY',        'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atzM7 o^-C7g');
define('AUTH_SALT',        'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES  07VC*Lj*lD&?3w!BT#-');
define('SECURE_AUTH_SALT', 'p32*p,]z%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_+F|0h{!_xY');
define('LOGGED_IN_SALT',   'i^/G2W7!-1H2OQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|');
define('NONCE_SALT',       'Q6]U:K?j4L%Z]}h^q7 DO NOT COPY THESE VALUES 1% ^qUswWgn+6&xqHN&%');

$ sudo nano /var/www/wordpress/wp-config.php

Copy your secure keys code on run the command
curl -s paste on the sudo nano /var/www/wordpress/wp-config.php confige.

. . .

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');


Need to Enabling file .htaccess Overrides

$ sudo nano /etc/apache2/sites-available/wordpress.conf

<Directory /var/www/wordpress/>
    AllowOverride All
<Directory /var/www/> change to <Directory /var/www/wordpress/>

Need to Enabling the Rewrite Module

$ sudo a2enmod rewrite

Need to Enabling the Changes

$ sudo apache2ctl configtest

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message
Syntax OK

$ sudo systemctl restart apache2

Go to address /var/www/wordpress/wp-config.php for config site wordpress.

$ nano /var/www/wordpress/wp-config.php

. . .

define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressusername');

/** MySQL database password */
define('DB_PASSWORD', 'mypassword');

. . .

define('FS_METHOD', 'direct');

Installation WordPress Web Interface

Select the language website.

Select the language website and create user name password website for login admin website.

Now you are install WordPress website complete.

Now you can use website WordPress which you have been installed, please remember that you do all setting default server & WordPress to make sure your using is safety.

1 Comment

  1. utible

    December 9, 2019 at 11:43 pm

    Cialis tadalafil buy [url=]generic cialis[/url] generic cialis daily use cheap

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

To Top