Can I run Drupal on shared hosting?
Can Drupal run on shared hosting?
Yes, Drupal can run on shared hosting, but it requires specific configuration to meet modern system requirements. Since Drupal 8, the recommended method involves a "relocated document root" where the web-accessible files sit in a /web subfolder rather than the project root. This structure separates public files from sensitive configuration and vendor directories.
The /web folder requirement
Drupal 10 and later versions mandate a specific directory structure for security and maintainability. The index.php file and the core directory must reside inside a subfolder named web. This means you cannot simply upload all files to your public_html or www directory and expect it to work out of the box.
On shared hosting, you typically control the document root via cPanel or Plesk. To satisfy Drupal's requirements, you must configure your hosting panel to point the document root to the /web folder within your project directory. If your hosting provider does not allow this, you may need to use workarounds or consider upgrading to a VPS or managed Drupal hosting environment.
Configuration and dependencies
Running Drupal on shared hosting often involves managing Composer dependencies. Shared hosting environments may restrict the use of Composer commands, requiring you to upload pre-built vendor directories. This adds complexity to your deployment workflow. You must ensure that your hosting plan supports the required PHP extensions, such as intl, mbstring, and pdo_mysql, which are critical for Drupal's operation.
For detailed guidance on setting up Drupal with a relocated web root, refer to our tutorial on Drupal system requirements and managing Composer on shared hosting. Additionally, you can learn about Drupal file permissions to ensure your site remains secure.
Performance considerations
While Drupal can run on shared hosting, performance may be limited compared to dedicated or managed environments. Shared resources mean that your site's performance can be affected by other users on the same server. For high-traffic Drupal sites, we recommend evaluating Drupal hosting options to ensure adequate resources for optimal performance.
Security and updates
Drupal's automatic update feature, introduced in Drupal CMS, simplifies core and module updates. However, on shared hosting, you must ensure that your hosting provider supports the necessary file permissions for these updates to function correctly. For more information on updates, see our guide on Drupal CMS updates.
Conclusion
Running Drupal on shared hosting is feasible with the right configuration. Ensure you meet the /web folder requirement, manage Composer dependencies carefully, and verify that your hosting plan supports all necessary PHP extensions. For more detailed setup instructions, consult our Drupal installation guide and shared hosting best practices.
People also ask
- What are the system requirements for Drupal 10?
- How do I install Drupal on shared hosting?
- Can I use Composer on shared hosting?
- What are the best hosting options for Drupal?
- How do I secure my Drupal site on shared hosting?
- What PHP extensions does Drupal require?