🚀 Deploy to Hostinger Premium

A simple step-by-step guide using a subdomain

HTML HTML PHP PHP JavaScript JavaScript MySQL MySQL Node.js Node.js React React Vite Vite
1

Log In to Hostinger

Open your hPanel dashboard

  1. Go to hostinger.com and click Log In.
  2. Enter your email and password.
  3. Click Hosting in the top menu.
  4. Find your Premium Plan and click Manage.
2

Create a Subdomain

Example: app.cpst.site

  1. In hPanel, go to Domains → Subdomains.
  2. In the Subdomain box, type your name — e.g. app or system.
  3. Select your domain from the dropdown.
  4. The folder path will auto-fill, e.g. public_html/app. Leave it as is.
  5. Click Create.
⚠️ Your subdomain folder is created automatically. All your files go inside that folder.
3

Create the Database

Set up MySQL for your system

  1. In hPanel, go to Databases → MySQL Databases.
  2. Click Create New Database — name it something like myapp_db.
  3. Create a database user and set a strong password.
  4. Assign the user to the database with All Privileges.
  5. Click phpMyAdmin next to your database.
  6. Go to the Import tab, choose your .sql file, and click Go.
✅ Save your DB name, DB user, and DB password — you'll need them in the next steps.
4

Upload Your Files

Put your project into the subdomain folder

  1. In hPanel, go to Files → File Manager.
  2. Open the subdomain folder, e.g. public_html/app.
  3. Click Upload and select your .zip project file.
  4. After upload, right-click the zip and click Extract.
  5. Make sure index.php (or index.html) is directly inside the folder — not in a subfolder.
💡 You can also use FTP (FileZilla) if your project is large. Get FTP credentials from Files → FTP Accounts.
Node.js If using React / Vite / Node.js, run npm run build on your local machine first. This generates a dist/ folder — that's the only folder you need to upload. Zip the contents of dist/, upload the zip to your subdomain folder in File Manager, then extract it. Make sure index.html ends up directly in the subdomain root — not inside a nested dist/ subfolder.
5

Connect PHP to MySQL

Update your database config file

  1. In File Manager, open your config file (e.g. config.php or .env).
  2. Update the database details:
<?php
define('DB_HOST',     'localhost');
define('DB_NAME',     'u123456_myapp_db');
define('DB_USER',     'u123456_dbuser');
define('DB_PASSWORD', 'YourPassword123');
⚠️ On Hostinger, DB names and usernames are prefixed with your account username (like u123456_). Copy the exact names from the MySQL Databases panel.
6

Test Your Site

Make sure everything is working

  1. Open your browser and go to https://app.cpst.site.
  2. Check that your site loads correctly.
  3. Test your forms, login, and database features.
  4. Check for the 🔒 padlock in the browser — that means SSL is active.
  5. Press F12 → Console to check for any JavaScript errors.

Common Errors:

  1. 500 Error — wrong file permissions. Set folders to 755, files to 644.
  2. 404 Not Found — your index.php is not in the right folder.
  3. DB Error — wrong DB name, user, or password in your config file.
  4. Blank page — check hPanel → Error Logs to see what PHP says.
🔎 Always fully test your site after deploying. A system that works perfectly on your local machine can behave differently on a live server — file paths, database connections, environment settings, and permissions can all cause unexpected bugs or errors once deployed. Click through every page, test every form, try logging in, and check all features before sharing the link with others.

🎉 You're Live!

Your system is now deployed and running on Hostinger.

https://app.cpst.site

To update your site later, just re-upload the changed files via File Manager.