How to Install WordPress Locally on My Linux PC

scope of it photo

WordPress is a free and open-source content management system (CMS), and the most popular blogging platform in the web. So why not start with WordPress. Here’s a quick guide that shows how you can install WordPress in your Linux PC.

Make sure you have installed all the components required for installing WordPress. If you haven’t installed Apache server, MySQL database, PHP in your Linux PC just continue with this quick guide; else you can directly move to step 2, which is downloading & installing WordPress.

Related Information : How to Visit My WordPress Log in Page

Step 1: How to Install LAMP in Your Linux PC

Installing Apache in Linux

sudo apt-get install apache2

Installing PHP in linux

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo /etc/init.d/apache2 restart

Installing MySql in Linux

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo /usr/bin/mysql_secure_installation

Creating a new user in MySql

mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your_password');
sudo service apache2 restart

Installing PhpMyAdmin

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin sudo /etc/init.d/apache2 restart

Now you can access PhpMyadmin at http://localhost/phpmyadmin.

Related Information : How to Use Google Analytics In wordpress

Step 2: Downloading & Installing WordPress

Downloading WordPress

  • Open Terminal (ctrl + alt + T)
  • Enter this command in the terminal to download latest wordpress zip file,
wget http://wordpress.org/latest.tar.gz tar -xzvf latest.tar.gz
  • Now Copy the wordpress directory to the apache Server’s root Directory i.e. “/var/www”

Creating a New Database for WordPress Using phpMyAdmin

  • Visit http://localhost/phpmyadmin/
  • Login with your username and password
  • Click on database tab
  • Enter database name and click on Create button

Setting up wp-config.php

  • Inside your WordPress directory there’s wp-config.php file, open it
  • Add your database name, username, password and hostname in DB_NAME, DB_USER, DB_PASSWORD, DB_HOST fields respectively.
  • Goto this link to create a strong key: https://api.wordpress.org/secret-key/1.1/salt/
  • Now paste those salt keys into the wp-config.php file.

Setting up Your WordPress Blog

Now you can login to WordPress Dashboard by clicking Login button, or visiting http://localhost/wordpress/wp-admin.

Congratulation you’ve successfully installed WordPress in your Linux PC.

Suggested Information :how to move wordpress from  Local host to live server.

You May Also Like