How to Install WordPress for CentOS 7

Create a New Virtual Machine in VMware and attach your ISO

  • Choose Typical Install because it’s the fastest way to install the
  • Make sure to include at least 20GB for your hard drive
  • 2 processors and 2 cores for optimal speed (check CPU before
    doing this)
  • Once you finish adding the ISO VMware, it’s time to run the VM

Power on the Virtual machine to the run ISO

  • Go through the setup process on the screen
  • This process should take 5-10 minutes and when we’re done we
    will get to desktop screen below

Once you get to your desktop of centOS there should
be a installer on the desktop page

  • Run “Install to Hard Drive” and make sure the desktop looks like
    this after installation so your drive won’t wipe clean after you
    restart the VM

Installing LAMP Stack for CENTOS 7

  • Now we will have to install LAMP stack using terminal before we can continue
  • You can open Terminal by clicking Applications at the top left of the desktop
  • LAMP includes Linux, Apache, MySQL/MariaDB, and PHP

Installing WordPress

Open Terminal

  • My sure to be in your root user before starting
  • You can login to root user by typing in #su – root
  • In terminal, type in #mysql -u root -p
If successful the terminal window should look like this
  • Now it’s time to create the WordPress database
  • In terminal, type in CREATE DATABASE wordpress;
  • You can change the name from “wordpress” to something else
  • Then type in CREATE USER [email protected]
    IDENTIFIED BY ‘password’;
  • Then type in GRANT ALL PRIVILEGES ON wordpress.*
    TO [email protected] IDENTIFIED BY ‘password’;
  • Then type in FLUSH PRIVILEGES;
  • Type in exit
  • You will now be back in your root user
  • You’ve now created a database and user for WordPress

  • Back in root user, it’s time to install WordPress
  • Type in cd ~ wget
  • This will download the latest version of WordPress
  • To install WordPress type in these commands sequentially
  • yum install wget
  • tar -xzvf latest.tar.gz
  • sudo rsync -avP ~/wordpress/ /var/www/html/
  • We will now create an upload directory and update our permissions
  • mkdir /var/www/html/wp-content/uploads
  • sudo chown -R apache:apache /var/www/html/*
  • We will now have to configure our Admin logins for WordPress
  • Type in cd /var/www/html
  • Then cp wp-config-sample.php wp-config.php
  • Then gedit wp-config.php
  • NOTE: you can use VIM but gedit is more user friendly
wp-config.php should look like this when you open it

Now you will have change the settings for this file:

// ** MySQL settings — You can get this info from your web
host ** //
/** The name of the database for WordPress
define('DB_NAME', 'wordpress');
/** MySQL database username
define('DB_USER' 'adminuser');
/** MySQL database password
define('DB_PASSWORD', 'password');
  • Save the file
  • Then in terminal type in if-config

You will need to find your IP address. It should be listed as inet, mine here is

Accessing WordPress on the Web

  • After you find your IP address we can open a web browser like
    Google Chrome or FireFox to access our WordPress
  • Go to the address: http://server_domain_name_or_IP/wp-admin
  • Example:
  • Pick a language and go through the setup process to create a Site
    Title, Username, and Password

Login and create your first blog!

Add a Comment

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