Skip to content

Protecting directory privacy in cPanel

Directory Privacy (also known as Password Protect Directories) allows you to restrict access to certain folders on your website. Visitors must enter a valid username and password to view the contents of the protected directory. This is useful for securing private content, admin areas, or membership sections.

  • Prevent unauthorized access to sensitive files or folders.
  • Secure admin panels, staging sites, or client‑only areas.
  • Add an extra layer of protection beyond standard authentication.
  1. Log in to cPanel.

  2. On the Tools page → Files section, click Directory Privacy.

  3. Navigate to the folder you want to protect.

    • Use the file tree to locate the directory.
  4. Click the Edit icon next to the directory.

  5. Check the box:

    Password protect this directory
  6. Enter a name for the protected directory (this is displayed on the login prompt).

  7. Click Save.

  1. After saving, scroll to Create User.
  2. Enter a username and password.
  3. Click Save.
  4. The user can now log in to access the protected directory.