Articles on: Website Hosting

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!

You can also IP whitelist directories, follow our guide here on this.

Log into cPanel. If you're unsure, take a look at our Logging In To cPanel guide.

Once logged in, head over to Files, and then Directory Privacy.


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.

Navigate to the folder you want to password protect and click Edit.


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.


You should get a success message stating that you have set the access permissions.


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

Under Create User, enter in the username you want, and a secure password twice. Then, press Save.


You will now see a success message.


10, Press Go Back, and check that your user is under Authorised Users.


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.

Updated on: 18/11/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!