How to Password-Protect a Directory
Updated November 5, 2026
Use Directory Privacy in cPanel to require a username and password before visitors can access a folder on your website. You can protect a folder and manage the users who are allowed to access it.
Protect a directory
- Sign in to cPanel and open Directory Privacy.
- Browse the folders to find the one you want to protect, then select its name. Check that the directory shown is the correct one.
- Enable the option to password-protect the directory. Enter a name to identify the protected directory, then save your changes.
- Return to the directory’s settings and create a username and password for an authorized user. Save the user. Repeat to add more users.
Manage access
Return to Directory Privacy whenever you need to add users, change a user’s password, or remove a user. A lock icon next to a folder indicates that it is password-protected.
If something doesn’t work
Check that you selected the intended directory and created an authorized user. If you still can’t set up access, open a ticket with us.
