How to install WordPress
Tags: wordpress, codenewbie, webdev, tutorial
Published: 2021-08-19 17:08:49

WordPress is the most popular CMS system in the world ([about 40% of pages using WordPress](https://www.cminds.com/ultimate-guide-wordpress-statistics%E2%80%A8%E2%80%A8/)).

I have been using WordPress for half a year for various purposes. And I want to introduce others to how to create a website.

Prerequisites:

- Web hosting with [MySQL database](https://www.mysql.com/) and [PHP version 7.4] (https://www.php.net/),
- Web hosting provider and
- Active domain, with a DNS server-oriented to your hosting provider.

## Step 1 - Download WordPress

Download the latest version of WordPress on the [WordPress website](https://wordpress.org/download/).

![Wordpress Download page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xmac8uhwih8m80u1rtv.png)


During the transfer, you can go cook one cup of☕ or 🍵 to make the next steps easier.

## Step 2 - Create a database

Because most web hosting providers offer a control panel [cPanel] (https://cpanel.net/), I will also show you how to install WordPress with the control panel [cPanel] (https://cpanel.net/).

We must first create a database, which will store information about the website. 

- To do this, look for the `MySQL Database Wizard` button in the control panel. The wizard will allow us to create a database and a user.


![cPanel dashboard - search for MySQL wizard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9em77ej7wo2bfbikafvp.png)
 

- Continue by entering the name of the database. , the easiest database name is "wp".

In most cases, the database has a prefix (our cPanel login username), so the full database name will be `prefix_ + database_name`. The same goes for the database user in the next step.


![cPanel - create database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b6ndjpjfarh9avlo1nqt.png)
 

- Because the database needs a user to manage the database, we will create a user.

We need to assign a username and password to the user. The username is usually the same as the database name. The password must be **secure**.
 **We must not forget this information**, because we will still need it.

![cPanel - create database user account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yvamview0wlsgog7xy9.png)
 

- For each user, we can determine what powers he will have, so we will determine this.

The easiest (and also the least secure) is to give the user all permissions.


![cPanel - add permissions to user](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypcwhasarqgcgdjx7694.png)
 

So, we created a database, for our website.


## Step 3 - Upload WordPress to the server

I hope you still have some coffee or tea from before or the previous step was already too strenuous😊.

Now it's time to upload the downloaded zip file to our server.

- We start this from the cPanel dashboard and look for the `File Manager` button.

![cPanel - open File Manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2io39saa4e0kx1xxhlf.png)
 

- In a new window, which opened, find the folder named `public_html` and open it. Now comes the moment when we upload WordPress to the server.

![cPanel - file manager interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xdh0uxljzv00r40eu03.png)


- A new window will be open in which we select and upload the file downloaded in the first step. But this is not the end 😉. The real work is beginning.

![cPanel - upload file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/br89xrn8vm3fz1a7levv.png)

 

-  Next, we must unpack wordpress zipped file. Right-click the file and click the `Extract` button. It may happen that it will create a folder named `wordpress`, in this case, we click on it and select all the files in it and move them to one folder up.


![cPanel - extract zip folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j2krj3rlmhwqo691uu93.png)
 
- So, we finally put WordPress on the server. The final look should be somewhat like the one in the image below.

![cPanel - file structure on end](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wolw7g55xcfn79jifq1s.png)
 

## Step 4 - Configure WordPress and connect to the database

Now let’s go visit our website. We enter our domain name in the browser. And if all went well, we will see our WordPress configuration wizard.

- Select the language in which we want to have the WordPress interface. And we continue.

![WordPress - select language of interface](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpyd8txxd6sjw2l5u6cs.png)
 
- Time to connect to the database. We will need the data from the first step, I hope you have not forgotten them 😁. Let's go.


![WordPress - notification for get database information](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7166d7lckw5sfyltm2j.png)
 

- And in the next step, we enter the name of the database, database username and password from the user made in the first step. 
Database host is usually `localhost`, in case of using a database hosted elsewhere then you would enter that address.


![WordPress - input database connection information](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7eq6cph8y3o8pqgqnkde.png)
 


<dl>
  <dt>Successfully connected database</dt>
  <dd>
  If we have connected the database then we can proceed with the WordPress configuration.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zy0sgubrk99h2oun2e1c.png" alt="WordPress - successful connection to database">
  </dd>
</dl>


<dl>
  <dt>Failed connection to database</dt>
  <dd>
If we encounter problems establishing a connection, then we return to the previous page and first check if we have typed somewhere. But, if we do not find an error, we contact the hosting provider.
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/igcr89fj30usn4as7o0m.png" alt="WordPress - failed connection to database">
  </dd>
</dl>


- We connected WordPress to the database, followed by the final configuration of WordPress. We will now fill in the information on our website


1.  **Site title** - Enter the name of the site (be it short and represent the company or person),
2.  **Username** - Enter the username with which we will log in to the control panel. that the username is not "admin" as this username is the most common and hackers most often try to check them.
3. **Password** - And login password. Keep your password secure. You must remember the password and username.
4.  **Your email** - Enter a valid email address because you will receive website notifications.
5.  **Search engine visibility** - If the box is checked, search engines will drop this page when indexing websites. My opinion is that as long as we check the box, this will prevent the page from being indexed as long as it is under construction. We can change this in the settings.

![WordPress - configure website](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obqu9vvqmu82qd8t1o8x.png)


- First login follows 🤗. We enter our username and password from the previous step.

![WordPress - login form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dejjzi4zktn6aqh7jee8.png)
 
- And voilà, we can now start editing the website.

![WordPress - dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bdn930iskqfcj22oiq3.png)
 


## Option 2
Some web hosting providers offer a [Softaculous auto-installer](https://softaculous.com/) that simplifies WordPress installation to the smallest.


I hope you learned something new. Until next time, with new tutorials on WordPress.

For even more content, you can follow me on my [Twitter](https://twitter.com/Patik123_).