# How to password protect a folder in cPanel

> Use cPanel's Directory Privacy tool to restrict access to any folder on your hosting account with a username and password.

Source: https://www.kualo.com/knowledgebase/cpanel-files-ftp/how-to-password-protect-a-folder-in-cpanel
Updated: 2026-06-11

---

The Directory Privacy tool in cPanel lets you restrict access to any folder on your account, so that visitors must enter a username and password before they can view pages inside it.

## Enable password protection on a folder

1. Log in to cPanel and click **Directory Privacy** (in the **Files** section).
2. Browse the folder tree - click a folder's **icon** to open it, or click its **Edit** button to select it.

   ![Selecting a folder in Directory Privacy](https://kb-cdn.kualo.com/f8/90/f890a394bfe5637a6b2ad52c94b546ee508468a2.png)

3. Tick **Password protect this directory**, enter a label in the **Enter a name for the protected directory** field, then click **Save**.

   ![The password-protect options for a directory](https://kb-cdn.kualo.com/cc/d6/ccd64f33ec09c29664a64a0370b907353abaa53a.png)

The folder is now protected. Anyone who opens it in a browser will be prompted for a username and password.

:::info
You must create at least one authorised user before anyone can actually log in to the protected folder.
:::

## Add an authorised user

1. After saving, click **Go Back** to return to the page for that folder and scroll to the **Create User** section.
2. Enter a **username**, then enter and confirm a **password** for that user.
3. Click **Add/modify authorized user**.

The user can now log in to the protected folder. Repeat for any additional users. The same page lists all authorised users for the folder - to remove one, click **Delete** next to their name.


---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/cpanel-files-ftp/how-to-password-protect-a-folder-in-cpanel · © Kualo Ltd._
