How to Install Drupal on a cPanel Server
- Ankush Dawar
- 3 days ago
- 8 min read
Installing Drupal on a cPanel server is straightforward when your hosting environment meets Drupal’s PHP, database, and web-server requirements.
This guide explains how to install Drupal on a cPanel server using the traditional File Manager method and the Composer-based method. It also covers database setup, PHP configuration, SSL, permissions, security, and common installation problems.

What Is Drupal?
Drupal is an open-source content management system (CMS) built with PHP. It is commonly used for business websites, portals, community platforms, publishing websites, and content-heavy applications.
Drupal provides a flexible and modular system that allows administrators and developers to add functionality through modules and customize websites through themes.
Why Install Drupal on a cPanel Server?
cPanel makes server management easier without requiring you to work entirely from the command line.
With cPanel, you can manage:
Domains and subdomains
PHP versions
MySQL and MariaDB databases
SSL certificates
Files and directories
Cron jobs
Backups
Email accounts
DNS settings
Git repositories
PHP configuration
Drupal Installation Requirements
Before starting, make sure your hosting account meets the requirements for your Drupal version.
For Drupal 11, the document specifies:
Web Server: Apache 2.4.7+ or compatible server
PHP: 8.3 or newer
MySQL: 8.0 or newer
MariaDB: 10.6 or newer
Composer: Required for Composer-based installation
SSL: Strongly recommended
PHP Memory Limit: 256 MB or higher is a practical starting point
Drupal also requires appropriate PHP extensions and server configuration.
Step 1: Log In to cPanel
Log in to your hosting account and open cPanel.
Depending on your hosting provider, cPanel may be available through your hosting portal or a URL such as:
Once logged in, locate:
File Manager
MySQL Databases or Database Wizard
MultiPHP Manager
SSL/TLS
Terminal, if available
The exact names may vary depending on your hosting provider.
Step 2: Check the PHP Version
Open MultiPHP Manager or your hosting provider’s PHP selector.
Select the domain where you want to install Drupal and check the PHP version.
For Drupal 11, PHP 8.3 or newer is required according to the requirements included in the source document.
Before selecting a newer PHP version, make sure your Drupal version, modules, themes, and hosting environment support it.
Step 3: Configure PHP Extensions and Settings
Drupal requires several PHP extensions to work correctly.
Common extensions include:
PDO
XML
GD
OpenSSL
Mbstring
JSON
cURL
ZIP
Fileinfo
If your cPanel provides a Select PHP Version or PHP Extensions interface, review the available extensions and enable the ones required by your Drupal installation.
Also check these PHP settings:
memory_limit
upload_max_filesize
post_max_size
max_execution_time
For larger Drupal websites, increasing the PHP memory limit can help prevent installation and module-management problems.
Step 4: Create a MySQL Database
Drupal uses a database to store website configuration, users, content, fields, menus, and other information.
In cPanel, open Database Wizard.
Create a database and database user.
For example:
Database name:account_drupal
Database username:account_drupaluser
Choose a strong and unique password.
Keep these details available:
Database name
Database username
Database password
Database host
On many cPanel installations, the database host is:
If your hosting provider gives you a different database hostname, use that instead.
Step 5: Assign Database Privileges
After creating the database and user, assign the user to the Drupal database.
Grant the required privileges, normally including all privileges for the database.
Keep your database credentials private. Do not publish them in screenshots, articles, repositories, or publicly accessible configuration files.
Step 6: Download Drupal
Download Drupal from the official Drupal website.
For a traditional cPanel installation, download the appropriate Drupal release archive.
Step 7: Open cPanel File Manager
In cPanel, open File Manager.
Navigate to your domain's document root.
For the primary domain, this is commonly:
public_html
An addon domain may use a different directory.
Make sure you are uploading Drupal to the correct document root.
Step 8: Upload the Drupal Archive
Click Upload in File Manager and upload the Drupal ZIP or TAR archive.
After uploading:
Select the archive.
Click Extract.
Open the extracted Drupal directory.
Move the Drupal files into the correct document root if necessary.
For example:
public_html/
should contain the Drupal application files.
Avoid accidentally creating:
public_html/drupal-11.x.x/index.php
unless you specifically want Drupal installed inside a subdirectory.
Step 9: Composer Installation
For developers and production websites, a Composer-based installation is generally preferable when SSH and Composer are available.
Connect to the server through SSH and use the Drupal recommended project template:
composer create-project drupal/recommended-project my-drupal-site
The recommended project structure keeps the vendor directory outside the public web root.
A typical structure looks like:
my-drupal-site/
├── composer.json
├── composer.lock
├── vendor/
└── web/
├── core/
├── modules/
├── profiles/
├── sites/
├── themes/
└── index.php
If your cPanel environment allows you to change the domain document root, point it to:
/home/account/my-drupal-site/web
rather than exposing the entire project directory.
Step 10: Configure the Domain Document Root
If Drupal was installed using Composer, make sure your domain points to the Drupal web directory.
For example:
/home/cpaneluser/drupal-project/web
Visitors should access:
while the server internally serves the Drupal files from the web directory.
Step 11: Open Your Domain
Open your website in a browser:
If Drupal has been uploaded correctly, the Drupal installation screen should appear.
If you see a directory listing, PHP error, 403 error, or blank page, check the troubleshooting section below.
Step 12: Select the Installation Language
Drupal will ask you to select the installation language.
Choose your preferred language.
For an English-language website, select:
English
Click Save and continue.
Step 13: Select the Installation Profile
Drupal may show different installation profiles depending on the Drupal distribution or project.
For a standard Drupal installation, select the appropriate standard or default profile.
Continue to the next step.
Step 14: Enter the Database Information
Drupal will now ask for your database details.
Enter:
Database type:MySQL/MariaDB
Database name:Your cPanel database name
Database username:Your database user
Database password:Your database password
Database host:Usually localhost
If your hosting provider supplied a different database hostname, use that instead.
Drupal will test the connection and begin creating the database tables.
Step 15: Complete the Drupal Installation
After Drupal successfully connects to the database, the installer will create the required database structure.
You will then enter basic website information.
Site Name
Enter your website name.
Example:
My Business Website
Site Email Address
Enter an email address for website-related notifications.
Administrator Username
Create a secure administrator account.
Avoid simple usernames such as:
admin
Use a unique administrator username instead.
Administrator Password
Create a long and unique password using:
Uppercase letters
Lowercase letters
Numbers
Special characters
Enter an administrator email address that you control.
Complete the remaining configuration options and click Save and continue.
Step 16: Log In to the Drupal Administration Panel
After installation is complete, log in to the Drupal administration area.
The login page is commonly:
Enter your administrator credentials.
You should now have access to the Drupal administration interface.
Step 17: Enable HTTPS and SSL
SSL should be enabled for a production Drupal website.
Your website should load through:
rather than only:
Many cPanel hosting providers offer AutoSSL, which can automatically issue and renew SSL certificates.
After enabling SSL, test:
Homepage
Login page
Administration pages
Images
CSS
JavaScript
Forms
Make sure the website does not show mixed-content warnings.
Step 18: Configure Drupal Clean URLs
Clean URLs make website addresses easier to understand.
For example:
Drupal's Apache configuration relies on mod_rewrite and .htaccess support for Clean URLs.
If Clean URLs do not work, ask your hosting provider whether Apache rewrite functionality is enabled and whether .htaccess overrides are permitted.
Step 19: Configure Drupal Cron
Drupal uses scheduled tasks for maintenance activities.
If your hosting environment permits it, configure a cron job through cPanel.
Open Cron Jobs in cPanel and configure the required scheduled command for your Drupal installation.
The exact command depends on your installation method and hosting environment.
Step 20: Secure Your Drupal Installation
Security should be part of the installation process.
Use a Strong Administrator Password
Never reuse your hosting or email password for your Drupal administrator account.
Keep Drupal Updated
Regularly update:
Drupal core
Contributed modules
Themes
Use Composer for Composer-Managed Sites
Composer makes dependency management and updates easier for Drupal projects.
Enable HTTPS
Always use HTTPS for production websites.
Take Regular Backups
Back up both:
Drupal files
Drupal database
A database-only backup is not enough for a complete Drupal restoration.
Protect Administrator Access
Use strong credentials and limit administrative access where practical.
Keep PHP Updated
Use a supported PHP release that is compatible with your Drupal version and installed extensions.
Common Problems When Installing Drupal on cPanel
1. Drupal Shows a PHP Version Error
Cause:Your hosting account is running an unsupported PHP version.
Solution:Open the PHP management interface in cPanel and select a PHP version compatible with your Drupal release.
2. Database Connection Failed
Check:
Database name
Database username
Database password
Database hostname
User privileges
Remember that cPanel may automatically add an account prefix to database names and usernames.
For example:
account_drupal
instead of:
drupal
3. 403 Forbidden Error
A 403 error may be caused by:
Incorrect file permissions
Incorrect document root
.htaccess configuration
Server security rules
Incorrect ownership
Check the domain's document root first, especially when using Composer.
4. 404 Errors After Installation
If the Drupal homepage works but internal pages return 404 errors, Apache rewrite configuration may be involved.
Check that mod_rewrite is enabled and that the required .htaccess rules are being applied.
5. White Screen or PHP Fatal Error
A blank page can be caused by:
Unsupported PHP version
Missing PHP extension
Insufficient PHP memory
Incompatible module
Theme problem
PHP fatal error
Check your hosting error logs and Drupal logs to identify the underlying problem.
6. Composer Command Is Not Available
If you receive:
composer: command not found
Composer may not be installed or available on your cPanel account.
If you do not have SSH or Composer access, use the File Manager installation method or ask your hosting provider to enable the required tools.
File Permissions for Drupal
Incorrect permissions can cause security and functionality problems.
Do not make the entire Drupal installation world-writable just to solve a permissions error.
Instead:
Use appropriate directory permissions.
Use appropriate file permissions.
Make sure the web server can read required files.
Give write access only to directories that genuinely require it.
Follow the security recommendations for your Drupal version.
If you are unsure about permissions, contact your hosting provider instead of applying broad 777 permissions.
Drupal on cPanel: File Manager vs Composer
There are two common approaches to installing Drupal.
cPanel File Manager
Best for beginners and simple deployments.
Advantage: Easy graphical installation.
Composer + SSH
Best for developers and production projects.
Advantage: Better dependency management.
Git + Composer
Best for development teams.
Advantage: Version control and deployment workflow.
For a simple website, uploading Drupal through cPanel File Manager can be convenient.
For a production project, Composer is generally the better approach because Drupal's recommended project structure keeps the vendor directory outside the public document root and supports dependency-based updates.
Final Drupal Installation Checklist
Before considering the installation complete, check that:
Drupal files are uploaded correctly.
A supported PHP version is selected.
Required PHP extensions are enabled.
MySQL or MariaDB database is created.
Database user is assigned to the database.
Correct database credentials are entered.
Drupal installation is completed successfully.
Administrator account is created.
HTTPS/SSL is enabled.
Clean URLs are working.
Website loads correctly on desktop and mobile.
Drupal reports no critical configuration errors.
Backup system is configured.
Cron is configured.
Drupal and contributed extensions are kept updated.
Conclusion
Installing Drupal on a cPanel server does not have to be complicated.
The basic process involves preparing a compatible PHP environment, creating a MySQL or MariaDB database, uploading Drupal, completing the browser-based installation, and securing the website.
For beginners, the cPanel File Manager method provides a simple way to get started. For developers and production websites, a Composer-based installation with the web root pointed to the web directory provides a cleaner and more maintainable setup.




Comments