How to Password Protect a Directory in cPanel
How to Password Protect a Directory in cPanel
You can lock a directory with a password using cPanel's Directory Privacy feature. Follow the steps below to set it up:
- Log in to your cPanel account.
- In the Files section, click on Directory Privacy.
- Click on the directory you want to protect.
- Click on the Edit button next to the directory.
- Under Security Settings, check the box for Password protect this directory, then click on Save.
- Click on Go back.
- Scroll down the page. Under Create User, fill in the username and password fields, or use the Password Generator option to generate a new random password. Copy it to Notepad and click on Save.
If you try to open the password-protected directory in your browser via the URL www.example.com/myfolder, your browser will prompt you for credentials.
Related articles
- How to Protect Website Images From Being Displayed at an External Website
- How to Restrict Access to Directories by IP Address
- How to Block an IP Address to Deny Access to Your Website
- How to Disable the Two-Factor Authentication on Your cPanel Account
- Lost Password Reset - Nabtech
- SiteLock Website Security - Nabtech
- NordVPN - Nabtech
- Security: CVE-2026-41940 - cPanel & WHM / WP2 Security Update - Nabtech
Was this article helpful?
Discussion
Loading the discussion…
Sign in to join the discussion.