how to install wordpress in cpanel

Step 1: Access cPanel

Log in to your cPanel account using the credentials provided by your hosting provider, typically via yourdomain.com/cpanel.

Step 2: Create a Database

  1. In cPanel, go to the Databases section and click MySQL® Database Wizard or MySQL Databases.
  2. Create a new database:
    • Enter a database name (e.g., wp_database).
    • Click Create Database.

Step 3: Add a New User

  1. In the MySQL Databases section, find MySQL Users and click Add New User.
  2. Enter a username (e.g., wp_user) and a strong password.
  3. Click Create User.

Step 4: Add User to Database with Permissions

  1. In the MySQL Databases section, go to Add User to Database.
  2. Select the user (e.g., wp_user) and the database (e.g., wp_database).
  3. Click Add, then check ALL PRIVILEGES in the permissions window.
  4. Click Make Changes to save.

Step 5: Download WordPress Files

  1. Visit the official WordPress website and download the latest WordPress ZIP file.
  2. Save and extract the file to your computer.

Step 6: Upload Files to cPanel

  1. In cPanel, go to File Manager under the Files section.
  2. Navigate to the folder for WordPress installation (e.g., public_html for the main domain or public_html/blog for a subdirectory).
  3. Click Upload, select the extracted WordPress ZIP file, and upload it.
  4. Extract the ZIP file in the folder, moving the contents of the wordpress folder to the root of your chosen directory if needed.

Step 7: Configure wp-config.php

  1. In File Manager, find the wp-config-sample.php file in the WordPress folder.
  2. Edit the file to add your database details:
    • Replace database_name_here with your database name (e.g., wp_database).
    • Replace username_here with your database user (e.g., wp_user).
    • Replace password_here with the user’s password.
    • Ensure DB_HOST is set to localhost (or confirm with your host if different).
  3. Save the file and rename it to wp-config.php.

Step 8: Run the WordPress Installer

  1. In your browser, go to your domain (e.g., yourdomain.com or yourdomain.com/blog).
  2. The WordPress installation screen will appear. Follow the prompts:
    • Select a language.
    • Enter your site title, admin username, password, and email.
    • Click Install WordPress.
  3. Log in to the WordPress admin dashboard at yourdomain.com/wp-admin.

Step 9: Create an Article in WordPress

  1. Log in to WordPress: Access the dashboard at yourdomain.com/wp-admin.
  2. Navigate to Posts: Click Posts > Add New in the left-hand menu.
  3. Add a Title: Enter a title, e.g., “My First Blog Post”.
  4. Write Content: Use the block editor to add content. For example:
    • Add a Paragraph block: “Welcome to my blog! This is my first article about WordPress.”
    • Add an Image block: Upload an image to enhance the post.
  5. Set Categories/Tags: In the right sidebar, add a category (e.g., “Blog”) and tags (e.g., “WordPress, Tutorial”).
  6. Add a Featured Image: Upload an image in the sidebar under the Post tab.
  7. Publish: Click Publish to make the article live, or save as a draft to edit later.

One response to “how to install wordpress in cpanel”