HostingSpanish version

Support article

public_html: Everything You Need to Know About This Folder

The public_html folder is the root directory where your website's files are published. Here's what it is, its permissions, and how to fix the most common problems.

Published: 30/06/2026Updated: 07/07/2026

What is the public_html folder?

The public_html folder is the root directory on web servers where the HTML, CSS, JavaScript files and other static files that make up a website are stored and served. It’s the folder located at the highest level of the file structure and is accessible on the internet through a domain name or an IP address.

Inside the public_html folder are the files that make up the website, including images, videos, style sheets, scripts, among others. Additionally, it’s important to mention that some web applications, such as CMS platforms (content management systems) like WordPress, Joomla, or Drupal, also store their files in the public_html folder.

It’s important to keep in mind that the public_html folder is public and any user can access the files contained within it, so you should pay attention to the security and protection of the data stored there. In short, the public_html folder is fundamental for storing the files that make up a website and making them accessible over the internet.

How can files in the public_html folder be modified?

To modify files in the public_html folder, you need to have access to the hosting account and use a file management program, such as Filezilla. Once you’ve accessed the file manager, you need to look for the files located in the public_html folder and select the one you want to modify. It’s important to note that some files may have restricted write permissions, so it will be necessary to change the permissions to make modifications. To do this, simply right-click on the file, select File Permissions, and change the permission values to read and write for the corresponding user. Once the changes are made, the files must be saved and closed so that the changes are applied to the web page. It’s essential to be careful when making modifications to files in the public_html folder, since any mistake can affect the functioning of the website. For this reason, it’s recommended to always make a backup before making any changes.

What permissions are required for the public_html directory?

To access and manage the public_html directory, you need to have certain permissions on the server. First, you need read permissions to view the folder’s contents and, second, write permissions to add, modify, or delete files within it.

Additionally, it’s important to make sure that the permissions are configured correctly to avoid security issues. In general, permissions are recommended to be set as follows:

– Read (r): 4

– Write (w): 2

– Execute (x): 1

Generally speaking, we can say that files should have permissions 644 and directories 755.

How can the public_html folder be protected to prevent unauthorized access?

The public_html folder is one of the most important parts of a website, since it’s where all the content displayed to the public is stored. Therefore, it’s essential to protect it to prevent unauthorized access and ensure the security of your data.

There are several measures you can take to protect the public_html folder, including:

1. Change access permissions: It’s essential to ensure that the folder’s access permissions are correct. In general, permissions should be 755 for the folder and 644 for files. This will allow authorized users to read and write to the files, but will prevent unauthorized users from accessing them.

2. Use strong passwords: Make sure that your passwords are strong enough and that they are changed regularly. Avoid using obvious passwords or ones that are easy to guess.

3. Keep software up to date: Keep the software you use on your website up to date, including the content management system, plugins, and extensions.

Which control panels use public_html?

The public_html directory is primarily used by hosting control panels, such as cPanel, Plesk, DirectAdmin, among others. At mihosting you have access to cPanel and DirectAdmin, depending on the hosting plan you’ve purchased.

These panels allow users with administrator access to manage and publish content on their websites in a simple and efficient way. Additionally, these control panels usually include security tools that help protect the public_html folder and ensure data integrity. It’s important to choose a reliable and secure control panel to avoid security issues on the website.

Which domain is installed in the public_html folder?

The public_html folder is where the main domain of a website is installed. In other words, when you purchase your web hosting, a public_html folder is assigned that corresponds to the domain you used when you purchased the hosting service. It’s important to note that subfolders can be created within the public_html folder to host other domains or subdomains.

What is the relationship between the public_html folder and www?

The public_html folder and the www subdomain are closely related, since both are used to access the website. When a website’s name is typed into a browser, the server looks for the public_html folder of the corresponding domain and loads the files and content stored in it. On the other hand, the www subdomain is a convention used to identify the public_html folder of the main domain. In other words, a website’s URL can start with www or not, but in both cases the same public_html folder is being accessed. In any case, it’s important to ensure that both the public_html folder and the www subdomain are correctly configured so that the website works properly.

How do I install a new domain name in public_html?

On all of our hosting plans, you can add domains to your hosting service. To install a new domain in the public_html folder, you need to access the control panel, where you can add the domain and place it in the folder of your choice, with this folder being the root for the domain you just installed.

It’s important to remember that the new domain must be registered and configured to point to our servers by configuring mihosting’s DNS. If you have doubts or problems during the process of installing the new domain in public_html, you can contact our technical support team.

At the root of my hosting there’s a www directory that shows the same information as the public_html directory, what does this mean?

The presence of a www directory at the hosting root that shows the same information as public_html may be due to a particular server configuration. This configuration is common on cPanel servers. In some cases, www is used as an alias for public_html, that is, they are two different names that point to the same folder. This allows users to access the website by typing the URL with or without www at the beginning.

Which folder do I upload my website’s files to?

Your website’s files must be uploaded to the public_html folder within the hosting server. You can do this through an FTP client or via the hosting control panel’s file manager. It’s important to make sure you upload the files to the correct folder, since if you upload them to another folder, your website may not be accessible or may present errors. Additionally, it’s recommended to maintain a clear and orderly organization of the files and folders within public_html to facilitate their management and updating in the future. If you have problems or questions about how to upload your files to public_html, you can contact the hosting’s technical support for help and guidance.

Common problems

I uploaded my site but it doesn’t show

You may have uploaded the files to the wrong folder, or there’s no starting file such as index.html or index.php at the root of public_html.

I see “Index of” instead of my website

The server can’t find a starting file (index.html, index.php) inside the folder, so it shows the file listing instead.

I see the old page after updating

This is usually browser cache, website caching (for example a WordPress caching plugin), or old files still left in public_html. Clear the cache before assuming the problem is real.

Frequently asked questions

Can I delete public_html?

It’s not recommended. It’s the essential folder that displays your main website — deleting it would leave your domain with no content.

Where do I upload WordPress?

Usually inside the domain’s public folder; for the main domain that’s typically public_html directly.

Do all domains use public_html?

Not always. Addon domains on multi-domain hosting can have their own folders separate from public_html.

Conclusion

public_html is the folder where your main website’s visible files are published, with recommended permissions of 755 for the directory and 644 for files. Before uploading new content or replacing existing files, confirm the correct path for the domain and make a backup.