Offer

Pay yearly and get 2 months free + an extra 30% off your hosting

Claim offer
HostingWeb HostingLiteSpeed and NVMe on FlyPanelfrom ৳100BDIX HostingPeered inside Bangladeshfrom ৳100WordPress HostingTuned for WooCommercefrom ৳1,000
Built in-houseFlyPanel, malware protection, backupsCustom-tailored, included on every plan→
2 months free on yearlyCompare products
ServersVPS HostingKVM with full root accessfrom $20BDIX VPSPeered inside Bangladeshfrom $20Dedicated ServersAMD Ryzen and dual Xeonfrom $250
1 Gbps port, Tier-3 datacentersCustom build
ResourcesKnowledgebaseSetup guides and troubleshootingBlogProduct news and performance tipsAbout Doze HostWho we are and where servers liveNetwork statusLive uptime for every service↗
Register a domainSearch and register a new nameClient areaBilling, services and invoices↗
Talk to an engineer, 24/701795 470074
Talk to us, 24/7Call an engineerReal people, day and night01795 470074Email supportsupport@dozehost.com↗Open a ticket27 min average first response↗
Help yourselfKnowledgebaseSetup guides and troubleshootingBlogProduct news and performance tipsNetwork statusLive uptime for every serviceLive
Client area: billing, services, invoicesLog in
Hosting Web Hosting ৳100/moLiteSpeed, FlyPanel, daily backups BDIX Hosting ৳100/moPeered inside Bangladesh WordPress Hosting ৳1,000/moTuned for WooCommerce
Servers VPS Hosting $20/moKVM with full root BDIX VPS $20/moPeered inside Bangladesh Dedicated Servers $250/moAMD Ryzen and dual Xeon
Domains
Resources Knowledgebase Blog About Doze Host Network status
Help Call 01795 470074Real engineers, 24/7 Email supportsupport@dozehost.com Open a ticket27 min average first response Knowledgebase Blog
Get started Log in
Home / Knowledgebase / cPanelcPanel

How to Password Protect a Directory in cPanel

Last updated July 21, 2026About 1 minute to read

Sometimes you need a folder — a staging copy of a site, an internal tool, a set of client files — visible only to people with a password, without building a full login system. cPanel’s Directory Privacy feature does exactly this at the web server level.

Setting it up

  1. Go to Files > Directory Privacy.
  2. Navigate to and select the folder you want to protect.
  3. Tick “Password protect this directory” and give it a label (shown in the login prompt).
  4. Save, then scroll down to create a username and password for someone who should have access — repeat to add more users.

What visitors see

Anyone browsing to that folder’s URL gets a plain browser-native username/password prompt (HTTP Basic Authentication) before anything in the folder loads — including any web pages inside it, so this protects the whole directory, not just a single page.

Good use cases

  • A staging/development copy of a live site, kept out of search engines and casual visitors.
  • A shared folder of files for a specific client, without setting up individual accounts.
  • An internal admin tool that doesn’t have its own authentication built in.

What it isn’t good for

This is a blunt, all-or-nothing lock on an entire folder — it isn’t a substitute for a real login system if you need different users to see different content, or for anything requiring detailed access logs and permission levels. It’s also visible as a login prompt, not a hidden folder — the URL itself isn’t secret, only what’s inside it once you try to load it.

Removing protection later

Return to Directory Privacy, select the folder, and untick “Password protect this directory” — the folder becomes publicly accessible again immediately.

Still stuck?Our support team is here 24/7. A real person replies to every request.