Knowledge Base
Save up to  70% off.  Start your website today!

What is a public_html folder?


The public_html folder is the document root for your primary domain name. This is where you put 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, whatever is in the public_html folder will be shown to them in their browser. The public_html is the folder (or directory) where you would want to keep all website files you want to be pulled up when a user visits your website. For example, if you have a file called index.html, or any of the other default file names in the public_html folder, it will display that page.

This article discusses the following topics.

Where is my public_html folder located?

The public_html folder is located within the File Manager of your cPanel.

Home Directory

Please check out the following article to know how to access the File Manager, or you can click this link to be redirected there, provided you're already logged into your Customer Portal.

A list of default files will be shown if you do not have a file in the public_html folder (such as index.html, default.html, etc.).

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

File permissions are important to keep your website files secured. The default permissions of your public_html and its files and folders are as follows.

  • The public_html folder should always have 0750 permissions.
  • All folders inside the public_html folder should have 0755 permissions.
  • All files inside the public_html folder should have 0755 or 0644 permissions.

Some websites and scripts may advise you to use 777 permissions; however, our servers are configured to use 755 for the same purpose instead since it is more secure. Permission of 777 on any file or folder will cause the file to be inaccessible. Use 755 instead of 777.


Did you find this article helpful?

* Your feedback is too short