How to Password-Protect a Folder (Directory Privacy)
Directory Privacy adds a login prompt to any folder — perfect for staging areas, admin tools or private downloads.
-
1
Open Directory Privacy
In cPanel, click Directory Privacy under "Files".
-
2
Pick the folder
Browse to the folder you want to protect and click its name.
-
3
Enable protection
Tick Password protect this directory, give it a label, and Save.
-
4
Create a user
Add a username and a strong password — this is what visitors must enter to open the folder.
-
5
Test it
Visit the folder URL in a private browser window; you should see a login prompt.
Tip: Prefer code? Our free .htpasswd Generator builds Basic-Auth credentials you can use too.
Stuck on a step? Our team is here 24/7.