Media Image

 ![install drupal at a webhost](/sites/default/files/styles/hero_banner_1900_x_450/public/2025-02/install-at-webhost.jpg?h=fa603bf5&itok=dOtkX2Yj)

## Filed Under

[Site Building](/index%2Ephp/topic/site-building)

There are **many** ways to host Drupal websites.

## Install Drupal at a webhost that uses CPanel and public\_html as the root of the website.

### **Step 1: Log in to cPanel**

1. Open your web browser and go to **yourwebsite.com/cpanel**.
2. Enter your **cPanel username** and **password** (provided by your web host).
3. Click **Log in**.

### **Step 2: Create a MySQL Database**

Drupal requires a database to store its content and settings.

1. In cPanel, go to **Databases** &gt; **MySQL Databases**.
2. Under **Create a New Database**, enter a database name (e.g., drupal\_db) and click **Create Database**.
3. Scroll down to **MySQL Users** and create a user:
    1. Enter a username (e.g., drupal\_user).
    2. Enter a strong password.
    3. Click **Create User**.
4. Assign the user to the database:
    1. Under **Add User to Database**, select the **user** and **database**.
    2. Click **Add** and select **All Privileges**.
    3. Click **Make Changes**.

### **Step 3: Install Drupal**

We'll do most of this in the terminal.

1. Scroll down and find the **Terminal** button.  Open a new terminal window.
2. Type ls and press enter.  Make sure you are in the root and can see the public\_html folder listed.
3. Enter the following commands:

`composer create-project drupal/recommended-project:10.4.3 public_html --no-interaction --no-install (update the version of Drupal to the version you want).`

`cd public_html`

`mv composer.json ../`

`rm composer.lock`

`cd ..`

4. You'll need to edit the composer.json file.  Click on the CPanel logo and go to the File Manager.  Click on composer.json and edit the file.  You'll need to change web/ to public\_html/ (see the file attached).  **Save and head back to the terminal**.
5. Enter: `composer install`
6. Head over to the URL of your site and complete the set up like any Drupal site.  You'll need the database credentials you created earlier.

    You're done!

If you're moving a site from Gitpod.io to a webserver like the one above, watch this video: <https://www.youtube.com/watch?v=uTsnFxLltfA>

  Media Files

Document

| Attachment | Size |
|---|---|
| [composer.json\_.txt](/index%2Ephp/https%3A//old.drupalhelps.com/sites/default/files/2025-02/composer.json_.txt) | 3.5 KB |

---

[Request the Starter Site](/index%2Ephp/contact "Let’s Talk")

[Schedule a Consultation](https://rodsurl.com/meeting)

 [     Opens in a new window ](https://www.facebook.com/sharer/sharer.php?u=https://www.old.drupalhelps.com/index%2Ephp/tip/creating-drupal-site-webhost-cpanel&title=Creating%20a%20Drupal%20Site%20at%20a%20Webhost%20with%20CPanel "Share to Facebook") [     Opens in a new window ](https://twitter.com/intent/tweet?text=Creating%20a%20Drupal%20Site%20at%20a%20Webhost%20with%20CPanel+https://www.old.drupalhelps.com/index%2Ephp/tip/creating-drupal-site-webhost-cpanel "Share to X") [   ](mailto:?subject=Creating%20a%20Drupal%20Site%20at%20a%20Webhost%20with%20CPanel&body=https://www.old.drupalhelps.com/index%2Ephp/tip/creating-drupal-site-webhost-cpanel "Share by email") [     Opens in a new window ](https://www.linkedin.com/sharing/share-offsite/?url=https://www.old.drupalhelps.com/index%2Ephp/tip/creating-drupal-site-webhost-cpanel "Share to LinkedIn") [    ](# "Copy link") Copied to clipboard