Media Image
install drupal at a webhost

Filed Under

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 > 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 ..

  1. 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.
  2. Enter: composer install
  3. 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!

 


 

Media Files