Where to upload website files in cPanel: public_html and domain folders

Print
  • 0

In short: the website of your primary domain goes into the public_html folder. Each addon domain and subdomain has a folder of its own, which cPanel shows on the Domains page. Place the start file of the site (index.php or index.html) directly in that folder, not one level deeper.

Which folder belongs to which domain

Open cPanel and go to Domains, then Domains. The table lists every domain of the account with its Document Root. Clicking the folder path opens it straight in File Manager, so you cannot end up in the wrong place.

  • Primary domain: /home/username/public_html, where username is your cPanel login.
  • Aliases (parked domains): they use the folder of the primary domain and show the same site.
  • Addon domains and subdomains: the folder chosen when the domain was added. For a separate site, untick Share document root while adding the domain, as explained in How to add a domain to cPanel and Hosting several websites in one cPanel account.

Uploading with File Manager

File Manager works in the browser and suits a handful of files or a site packed into one archive.

  1. In cPanel, open Files, then File Manager, and go to the document root of the domain.
  2. Click Upload in the toolbar. Drag the files into the page or pick them with Select File, and wait until every bar reaches 100%.
  3. Return with the link back to the folder. For a whole site, upload a single .zip file, tick it and click Extract. Check the target path in the dialog before you confirm.
  4. Delete the archive once it has been extracted. An archive left in a public folder can be downloaded by anyone who guesses its name.

Extract handles zip, tar, tar.gz and tar.bz2 archives. A RAR or 7z file has to be repacked as zip on your computer first.

Uploading over FTP

An FTP program is the better choice for large sites and thousands of files, because it resumes and retries transfers on its own.

  • The main FTP account uses the cPanel username and password. The server is ftp.yourdomain once the domain points to TopHost, or the server IP address before that. Port 21.
  • This account starts in the home folder, not in public_html. Open public_html (or the folder of the right domain) before you upload anything.
  • To give a developer access to one site only, create a separate account: How to create an additional FTP account. The connection itself is described in Setting up FileZilla.

Installing a CMS instead of uploading

For a new WordPress site you do not need to upload anything: install it from cPanel with WP Toolkit (How to install WordPress on cPanel, Complete guide to WP Toolkit). The installer puts the files in the right folder and creates the database. If you are bringing an existing site with its database, follow Website upload via cPanel or Moving your website to TopHost.

Mistakes we see most often

  • One folder too deep. The archive contained a folder, so the site ended up in public_html/mysite/. The domain then shows an empty page or a 403 error. In File Manager, open the inner folder, select everything, click Move and enter /public_html as the destination.
  • An old index.html is still there. The server opens index.html before index.php, so a leftover placeholder page hides the new site. Delete or rename it. The full order is explained in cPanel folder structure.
  • Files placed next to public_html. Anything stored directly in the home folder is not visible on the web.
  • The domain still points elsewhere. The files are in place, but visitors see the old host. Check the nameservers (for .MD domains, for international domains) or test the site in advance as shown in How to access the site while it is being delegated.
  • Files arrive with 0 bytes. This usually means the disk space of the plan is full: see File uploaded with zero size.

If the site still does not appear after these checks, open a ticket at https://billing.tophost.md/submitticket.php and tell us the domain and the folder you uploaded to.

Was this answer helpful?