All Systems Operational|support@delhihosting.com
cPanel

How to Password-Protect a Directory in cPanel

30 Jan 2026 · 4 min read · DelhiHosting Team

Some folders shouldn’t be public — a staging area, private downloads, or an admin tool. cPanel’s Directory Privacy locks them behind a username and password.

When to use it

Protect directories that hold work-in-progress, internal files, or anything not meant for the public. It adds a login prompt at the server level, before any page in the folder even loads.

Set it up

Open Directory Privacy, browse to the folder, tick "password protect", and create a user with a password. Anyone visiting that folder now needs those credentials to get in.

Use it wisely

Server-level protection is strong and simple, but remember the credentials and share them only with the right people. For a whole staging site, protecting its folder keeps it out of public and search-engine view.

Quick tips
  • Protect staging and private folders
  • Set it in Directory Privacy
  • Create a dedicated user/password
  • Great for hiding staging from the public
Key takeaway

Directory Privacy locks any folder behind a login at the server level — ideal for staging areas and private files.

Related cPanel guides

Need a hand with this?

Our Delhi-based engineers handle cPanel, email and server setup for you — free migration included.