# WordPress installation on LINUX

`[img source :` [`https://www.searchenginejournal.com/wp-content/uploads/2023/09/wordpress-community-seo-64fea3496f6db-sej.png`](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](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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705227962964/83f9464e-badd-4a48-9ebc-5938bab67ffb.png align="center")

After the download process ends open your terminal and navigate to the Downloads section

```bash
$ cd Downloads
```

Check the file permission using command

```bash
$ ls -l
```

If there is rwxr--r-- then run the following command to make the file executable.

```bash
$ chmod -x xampp-linux-x64-8.0.30-0-installer.run
```

now you can execute the file by running the command

```bash
$ 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

```bash
(/opt/lampp)$ sudo ./manager-linux-x64.run
```

or

```bash
$ sudo /opt/lampp/manager-linux-x64.run
```

Then a window will open

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705228655283/e0df8d3f-8f95-43ea-8fee-b4c83b347eea.png align="center")

Here go to Manage Servers and click on Start All

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705228679434/fee092f1-daef-4cb5-9f17-1c4f682aa508.png align="center")

### **Installation of WordPress**

visit the website [https://wordpress.org/](https://wordpress.org/) where you will find the Get WordPress button when click leads you to this page.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705228879382/45e54699-792b-4263-b7a8-4f175d47e72e.png align="center")

Click on the Download WordPress button.

Now again open your terminal and go to the Downloads folder.

```bash
$ cd Downloads
```

Now unzip the WordPress downloaded file using the command

```bash
$ 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

```bash
$ 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

```bash
$ 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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705229575028/a7439edb-b249-4d07-9367-7a17260d0f7f.png align="center")

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

```bash
$ 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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705230038850/7c63c760-a4d3-4060-9dc9-4488292754d9.png align="center")

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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705230444362/bda8f7ee-72f3-4e41-bece-80c005cf1142.png align="center")

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

```bash
()-[/opt/lampp/htdocs/wordpress]$ sudo vim wp-config.php
```

Then paste the code provided on that page

```bash
<?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 <mark>vim</mark> type **<mark>':wq'</mark>**

Now on next page give your <mark>site title, username, password, and email for backup </mark> and then press on run installation and you will see the login page

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705231524327/76deb632-91ad-4478-bf25-acfd90538195.png align="center")

Enter your username and password created after login you will see a WordPress dashboard and now you can start building websites.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1705232035258/ad537207-48e1-469d-8c8f-956525db26bd.png align="center")
