Password-protect a folder

Updated on 10 November 2026

  1. In cPanel, open Directory Privacy.
  2. Choose the folder to protect (for example public_html/private), then Edit.
  3. Tick Password protect this directory, name the area and save.
  4. On the same page, create a user and its password.

The browser now asks for these details for everything in that folder.