Protecting directories with passwords

SSL & Security Updated Jan 15, 2026

Password Protect Folders

Add a login prompt to specific folders on your website.

Using Directory Privacy

  1. Log in to cPanel
  2. Go to Directory Privacy
  3. Navigate to the folder you want to protect
  4. Click the folder name
  5. Tick Password protect this directory
  6. Enter a name for the protected area
  7. Click Save

Creating Users

  1. After saving, scroll down
  2. Enter a username
  3. Enter a password
  4. Click Save

Common Uses

Removing Protection

  1. Go back to Directory Privacy
  2. Select the folder
  3. Untick "Password protect this directory"
  4. Save
Note: This creates .htaccess and .htpasswd files in the protected folder.

Was this article helpful?