Thapa Technical — Dev Blog
React Vite Hostinger MCP Google Antigravity Gemini

Deploy React App on Hostinger Shared Hosting
using Hostinger MCP.

Normally, hosting a React app is full of manual steps, ZIP files, and hPanel navigation. But with Google Antigravity + Gemini and Hostinger MCP, you can now build, upload, and update your site directly from your IDE. Let's see how.

The Manual Hosting Struggle

Normally, when we create a React app, the coding part is fun and interactive. But once the development phase completes, the real confusion begins:

  • Which files should be uploaded to the server?
  • Do I upload the entire source code directory?
  • Should I include node_modules in the transfer?
  • What is the purpose of the dist or build folder?
  • How do I connect and map domains/subdomains without breaking things?

When something breaks (like a blank screen, missing routing links, or 404 pages), we are forced to open hPanel, browse File Manager, look up DNS records, or check deployment logs manually.

Today, we are changing this workflow. By utilizing Google Antigravity, the Gemini LLM, and the Hostinger MCP, we can manage, configure, and execute deployments right from our IDE.

What is Hostinger MCP?

MCP stands for Model Context Protocol. You can think of it as a secure bridge or translator between an AI coding assistant and external services.

Instead of Gemini only recommending code changes, the Hostinger MCP empowers Gemini to call actual hosting tools on your behalf. Depending on the tools configured in your MCP setup, this allows you to:

  • Deploy using MCP: Deploy static frontend files directly.
  • Configure Domain Settings: Retrieve WHOIS profile details or check availability.
  • Manage Databases: List databases, create new tables, and update configuration credentials.
  • Inspect Live Settings: Read website logs and troubleshoot deployment status without tab-switching.
💡 This integration changes AI from a simple code generator into a contextual assistant that can directly manage your cloud hosting environments.

Step-by-Step React Deployment

Let's walk through the exact steps to build and host your website with Hostinger MCP using the beautiful step-card layout.

1
Vite Dev

Run Locally to Test Stability

First, ensure your project is stable locally. Run the development commands to launch your local server:

bash — Local Server
npm install
npm run dev

Or run the Vite development server directly:

bash — Vite Runner
npx vite
2
AI Audit

Prompt Gemini for Build Specifications

Instead of guessing configuration paths and build settings, ask Gemini in Google Antigravity to analyze your package setup:

Prompt
"Analyze this React project and tell me the correct production build command."
3
Build

Compile the Production Build

Run the build command suggested by the AI (typically npm run build) to compile the React source code into static production-ready files:

bash — Build App
npm run build

This generates an optimized static build directory (typically dist/ for Vite or build/ for Create React App). Never upload your raw source code or node_modules folder to shared hosting.

4
MCP Deploy

Deploy using Hostinger MCP

Prompt Gemini to automatically upload your static build files straight to Hostinger shared hosting using MCP tools:

Prompt
"Use Hostinger MCP to deploy the production build of this React app to my Hostinger shared hosting. Deploy the dist folder as a static website."

The AI assistant will handle the network connections, upload the build directory, and write the files to the web server's public_html folder.

5
Verify

Check Live Status

Request Gemini to verify the deployment status and retrieve the active live URL:

Prompt
"Check the deployment status and confirm whether the website is live."

Redeployment & Updates

In real-world development, you don't deploy only once. If you make a design or text change, you simply build again:

bash — Rebuild
npm run build

Then, request the assistant:

Prompt
"Redeploy the latest React build to the same Hostinger website and check if the new version is live."

The AI handles replacing the old public_html files automatically.

Manual vs. MCP Workflow Comparison

Task Step Manual Workflow MCP Workflow (IDE-Integrated)
Build Preparation Run build & zip files manually Gemini audits config & builds automatically
File Uploading Open hPanel & use File Manager upload Gemini uploads the build folder via MCP tools
Errors & Logs Navigate menus & search stack traces Gemini checks logs & debugs code within the IDE

Fixing React Router 404 Issues

If your React app uses client-side routing (like React Router) and a user refreshes a nested route like /about or /dashboard, Hostinger's Apache server might return a 404 Not Found.

This happens because the server searches for a physical about/index.html folder or file. To fix this, you must route all path requests back to index.html so React Router can process them.

Instruct Gemini using this prompt:

Prompt
"My React Router page is showing 404 on refresh. Create the correct .htaccess rewrite rule for Hostinger shared hosting."

Here is the standard file to place inside your build folder (or public/ folder to copy during compilation):

.htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

List of Useful Prompts for Gemini

Save these prompts to use next time you host a website with Hostinger MCP:

Prompt 1: Analyze Project
"Analyze this React project and tell me the correct production build command."
Prompt 2: Build App
"Build this React app for production and identify the final output folder."
Prompt 3: Deploy via MCP
"Use Hostinger MCP to deploy the production build folder to my Hostinger shared hosting as a static website."
Prompt 4: Verify Live Status
"Check the deployment status and confirm whether the website is live."
Prompt 5: Debug Failures
"If deployment fails, check the logs or error details and explain the fix in simple words."
Prompt 6: Rewrite Rule
"My React Router page is showing 404 on refresh. Create the correct .htaccess rewrite rule for Hostinger shared hosting."

Discussion

Leave a Reply
Ready to Learn Frontend?
Become a React Specialist

Join our live online classes. Master modern React hooks, State management, custom components, and production architectures.

Explore React Course
Also check: /courses/frontend/javascript-online-class.php — JS Fundamentals