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
- Log in to cPanel
- 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
- Tick:
Password protect this directory
- Enter a Name (this appears on the login prompt)
- Click Save
Step 2: Create a User
After enabling protection:
- Scroll to Create User
- Enter:
- Username
- Password (twice)
👉 You can use the Password Generator for a secure password
- 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:
- Go back to Directory Privacy
- Open the protected directory
- Untick:
Password protect this directory
- Click Save
✅ The directory will become publicly accessible again
Managing Users
Delete an Authorised User
- Select the username from the list
- 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.
