# Protecting directory privacy in cPanel

> Password protect a folder on your website with Directory Privacy in cPanel so only users with a login can open it.

Source: https://helpcenter.ruachost.com/cpanel/security/protecting-directory-privacy-in-cpanel/

**Directory Privacy** (also known as *Password Protect Directories*) allows you to restrict access to certain folders on your website. Visitors must enter a valid username and password to view the contents of the protected directory. This is useful for securing private content, admin areas, or membership sections.

## Why Use Directory Privacy?

- Prevent unauthorized access to sensitive files or folders.
- Secure admin panels, staging sites, or client‑only areas.
- Add an extra layer of protection beyond standard authentication.

## Steps to Protect a Directory

1. **Log in to cPanel.**
2. On the **Tools page → Files section**, click **Directory Privacy**.
3. Navigate to the folder you want to protect.

   - Use the file tree to locate the directory.
4. Click the **Edit** icon next to the directory.
5. Check the box:

   ```
   Password protect this directory
   ```
6. Enter a **name for the protected directory** (this is displayed on the login prompt).
7. Click **Save**.

## Creating a User for the Directory

1. After saving, scroll to **Create User**.
2. Enter a **username** and **password**.
3. Click **Save**.
4. The user can now log in to access the protected directory.

> **Note:**
- You can create multiple users for the same directory.
- Passwords should be strong (use cPanel’s password generator).
- Directory Privacy only protects **web access** (via browser). It does not restrict FTP or file manager access.
- If you disable protection, all users will regain unrestricted access.
