How to Password Protect a Folder on Your Website in DirectAdmin
Last updated Changelog
On this page
Password Protected Directories puts a password on a folder of your website. Anyone who opens a page in that folder sees a login box and needs a username and password to get in. It’s a quick way to hide a staging site, a members area or files for one client. In this example we’ll protect yourdomain.com/members.
Steps
-
Log in to DirectAdmin. In the Advanced Features section, click Password Protected Directories.

-
Click Add Protected Directory next to your domain.

-
Under Path, click your website folder (
domains/yourdomain.com/public_html) to open it, then pick the folder to protect, such as members. Type a Directory realm: visitors see this name in the login box. Click Protect.
-
Under Manage users, type a Username and Password (or click the dice icon to generate one), then click Add User.

-
The user is listed. Add more users the same way if more than one person needs to get in.

In our test, https://directadmin.cranedemo.com/members/ showed a login box straight away and only opened with the right username and password.
Note: The username and password are only for this folder. They’re not an email or DirectAdmin login, so you can give them out without sharing anything else.
Troubleshooting
| Problem | What to do |
|---|---|
| I want to change a user’s password | Open the protected folder from Password Protected Directories and click Change password next to the user. |
| I want to remove someone’s access | Click Delete next to their username. |
| I want to remove the password completely | On the Password Protected Directories page, click Remove Protection next to the folder. |
| The login box keeps coming back | Check you’re typing the username exactly as you created it. Passwords are case-sensitive. |
Snagged on something? Contact support and we’ll get you sorted.