You are currently viewing How to Configure Directory Privacy in cPanel

How to Configure Directory Privacy in cPanel

Protecting your website’s directories from unauthorized access is important these days as data breaches are very common. cPanel, a popular web hosting control panel, offers a feature known as ‘Directory Privacy’ that allows website owners to manage the access permissions for their web directories. This feature is instrumental in safeguarding sensitive information and controlling who gets to see what content on your site. This blog post aims to delve into the intricacies of configuring directory privacy in cPanel, ensuring that your website’s integrity and the privacy of your users are never compromised.

This blog is a part of our cPanel server management services where we make sure your cPanel server works efficiently with any issues.

Understanding Directory Privacy

Directory privacy in cPanel allows you to password-protect specific directories on your web hosting account. When a directory is protected, users are prompted to enter a username and password before they can view the content of that directory.

Why is Directory Privacy Important?

Protect Sensitive Information: Directory privacy helps protect sensitive information from being accessed by unauthorized users.

  • Prevent Unauthorized Access: It aids in preventing unauthorized access to specific parts of your website, which could include admin areas, customer data, or confidential files.
  • Compliance and Security: For certain websites, protecting directories is not just a security measure but a compliance requirement to protect user data.

Step-by-Step Guide to Configuring Directory Privacy

Step 1: Accessing cPanel

Log in to your web hosting account and access the cPanel dashboard. The method to access cPanel can vary depending on your hosting provider, but it generally involves logging into your hosting account and clicking on a cPanel link or icon.

Step 2: Locate the Directory Privacy Option

Once in the cPanel dashboard, look for the ‘Directory Privacy’ option. This can usually be found under the ‘Files’ section. Click on it to proceed.

Step 3: Selecting the Directory to Protect

You will see a list of directories in your account. Navigate through the folders by clicking on the folder icons or names until you find the directory you wish to protect. Once selected, click on the name of the directory to access its privacy settings.

Step 4: Enabling Privacy

Upon selecting a directory, you will be taken to a settings page where you can enable directory privacy. Check the box labeled “Password protect this directory” or a similarly worded option. This action enables privacy for the selected directory.

Step 5: Setting a Name for the Protected Directory

In the provided field, enter a name for the protected directory. This name is displayed to users when they are prompted for a username and password. It should give users an idea of why the directory is protected.

Step 6: Creating User Accounts

Under the section for creating or managing user accounts, you’ll need to create at least one user with access to the protected directory. Enter a username and password for the user. You can create multiple user accounts if you want to grant access to different individuals.

Step 7: Saving the Settings

After entering the necessary information, save your settings. In cPanel, this is typically done by clicking a ‘Save’ button. Once saved, the directory will be password-protected.

Testing the Configuration

To ensure your directory has been successfully protected, try accessing it from a web browser. You should be prompted to enter the username and password you just created. If you’re able to access the directory after entering the credentials, your directory privacy is correctly configured.

Additional Tips and Considerations

  • Use Strong Passwords: Always use strong, unique passwords for the users who have access to the protected directories.
  • Regularly Update Credentials: Regularly update the usernames and passwords to prevent unauthorized access.
  • Understand the Scope of Protection: Directory privacy protects the contents when accessed via a browser but might not protect against other types of access such as FTP or SSH.


Configuring directory privacy in cPanel is a straightforward process that can significantly enhance the security and privacy of your website. By following the steps outlined in this guide, you can ensure that sensitive directories on your website are well-protected against unauthorized access. Remember, in the digital age, taking proactive steps to safeguard your online presence is not just recommended; it’s necessary.