Using Directory Privacy in cPanel (Firstserv Guide)

Directory Privacy allows you to restrict access to parts (or all) of your website by requiring a username and password before visitors can view content.


When to Use Directory Privacy

You might use this feature when:

  • ✅ Building a new website and want to keep it private
  • ✅ Restricting access to admin or staging areas
  • ✅ Sharing a protected preview with clients

👉 For CMS platforms like WordPress, a maintenance mode plugin may be easier to manage—but Directory Privacy is useful for simple, server-level protection.


Accessing Directory Privacy

  1. Log in to cPanel
  2. Navigate to:
    Files → Directory Privacy
    

Selecting a Directory to Protect

  • Click folder icons to navigate through directories
  • Click the folder name to select it

Example

To protect your entire website:

  • Select:
    public_html
    

Enabling Directory Privacy


Step 1: Enable Protection

  1. Tick:
    Password protect this directory
    
  2. Enter a Name (this appears on the login prompt)
  3. Click Save

Step 2: Create a User

After enabling protection:

  1. Scroll to Create User
  2. Enter:
    • Username
    • Password (twice)

👉 You can use the Password Generator for a secure password

  1. Click Save

✅ This user will now be required to log in to access the directory


Accessing a Protected Directory

When someone visits the protected area:

  • A login box will appear
  • The user must enter the credentials you created

Disabling Directory Privacy

To remove protection:

  1. Go back to Directory Privacy
  2. Open the protected directory
  3. Untick:
    Password protect this directory
    
  4. Click Save

✅ The directory will become publicly accessible again


Managing Users


Delete an Authorised User

  1. Select the username from the list
  2. Click Delete User

✅ This removes access but does not affect files


Summary

  • Directory Privacy lets you password-protect folders in cPanel
  • Ideal for staging sites or restricted content
  • Enable it by selecting a folder and adding a user
  • Disable it anytime by unticking protection

Need Help?

If you’re unsure which directory to protect or how to set it up safely, the Firstserv support team is always happy to help.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Managing Disk Usage in cPanel

Managing Disk Usage in cPanel (Firstserv Guide) Running low on storage can be stressful—but...

Get a free Let's Encrypt SSL for your website

An SSL (Secure Sockets Layer) certificate ensures that the connection between your website...

Importing Large MySQL Databases

Importing Large MySQL Databases (Firstserv Guide) If your database is too large to...

What happens if I exceed my disk space allowance?

Disk Space & Mailbox Usage (Firstserv Guide) Managing your disk space is essential to...

Backing Up Databases via SSH

Backing Up Databases via SSH (Firstserv Guide) This guide explains how to create MySQL...