What is a public_html folder?
The public_html folder is the document root directory for your primary domain name. This is where you upload all website files you want to appear when someone types your main domain (the domain name you provided when you signed up for a hosting plan at HostGator).
When users visit your website, everything stored in the public_html directory will display in their browser. This folder is where you should keep all website content intended to load when a visitor accesses your site. For example, if your public_html folder contains a file named index.html—or any recognized default index file—the server will automatically display that page.
This article discusses the following topics:
Where is my public_html folder located?
Your public_html folder is located within the File Manager in your cPanel.

Please check out the following article to learn how to access File Manager, or click the link to go directly there if you are already logged in to your Customer Portal:
File Path and URL Structure
If your public_html directory does not contain any default index files (such as index.html or default.html), a list of default files may appear instead.
| File Path in File Manager (or in FTP)* | Corresponding URL in a web browser |
|---|---|
| /public_html/ | http://www.example.com/ |
| /public_html/pagename.html | http://www.example.com/pagename.html |
| /public_html/foldername/ | http://www.example.com/foldername/ |
| /public_html/foldername/pagename.html | http://www.example.com/foldername/pagename.html |
- Replace "example.com" with the primary (main) domain on your account (the domain name you provided when you signed up for a hosting plan at HostGator).
- *The full path is actually "/home/cpanelusername/public_html/" rather than "/public_html/." In most places, you will see "/public_html/" instead of the full path since it is assumed you know you are in your home directory.
File Permissions
Correct file permissions are essential for securing your website files. The default permissions in your public_html directory are:
- The public_html folder should always have 0750 permissions.
- All folders inside public_html should have 0755 permissions.
- All files inside public_html should have 0755 or 0644 permissions.
Some scripts may recommend using 777 permissions, but our servers are configured to use 755 for the same purpose since it is far more secure. Setting any file or folder to 777 will make it inaccessible. Always use 755 instead of 777.