How to Use Password-Protected Directories in Plesk
Plesk allows you to password-protect specific folders on your website, requiring visitors to enter a username and password before accessing the content.
Step 1: Log in to Plesk
Go to:
https://your-server-ip:8443
Log in with your Plesk credentials.
Step 2: Go to Websites & Domains
-
From the sidebar, click Websites & Domains
-
Select the domain you want to work with
Step 3: Open Password-Protected Directories
-
Under your domain’s tools, click Password-Protected Directories
-
If not visible, expand the “Show More” menu
Step 4: Add Protected Directory
-
Click Add Protected Directory
-
Enter the path to the folder you want to protect (e.g.,
/private
,/admin
) -
Add a name for internal reference (e.g., “Admin Area”)
-
Click OK
⚠️ If the folder doesn’t exist yet, Plesk will create it for you.
Step 5: Add Authorized User
After adding the folder:
-
Click the directory name in the list
-
Click Add User
-
Enter a username and password
-
Click OK
Now, only users with this login can access the protected folder via a web browser.
Step 6: Test Access
Open your browser and go to:
https://yourdomain.com/protected-folder
You should be prompted to enter the username and password.
Optional Tips
-
You can add multiple users to the same protected directory
-
Combine this with an
.htaccess
file for extra restrictions (optional for advanced users) -
To remove protection, simply delete the directory entry from Password-Protected Directories
Use Cases
-
Securing admin panels
-
Restricting staging environments
-
Hiding files from public view