[img source :
https://www.searchenginejournal.com/wp-content/uploads/2023/09/wordpress-community-seo-64fea3496f6db-sej.png
]
Introduction
If you are using a Linux operating system and want to install WordPress in your system, then you are in the right place. You have to follow the following mentioned steps without skipping any of them.
Here the steps that I mentioned have been run by myself in my operating system which is Kali Linux.
Installation of Xampp
You can download the Xampp from https://www.apachefriends.org/download.html where you will download Xampp for Linux. Ensure you download the one which is at the top i.e. 8.0.30 in this case.
After the download process ends open your terminal and navigate to the Downloads section
$ cd Downloads
Check the file permission using command
$ ls -l
If there is rwxr--r-- then run the following command to make the file executable.
$ chmod -x xampp-linux-x64-8.0.30-0-installer.run
now you can execute the file by running the command
$ sudo ./xampp-linux-x64-8.0.30-0-installer.run
Click on next and install the Xampp which will be installed in /opt folder
After the completion of Xampp, you can run Xampp either by navigating to /opt/lampp folder and executing
(/opt/lampp)$ sudo ./manager-linux-x64.run
or
$ sudo /opt/lampp/manager-linux-x64.run
Then a window will open
Here go to Manage Servers and click on Start All
Installation of WordPress
visit the website https://wordpress.org/ where you will find the Get WordPress button when click leads you to this page.
Click on the Download WordPress button.
Now again open your terminal and go to the Downloads folder.
$ cd Downloads
Now unzip the WordPress downloaded file using the command
$ unzip wordpress-6.4.2.zip
An unzipped folder named wordpress will be created in your Downloads folder which you can check by running the ls command
$ ls -l | grep "wordpress"
the d in the very front represent folder.
The most important task after installation of WordPress
Move the folder 'wordpress' to /opt/lampp/htdocs by using the following command
$ sudo mv ~/Downloads/wordpress /opt/lampp/htdocs
Running localhost
After you follow the above process fire up the browser and type
localhost/dashboard/
this will open the Xampp dashboard
localhost/phpmyadmin/
This will take you to manage the database where you set the database
For example, if I have given the database name wordpress and click on the create button, the database named wordpress will be created. It is similar to creating the database in MySQL with command
$ sudo mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 31
Server version: 10.11.6-MariaDB-1 Debian n/a
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE wordpress;
now in the new tab open localhost/wordpress/
this will take you to the congifure page
Here give the database name you just created
username as root
leave the password blank if you haven't created a password to access the database
then press the submit button which leads you to another page.
If you haven't set wp-config.php then you have to create a wp-config.php file in /opt/lampp/htdocs/wordpress
run command
()-[/opt/lampp/htdocs/wordpress]$ sudo vim wp-config.php
Then paste the code provided on that page
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the installation.
* You don't have to use the web site, you can copy this file to "wp-config.php"
* and fill in the values.
*
* This file contains the following configurations:
*
* * Database settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://wordpress.org/documentation/article/editing-wp-config-php/
*
* @package WordPress
*/
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );
/** Database username */
define( 'DB_USER', 'root' );
/** Database password */
define( 'DB_PASSWORD', '' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication unique keys and salts.
*
* Change these to different unique phrases! You can generate these using
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
*
* You can change these at any point in time to invalidate all existing cookies.
* This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', 'PX[EStJu6(l{yW%]JMydXOIn|*.Ur^~(-e){aUz~MV9=ja&F8FPN`b-GlvghuzgG' );
define( 'SECURE_AUTH_KEY', '#nO>CX+`,Iqn-Zw=]&G5[_S>H+ al+Ue]dlcA-AC[f!*|14(T| eL&#CE!ajDh5G' );
define( 'LOGGED_IN_KEY', 'CjFl8hEMP0C>;YTqGEs[i05A/D&o)2}N30Kv_<|_Y]rai<s8,XE@)NZXYx@B!TV.' );
define( 'NONCE_KEY', ':MLiUY/y7htyM5,*~=EKj8U+FMwT}(-<XF5RwsW.PO(u[VrBhETMb/UTSL+V.`=C' );
define( 'AUTH_SALT', 'Z$n-O(~h7^sROApp1V4k.m4Y$Z<GPF,p5t!jcA0C&wbdMyf}]1v%7)|j/2CJG:z~' );
define( 'SECURE_AUTH_SALT', 'bCex<` 2_KL`3uYZ[ ,6}dGC!hgRIQ`:=e;z[ZrqJstU,X~v[53_~!pUKt~zl/Wb' );
define( 'LOGGED_IN_SALT', 'dY9Z_v%+I0)NZW!Xe%-~n`,S+)WMCPTgNX]Rahcjirj2~XLv[pf?F~=_w*xSaM8.' );
define( 'NONCE_SALT', 'K:<s.:rL3T/SKg53UL_}T)6G.8(V9h2MW,A33AVi_e)(1:sQr;d[$`EUPBQhSO>/' );
/**#@-*/
/**
* WordPress database table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://wordpress.org/documentation/article/debugging-in-wordpress/
*/
define( 'WP_DEBUG', false );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
To exit from vim type ':wq'
Now on next page give your site title, username, password, and email for backup and then press on run installation and you will see the login page
Enter your username and password created after login you will see a WordPress dashboard and now you can start building websites.