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
- Log in to cPanel
- Go to Directory Privacy
- Navigate to the folder you want to protect
- Click the folder name
- Tick Password protect this directory
- Enter a name for the protected area
- Click Save
Creating Users
- After saving, scroll down
- Enter a username
- Enter a password
- Click Save
Common Uses
- Staging/development sites
- Admin areas
- Client preview areas
- Private file downloads
Removing Protection
- Go back to Directory Privacy
- Select the folder
- Untick "Password protect this directory"
- Save
Note: This creates .htaccess and .htpasswd files in the protected folder.
Was this article helpful?