Here is a step by guide on installing WordPress on a new domain along with CPanel installation. So, without any further adieu, let’s start:
Domain and Name Server
- Once you buy a domain. The first thing you have to do is to change the name server of the domain. Here is a screenshot of the default server configuration from the domain bought on Godaddy
- In the above picture, you have to change the nameservers. You can find the nameserver information from the other domains and where they are pointing to
In the above picture, I changed the name servers from default to custom and put in the nameserver URLs
Create a New CPanel Account in WHM (Web Host Manager)
The main purpose of the logging into WHM and creating a new account is that it will help us create a new CPanel for the new account (new domain). So, follow the steps below for that:-
- Login to WHM
- Under account functions, click on to create a new account
- Once you click on creating a new account, it will give you some options to fill out. Here is a screenshot of action items with their optimal settings
- Items you should care are:
- remember the password
- remember the email because that’s where the detailed information will be sent by WHM about the new CPanel created
- Choose a package of your choice as per your choice with your hosting server
- Under DNS settings, do not check the third box which talks about nameservers specified at the domain registrar.
- Finally, under mail settings, select automatically direct, the recommended settings
- Do not AddOn a new domain in the main CPanel before creating the CPanel for the new domain name because that will create trouble in creating CPanel for the new domain.
- I had done the mistake. My hosting guy asked me to delete the Addon domain before creating an account in WHM and then I could do that successfully
Login to New CPanel and Install WordPress
- After you complete the previous step, on the interface, you see an option to log on to your new CPanel. If you have missed that, in the previous step to your given email address, you will receive an email with the login link. So, now login to your new CPanel
- Click on File Manager
- Next, click on public_html that’s where your web content goes
- Initially, this folder will be empty and will look something like this
Download WordPress & Extract the files
- Our next step involves downloading WordPress. So, go to this URL and download the latest WordPress
- It will download a .zip file
- Upload the .zip file in your public_html folder and extract the content of the file
- The “Extract” option will be on the top panel somewhere.
Move the files to public_html
- This step is optional but I would recommend you do so
- After you extract the files, all your extracted files go in the WordPress folder under the public_html folder
- Move all the extracted files from /public_html/WordPress folder to just /public_html folder
- You can then delete the .zip file that you downloaded for extraction
Create a Database in WordPress
- The next step is to create a database on WordPress.
- To create a new database, again go to the CPanel and look for “MySQL Databases” not
“MySQL Databases Wizard”
- There are basically three basic steps here:
- Create a new user
- Create a new database
- Connect the new user to the new database
Create a new user
- Once you click on MySQL Databases, go on to create a new user as shown below
- You will also be asked to assign privileges to the new user. Assign all the privileges
Create a new Database
- Follow the step similar as shown above to create a new database
Add User to Database
- Now you have a new database and a new user. Add the new user to the new database
Modify wp-config-sample.php file
- Got back to file manager in CPanel
- Open again public_html
- you will see a file named as wp-config-sample.php
- There are two modifications that need to be done on this file
- Modify the database connections of this file and,
- rename the file
Modify the database connection
- Open the file in the edit mode and fill in the appropriate details as shown below
*/ // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'database_name_here' ); /** MySQL database username */ define( 'DB_USER', 'username_here' ); /** MySQL database password */ define( 'DB_PASSWORD', 'password_here' ); /** MySQL hostname */ define( 'DB_HOST', 'localhost' ); /** Database Charset to use in creating database tables. */ define( 'DB_CHARSET', 'utf8' ); /** The Database Collate type. Don't change this if in doubt. */ define( 'DB_COLLATE', '' );
- As you can see replace ‘database_name_here’ with your new database name. So, it should look like ‘adminDB’ if adminDB was your new database name. Names are case sensitive in this case
- Similarly, fill in your username as well as password.
- Now save the file. It should look something like this then
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'AdminDB' ); /** MySQL database username */ define( 'DB_USER', 'admin' ); /** MySQL database password */ define( 'DB_PASSWORD', 'admin123' ); /** MySQL 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.
Rename the file
- The next step is to rename your file. So, rename the above file from wp-config-sample.php to wp-config.php file
Finish the installation on the website
- Now the time has come to run the installation. Before running the installation, make sure you have the database name, user name, database password, etc with you as shown below:
- Fill in all the details as asked and shown below
- Fill in your database information such as database name, user name, and password. You can leave the database host and table prefix as it is.
- Next few steps are very intuitive such as site information, username, password, email, etc.
- After the successful installation, you will be asked to log in again so keep all your information safe.
- Here is a video that I find very useful:
Deleting CPanel from WHM
This is just an extra step which guides you on deleting CPanel for your website in Web Host Manager.
- Login to your web host manager
- Go to List Accounts under Account Information
- Select/ Expand the domain that you want to delete
- Click on the “Terminate Account” button
- It will ask you for another confirmation. Confirm that and it’s done.
- You can even revert the DNS settings to the default settings as you did in step one.