How to Create a Password-Protected Directory in DirectAdmin

Password-protecting a directory helps you secure sensitive files, restrict access to private areas, and add an extra layer of security to your website. DirectAdmin makes this easy without coding.

Follow the steps below

Step 1: Log in to DirectAdmin

Access your Direct Admin control panel using your hosting username and password.

Step 2: Go to “Password Protected Directories”

On the main dashboard:

Click Advanced Features
Select
Password Protected Directories

Step 3: Choose Your Domain

If you have multiple domains, select the domain where the directory is located.

Step 4: Select or Create the Directory

  • Choose an existing directory you want to protect
    OR

  • Create a new directory and select it

Example directories:

  • /admin

  • /private

  • /members

Step 5: Enable Password Protection

  • Check Enable Password Protection

  • Enter a Protected Directory Name (this will appear on the login prompt)

Click Save.

Step 6: Create a Username and Password

After enabling protection:

  1. Click Add User

  2. Enter:

    • Username

    • Password

  3. Click Save

You can create multiple users if needed.

Step 7: Test the Protected Directory

Open your browser and visit:

https://yourdomain.com/protected-directory

A login box will appear.
Enter the username and password you created.

Why Use Password-Protected Directories?

  • Protect admin or staging areas

  • Restrict client-only content

  • Secure unfinished websites

  • Add extra security beyond login pages

Important Tips

  • Use strong passwords for all users

  • Remove users you no longer need

  • Avoid protecting core WordPress folders like /wp-admin unless necessary

  • Always use HTTPS for better security

Summary

To create a password-protected directory in DirectAdmin:

  1. Log in

  2. Go to Advanced Features → Password Protected Directories

  3. Select domain & directory

  4. Enable protection

  5. Add username and password

  6. Save and test

Simple, secure, and effective!