How to Set Document Root outside public_html for Addon Domain OR Sub Domain

By default, cPanel places the document root for addon and subdomains inside the public_html directory. However, you can configure the document root to reside outside public_html for better organization or security. Here’s how you can do it. Prerequisites Step 1: Log in to WHM either with the root ac

Last updated 30 Nov 2026Also in: Dedicated Servers, cPanel

By default, cPanel places the document root for addon and subdomains inside the public_html directory. However, you can configure the document root to reside outside public_html for better organization or security. Here’s how you can do it.

Prerequisites

  • Root Access to the server’s WHM

Step 1: Log in to WHM either with the root account. Normally you will use one of the URLs below;

http://your_server_ip:2087

https://your_server_hostname:2087

This image has an empty alt attribute; its file name is image-703.png

  • Navigate to Home /Server Configuration / Tweak Settings

  • Use the search box in tweak settings to search for Restrict document then find the Restrict document roots to public_html option, and set it to Off
  • Once done, click on Save.

This will make it possible for addon and subdomain document root to be created in custom locations, instead of the system forcing them to public_html

cloud servers in kenyaservers