Directory Privacy adds a username and password prompt to web access for a selected folder. This guide explains how to enable it in cPanel and create an authorised user.

Enable protection

  1. Open Files > Directory Privacy in cPanel.

    files>directory privacy

  2. Locate the directory and select Edit. Use folder icons to navigate into subdirectories.

    directory privacy

  3. Select Password protect this directory.

  4. Enter a descriptive name for the authentication prompt. This does not rename the directory.

  5. Select Save.

    privacy

Create an authorised user

  1. Return to the directory’s settings.

  2. Under Create User, enter a username and strong password.

  3. Select Save.

    create user

Test access

Visit a file in a private browser window. Check that it prompts for credentials, rejects an incorrect password and permits the authorised user.

Directory Privacy does not replace filesystem permissions or protect other application routes serving the same data. Disabling directory listing only hides the list of files; known file URLs remain accessible unless separately protected.