To run an HTML or PHP website on cPanel hosting, follow the steps below. If your website does not use a database, you only need to complete the first step. If it uses a MySQL database, continue with the following steps according to your website's requirements.
Step One: Upload the Website Files
- Log in to your cPanel account, then go to the Files section and click File Manager.

- Navigate to the
public_htmldirectory, then click Upload.

- Click Select File, then select the ZIP archive containing your website files and directories. Wait until the upload reaches 100%.

- Return to File Manager, then right-click the uploaded archive and select Extract.

- Make sure the correct extraction path is selected, then click Extract Files.
- Make sure your website files are located directly inside the directory assigned to the domain, including the main page file
index.htmlorindex.php, rather than inside an additional nested directory. - After the extraction is complete, you can delete the compressed archive from your hosting account.

public_html directory is assigned to the primary domain of your hosting account. If you want to run your website on an additional domain or a subdomain, you can find its assigned directory (Document Root) under the Domains section in cPanel, then upload your website files to that directory.If your website does not use a database, you can now open the domain in your web browser to verify that it is working correctly. You do not need to complete the following steps.
Step Two: Create a MySQL Database
If your website uses a MySQL database, follow the steps below to create the database and its associated user:
- Return to the main cPanel page, then go to the Databases section and click Database Wizard.

- Enter a suitable name for the database, such as
testdb, then click Next Step.

- Enter a database username, such as
testuser, and set a strong password. Re-enter the password to confirm it, or use Password Generator to generate one, then click Create User.

- Select ALL PRIVILEGES to grant the user all privileges on the database, then click Next Step.

- When a confirmation message appears indicating that the user has been successfully added to the database, the creation process is complete.
- Database Name:
kbiqhosting_testdb - Database Username:
kbiqhosting_testuser
Step Three: Set Up the Database
The database setup method depends on how your website is developed. Follow the appropriate method below:
Option One: Automatically Create Database Tables Using an Installation Wizard
If your website includes an installation wizard, open the domain or the website's installation URL, then enter the following database connection details when prompted:
- Database Host:
localhost - Database Port:
3306if required. - Database Name: The full database name.
- Database Username: The full database username.
- Database Password: The database user's password.
Complete the installation according to your website's instructions. The installation wizard will automatically create the required database tables.
Option Two: Manually Import the Database Using phpMyAdmin
If you have a database file in .sql format, follow the steps below:
- Return to cPanel, then go to the Databases section and click phpMyAdmin.
- Select the database you created from the sidebar.
- Click the Import tab.
- Click Browse, then select the database file from your device.
- Click Import and wait until the import process is complete and a success message appears.

Once the import is complete, proceed to the next step to connect your website to the database.
Step Four: Connect the Website to the Database
If your website requires manual database connection configuration, follow the steps below:
- Open File Manager, then navigate to the directory containing your website files.
- Select the database configuration file, then right-click it and choose Edit. If a confirmation window appears, click Edit again.
- Update the database connection details as follows:
- Database Host:
localhost - Database Port:
3306if required. - Database Name: The full database name.
- Database Username: The full database username.
- Database Password: The database user's password.
- Database Host:
- Click Save Changes to save the changes.

config.php, database.php, .env, or any other filename. If a hidden file, such as .env, is not visible, click Settings in File Manager and enable Show Hidden Files (dotfiles).Once the configuration is complete, open the domain in your web browser to verify that the website is working correctly.
If the Website Does Not Work
- Make sure the domain is correctly pointed to the hosting server.
- Make sure the website files are located inside the directory assigned to the domain rather than inside an additional nested directory.
- Verify that the database connection details are correct and that the full database name and username are used.
- Make sure the database user has the required privileges and that all database tables have been imported successfully, if required by the website.
- Review the Errors section in cPanel or the
error_logfile, if available, to identify the cause of any errors.