Set it up
- In cPanel, open Directory Privacy.
- Navigate to the folder you want to protect (e.g.
public_html/staging) and click its name. - Tick Password protect this directory and give it a label (this appears in the browser's login prompt). Click Save.
- Under Create User, set a username and password, then click Save.
Anyone visiting that folder's URL will now see a login prompt. They need the username and password you just created — it's separate from their cPanel login.
Add more users
Go back into the same directory in Directory Privacy and create additional users. Each person can have their own credentials.
Remove the protection
- Open the directory again in Directory Privacy.
- Untick Password protect this directory and click Save.
Protect your entire site
To password-protect everything, apply the protection to public_html
itself. This is handy while you're building a site and don't want anyone
stumbling onto it.
Related guides
Turn on HTTPS everywhere
Get the padlock on every page and send visitors to the secure version of your site automatically.
Your siteUpload a website with File Manager or FTP
Put an HTML site, or one exported from a site builder, live on your domain.
DomainsAdd a subdomain like blog.yourdomain.com
Run a separate site or app on a subdomain, with its own folder and its own HTTPS certificate.
Stuck on a step? Email support@dredgehost.com and we'll help you sort it out.
Did this guide help? A short review on Trustpilot helps other people find a small host they can trust.
