New Check out the curated list of the finest design resources I've gathered for you! Take a look →

How to Password Protect a Directory in cPanel

As a website owner, you may have certain directories on your website that contain sensitive information or should only be accessed by authorized users. In order to add an extra layer of security to these directories, you can password protect them. This article will guide you step by step on how to password protect a directory in cPanel.

Table of Contents

Step by Step

1. Access cPanel:

  • Log in to your cPanel account using your credentials.
  • Once logged in, navigate to the “Security” section and click on “Password Protect Directories”.

2. Choose the directory to password protect:

  • From the directory list, choose the directory that you want to protect by clicking on its name.

3. Enable password protection:

  • In the directory settings, locate the “Password Protect This Directory” checkbox and check it.
  • Enter a name for the protected directory, which will be displayed to users when prompted for a password.
  • Click on the “Save” button to apply the changes.

4. Create user and password:

  • Scroll down to find the “Create User” section.
  • Enter a username and password for the user who will have access to the protected directory.
  • Click on the “Add/modify authorized user” button to create the user.

5. Test the password protection:

  • Visit your website and try to access the protected directory.
  • You will be prompted to enter the username and password you created in the previous step.
  • If you can successfully log in, it means the password protection is working.


In this article, we have provided a step-by-step guide on how to password protect a directory in cPanel. By following these steps, you can effectively add an extra layer of security to sensitive directories on your website. Remember to choose strong and unique passwords to ensure maximum security.

Rizwan Aritonang

An independent WordPress & Front-End Developer from Bandung, Indonesia.

Get In Touch

Leave a Comment