You can protect a folder with a username and password – for example a test website, an admin section or files meant only for a few people. When the folder is opened, the browser asks for the login details.
Log in to cPanel – see the article “1.2. Logging in to cPanel”.
1Choose the folder
In the “Files” section of cPanel, open “Directory Privacy”. Click a folder name to open its subfolders, and click “EDIT” next to the folder you need.

2Turn on protection
Tick “Password protect this directory.”, enter a name in “Enter a name for the protected directory:” (it will be shown in the password window) and click “Save”. Then create a user.

Good to know
- After turning on protection, create a user with a username and password on the same page – without a user, nobody can enter the folder.
- The protection also applies to all subfolders.
- Do not protect the whole public_html if the website must be public – then all visitors will be asked for a password.
- This protection does not replace strong passwords and 2FA in the system itself (for example WordPress).
If you run into any difficulties, just write to us and we will help. support@area.lv