Uploading a Website to Hosting; A Practical Error-Free Guide

Step-by-step guide to uploading a website on Linux hosting: the correct folder, permissions, index file, and testing before connecting your domain. With real commands and common errors.

7 min Updated 13 Sep 2026

You've Uploaded the Files but the Site Won't Open

Right now you're sitting at your hosting control panel, you've uploaded the files via File Manager or FTP, you've entered your domain address, and you're either seeing a white screen, a 404 error, or a directory listing. This article is for that exact moment; not for tomorrow when you plan to learn. You need to understand three things precisely: where the files should go, with what permissions, and which file is supposed to run first.

The Correct Folder: public_html or htdocs

On ServerNet Linux hosting and almost all cPanel shared hosting, your web root is a folder called public_html. Files you place here become accessible via your main domain address. If you haven't connected your domain to the hosting yet, as explained in the guide to changing your site's domain, you first need to configure your DNS records.

Common mistake: uploading files to the main account folder (at the same level as public_html). The result? example.com won't open, but example.com/public_html will work. That's exactly the sign that your files are in the wrong place.

If your site has a subfolder (e.g., public_html/blog) and you want the main domain to point to that subfolder, you have two options: an .htaccess file in the root with a rewrite rule, or changing the DocumentRoot in the panel. I recommend the second option; it's simpler and won't break with future updates.

Build the Folder Structure in Advance

If your site is WordPress, build the folder structure locally first, then upload the entire folder. Uploading files individually into nested folders wastes time and increases the chance of missing files. With FTP, you can send the entire folder at once:

ftp> put -r wordpress-site

This command in standard FTP recursively uploads the folder and all subfolders. In the hosting File Manager, the Upload option with selecting the complete folder does the same thing.

Permissions: Why We Don't Use 777

File permissions determine who can read, write, or execute. The standard value for files is 644 and for folders 755. This means the owner can write, and everyone else can only read.

Here's where people make mistakes: when WordPress gives a "need write permission" error, the first reaction is to change all files to 777. This temporarily solves the problem but opens your folder to any script on the same server. On shared hosting, your site shares the server with dozens of other sites. A file with 777 permission means any user on that server can modify it. You've seen the sign: the site works one day, and the next day an unknown PHP file has appeared in your folder.

The correct approach: check file ownership. In cPanel, click the Change Permissions option and see who the owner is. If files were uploaded with your FTP user, the owner is that user, and 644/755 is sufficient. If the write error comes from PHP (e.g., WordPress wants to install a plugin), only temporarily set wp-content folders to 775, not everything.

The Index File: Which File Runs First

When the web server receives a domain address without a filename, it looks for an index file in a specific order. On Linux hosting, this order is typically:

index.php → index.html → index.htm → default.php

This means if both index.html and index.php exist in the folder, index.html will be executed. This is where many people stumble: they created a temporary HTML page, then uploaded WordPress, but the browser still shows the old page. No, it's not cache. The index.html file is still there and runs first.

The solution: delete the extra index.html file or rename it. If you want to change the order, write this in your .htaccess file:

DirectoryIndex index.php index.html

This line tells the web server to look for index.php first. For most dynamic sites, this single line is enough.

Testing Before Connecting the Domain

You haven't connected your domain to the hosting yet and want to make sure the site works? You have several options, none of which require DNS changes.

Local hosts File

On your own system, edit the hosts file so the domain points to your server IP. On Linux and macOS:

sudo nano /etc/hosts

And on Windows, open C:\Windows\System32\drivers\etc\hosts with Notepad as Administrator. Add a line:

185.10.10.10 example.com

Get your actual server IP from your hosting control panel. Now your browser will see example.com on the new server, but the rest of the world still sees the old DNS. This method is perfect for fully testing the site before changing DNS. After testing is complete, remove the line.

Temporary Server Address

Most hosting providers give a temporary address, something like server.servernet.cloud/~username. This address is fine for initial testing but has two limitations: if your site uses absolute paths (like /wp-content/...), links will break, and if it's WordPress, you'll need to temporarily change the Site URL option. It's sufficient for a quick "were the files uploaded correctly" test; for full testing, prefer the hosts file method.

Common Errors After Upload

Files are uploaded, the index is correct, but you still have issues. These are the three errors I see most often:

  • White Screen (HTTP 500): Usually the .htaccess file permission or the file itself is corrupted. First, temporarily rename the .htaccess file (e.g., to .htaccess.bak) and test again. If the site comes up, the problem is with the rules inside it. A complete guide is available at Fixing WordPress White Screen.
  • 403 Forbidden Error: This means the web server doesn't have permission to access. Check the main folder's permissions; it should be 755, not 750 or lower.
  • Database Connection Error: The config file (like wp-config.php in WordPress) doesn't yet have the new database information. Get the database name, user, and password from the control panel and enter them in the config file.

If the site works correctly after upload but is slow, measure TTFB before taking any action. If TTFB is high, the problem is with the hosting or your code, not the user's internet. See the WordPress Optimization on Shared Hosting guide for next steps.

Choosing an Upload Tool: FTP or File Manager

CriterionFile ManagerFTP (like FileZilla)
Speed for many filesSlow; each file uploads separatelyFast; multiple simultaneous connections
Uploading a complete folderLimited by browserOne command, entire structure
Editing filesHas built-in editorMust download and upload
Common mistakeUploading to the wrong folderConnection drops on large files

For a site with fewer than 50 files, File Manager is sufficient. For a full WordPress site with dozens of plugins and thousands of files, choose FTP. If your site is truly massive and time matters to you, a dedicated server with SSH access is a better option; there you can transfer the entire site in minutes with rsync, something that would take hours with FTP.

Final Testing: Before Connecting the Main Domain

Before you change DNS, complete this checklist:

  1. The homepage opens with the temporary address or hosts file and gives no errors.
  2. All internal links work (not just the homepage).
  3. Forms and user logins have been tested.
  4. Images and CSS/JS files load (if not, absolute paths are the problem).
  5. You've activated the SSL certificate so the HTTPS version works after the DNS change.

After changing DNS, don't wait for propagation. Use the DNS lookup tool to check that records have been updated on servers around the world. If your site is WordPress and was previously on another domain, be sure to read the domain migration without SEO loss guide; there are a few database queries that, if not executed, will cause internal links to point to the old domain.

Frequently Asked Questions

Why do I see a white screen after uploading my site?

A white screen is usually a PHP error that isn't being displayed. First, temporarily remove the .htaccess file. If the problem isn't resolved, check file permissions and look at the hosting error log. In cPanel, the log path is usually logs/error.log.

Where should I upload my site files?

On Linux hosting, the public_html folder is the web root. Any file you place there is accessible via the main domain address. If the domain isn't connected to the hosting yet, configure DNS first.

What's the difference between index.html and index.php?

The web server chooses between the two in a specific order, and usually index.html runs first. If you have a dynamic site and the old HTML page is still being displayed, delete the extra HTML file or change the order with the DirectoryIndex line on Linux hosting.

Why does FTP connect but the upload stops halfway through?

Most hosting providers have limits on file size per upload or connection duration. Upload large files with File Manager, or if you have SSH access, use rsync, which resumes from where a dropped connection stopped.

Was this page helpful?