.htpasswd file under the hood.
Open it from cPanel home → Files → Directory Privacy.


Lock a folder
Browse to the folder
Click into the folder you want to protect. Use the Home button to reset, the folder icons to drill down.
Tick the box and save
Tick Password protect this directory, give it a label (shown to users in the login prompt), and save.
Common uses
- Staging or
/dev/folders that aren’t ready for public eyes - Internal admin folders for tools that don’t have their own login
- Files you want gated but don’t want to wire up a full app login for
Things to know
- Protection is HTTP basic auth. Browsers prompt for credentials and remember them per session.
- Search engines can’t index a protected folder. The auth check fires before crawlers see anything.
- The
.htpasswdfile is stored outside the protected folder. Don’t edit it manually unless you know what you’re doing; cPanel can rewrite it on save. - Removing protection: revisit the folder, untick Password protect this directory, save.

