Protecting a Folder With an Extra Password in DirectAdmin
Explains how to protect a specific folder on your web hosting with an extra username and password.
Want visitors to log in first before they can view a specific folder on your website, for example a test environment? In this article, we explain how to set this up with Directory Protection.
Protecting a folder
- Log in to DirectAdmin via
yourwebsite.com:2222. - Navigate to Directory Protection (under Advanced Features or Account Manager, depending on your panel version).
- Browse to the folder you want to protect and click it.
- Check Protect this directory and click Save.
- Add a username and password under Add Authorized User.
- Click Create.
Note: This only protects the folder itself, not automatically subfolders. Want to protect an entire structure? Apply this to the root folder.
Testing the result
Visit the folder directly through the browser. You will now get a login prompt (HTTP Basic Authentication) before the content becomes visible.
Troubleshooting
- No login prompt showing: check whether you selected the correct folder and whether the protection was actually saved.
- Password doesn't work: remove the user and add them again, this sometimes helps with an incorrectly saved password.
- Your own website/CMS login no longer works well together with this protection: this can happen with certain CMS systems that also use their own authentication, in that case consult with us via a ticket.
Still stuck? Feel free to reach out via Discord or create a support ticket.
Anne
Updated on: 10/15/2026
Was this article helpful?
