> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://wiki.volthosting.co.uk/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to password protect directories on cPanel

Sometimes you want to password-protect documents to ensure that unauthorised users can't access them. Thankfully, cPanel has a feature to password-protect directories with a username and password!

|| Looking for cPanel website hosting? Take a look at our [cPanel website hosting plans](https://volthosting.co.uk/cpanel.html)!

You can also IP whitelist directories, [follow our guide here on this](https://wiki.volthosting.co.uk/en/article/how-to-allow-or-block-a-specific-ip-address-for-your-website-on-cpanel-ndk45r/).

1. Log into cPanel. If you're unsure, take a look at our [Logging In To cPanel](https://wiki.volthosting.co.uk/en/article/logging-in-to-cpanel-t631gj/) guide.

2. Once logged in, head over to `Files`, and then `Directory Privacy`.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/w6grzvdp57mmqmgfxtzfixzhd3kw3i_zxuhke.png)

3. Once there, you'll see a folder tree of all the directories on your cPanel account, you can click on their name to navigate down the folder structure.

4. Navigate to the folder you want to password protect and click `Edit`.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/mfikduhp1qju3vvsvjz5xvzv8bi0rf_13qbmt.png)

5. On this page, select `Password protect this directory`. You can change the `Name` to something which makes sense to you, or leave it default, then press `Save`.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/qemuzv1ldbbaecdawj1engwsb0huwg_ufcr0i.png)

6. You should get a success message stating that you have set the access permissions.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/xtq5hwozwu7hobcztvbsndxkjlr94d_arksnz.png)

7. Press `Go Back`, and it'll bring you to the `Set permissions for “yourdomain.tld”.` page. Now we will create the user.

8. Under `Create User`, enter in the username you want, and a secure password twice. Then, press `Save`.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/oywjm9y5uvpgh0k2ejlkj21krlxr5m_jdie5g.png)

9. You will now see a success message.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/trviyk1xfpb5rz502udk8xjxvgnetm_drrz3w.png)

10, Press `Go Back`, and check that your user is under `Authorised Users`.
![](https://storage.crisp.chat/users/helpdesk/website/a7f74f9f83d47000/ds1pan3luxctme4ndyempxup3vvuww_1kml8wp.png)

11. Done! Your directory is now username and password protected. When a user attempts to access the directory, they will get a prompt to login with their username and password before being allowed to proceed.
