> For the complete documentation index, see [llms.txt](https://docs.neevcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/set-up-wordpress-in-linux-instance.md).

# Set up WordPress in Linux instance

WordPress is an open-source content management system(CMS) that allows you to host and build websites and helps create, manage, and host the website. WordPress provides pre-designing plugins, themes, template**s.**

## **Prerequisites:-**

It works on all Linux distributions.

* Operating System Used: [Alma Linux](https://docs.neevcloud.com/neevcloud-products/computes/getting-started-launch-vms/launch-alma-linux)
* I[nstall Apache](https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/how-to-install-apache-on-ubuntu-22.04)
* [Install MariaDB Database](https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/how-to-install-the-mariadb-on-ubuntu-22.04)
* [Install PHP](https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/set-up-wordpress-in-linux-instance#install-php)

## **Setup a WordPress in Alma Linux:-**

### Update and Upgrade all the packages :

```
sudo yum update & yum upgrade -y
```

Configure Selinux settings :

```
sudo setenforce 0
```

```
sudo sed -i 's/enforcing/disabled/g' /etc/selinux/config
```

```
sudo systemctl stop firewalld
```

### **Install HTTP service and MySQL database:-**

```

sudo yum install httpd php php-common php-mysqlnd php=mbstring php-gd mariadb-server mod_ssl -y

```

To start the HTTPD and MariaDB, run the following commands

```
sudo systemctl start httpd && systemctl start mariadb
```

&#x20;Enable it to start when at system rebooted

```
sudo systemctl enable httpd && systemctl enable mariadb 
```

Create a MySQL Database and user for WordPress&#x20;

```
sudo mysql -u root -p
```

<figure><img src="/files/5bWvkTkl3IQPIbnEGyHo" alt=""><figcaption></figcaption></figure>

### Creating a New WordPress Database

To get started with WordPress, the first step is to set up a new database that WordPress will manage. This database will store all your website's necessary information, from user data to content posts. Follow the steps below to create your new database:

```
CREATE DATABASE wordpress;
```

<figure><img src="/files/3IxKAOqqilSDdxywjB6V" alt=""><figcaption></figcaption></figure>

To create a new account, use the username `user_name` and assign it the password

```
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
```

### Granting Database Access to the WordPress User

Now that you have created a dedicated database and user for WordPress, the next step is to grant the user access to the database. This is crucial for enabling the WordPress installation to interact with its database. Follow these steps to establish the necessary permissions:

1. Log in to your database management interface, such as phpMyAdmin.
2. Select the database you created for WordPress from the list on the left-hand side.
3. Click on the "Privileges" or "Users" tab, depending on your interface.
4. Find and click on the "Add user to database" option.
5. In the drop-down menus, select the WordPress user and the WordPress database.
6. Grant all privileges to the user for this database by checking the option "ALL PRIVILEGES".
7. Click on the "Make changes" or "Save" button to apply the permissions.

With these steps, your WordPress user now has full access to its database, allowing for a smooth WordPress installation and operation.

```
GRANT ALL PRIVILEGES ON database.* TO 'username'@'host' IDENTIFIED BY 'Password@123$#@' WITH GRANT OPTION;
```

<figure><img src="/files/kRdaHt9TOq9XLPp1KN4S" alt=""><figcaption></figcaption></figure>

To ensure MySQL recognizes the recent changes to privileges, it's necessary to flush the privileges.

```
FLUSH PRIVILEGES;
```

**Download WordPress through the internet:-**

```
curl -O https://wordpress.org/latest.tar.gz
```

```
tar zxvf latest.tar.gz
```

```
mv wordpress/* /var/www/html/ 
chown -R apache:apache /var/www/html/
```

### **Downloading and Installing PHP**

To download and install PHP, follow these steps:

To install PHP, first download the package. You can acquire the package directly from CentOS default repositories using the `yum` command.

```
yum install epel-release yum-utils -y
```

```
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
```

```
yum-config-manager --enable remi-php74
```

After downloading the necessary PHP package:

### **Install PHP**

```
yum install php php-mysql -y
```

```
php -v
```

<figure><img src="/files/rykZJuvwapd3zRW9Kynn" alt=""><figcaption></figcaption></figure>

```
systemctl restart httpd
systemctl restart mariadb 
```

`Complete installation Through the web Interface:`

You can complete the WordPress installation through the web interface. In your web browser, navigate to your server's domain name or public IP address.

```
http://<YOUR_SERVER_IP>
```

### **Configure WordPress**&#x20;

**Select the Language:**

<figure><img src="/files/Rj4ziJjVrp2MWDJR0EaL" alt=""><figcaption></figcaption></figure>

First, you will need to select the language that you would like to install WordPress with. After selecting a language and clicking on **Continue**, you will be presented with the WordPress initial configuration page, where you will create an initial administrator account:

<figure><img src="/files/szWRvv5uClXwo0G7kdc5" alt=""><figcaption></figcaption></figure>

Fill out the information for the site and administrative account that you wish to make. When you are finished, click on the **Install WordPress** button at the bottom to continue.

WordPress will confirm the installation, and then ask you to log in with the account that you just created:

<figure><img src="/files/JC3GVpDZC1gVBvPI7fTA" alt=""><figcaption></figcaption></figure>

To continue, click the **login** button at the bottom:-

<figure><img src="/files/db8uMErO6viAYXsYHmji" alt=""><figcaption></figcaption></figure>

You will be presented with your new WordPress dashboard:

<figure><img src="/files/UCidKqpmQ6pgqD6ntQmN" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.neevcloud.com/neevcloud-guide/neevcloud-knowledgebase/set-up-wordpress-in-linux-instance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
