How To Install WordPress On Debian 9 With LAMP (Tutorial)
- LAMP stack: LAMP stands for Linux Apache MySQL PHP. WordPress is both a front end and a back-end system so it requires a web server, a database engine and PHP for serving dynamic content which is handled by the LAMP stack. —>Click here for a step-by-step guide to installing LAMP on your Linux server.
- SSH access to your Debian 9 Server
- A system user with sudo privileges
WordPress ships a bundle of numerous files and those files need to be stored in a database.
So, your first step towards installing WordPress is to setup MySQL database to handle these files.
To do this, let's log in to MySQL as a root user, using the command:
mysql -u root -p
You’ll then prompted for the password that you set during the set-up of MySQL database system.
Once logged in, you need to create a new database that will accommodate WordPress files during and after the installation process. You can name it whatever you wish, but to keep things simple, we will call it
wordpressdb in this guide.
To create the database, run the following command.
mysql> CREATE DATABASE wordpressdb;
NOTE: Always remember to terminate MySQL statements with a semi-colon “;”
With the database in place, you need to create a new MySQL user account that will have exclusive access to the database.
Let's also grant the user full access to the database and set a strong password. For this guide, we will create a user
To do that, execute the following command
mysql> GRANT ALL ON wordpress.* TO 'admin-suser'@'localhost' IDENTIFIED BY 'PASSWORD';
NOTE: Remember to replace the
PASSWORD string with a strong password.
At this point, we’ve created a database and a user account specifically for WordPress.
To apply the changes in MySQL instance, we need to run the command below
mysql> FLUSH PRIVILEGES;
Then we'll exit the MySQL instance by running the command
LAMP stack requires only a minimal set of extensions for PHP to communicate with MySQL database server. However, WordPress and many of its plugins require additional extensions to function without complications.
With that in mind, we're now going to install additional PHP extensions for WordPress.
First, update the system:
# sudo apt update
Next, install the additional PHP extensions:
.... Read More