Contents
React is a library that runs in the visitor’s browser, so what you actually host depends on how your project is built. Most React apps today are built with Vite and produce a folder of static files. That’s the easy case: nothing to install on the server, just the files and one rule for routing.
What are you actually hosting?
| Project type | Build output | Plan that fits |
|---|---|---|
| SPA with Vite | A dist folder of static files |
Any hosting plan |
| Create React App (legacy) | A build folder of static files |
Any plan; moving to Vite is better |
| React with a PHP API | Static files plus PHP scripts | Any plan, since every hosting plan has PHP |
| React with a Node.js API | Static files plus a Node.js app | AI/Developer plans (Express hosting) |
| Next.js or React Router with SSR | A Node.js server | AI/Developer plans (Next.js hosting) |
Create React App was officially deprecated in 2025, so start new projects with Vite or a framework such as Next.js.
What a React app needs in production
- Node.js for the build only: Vite 7 needs Node.js 20.19, 22.12 or newer on your computer.
- The base path: if the app lives in a subfolder such as
/app/, setbaseinvite.config.jsandbasenamein React Router. - Build-time variables: anything prefixed
VITE_is inlined into the bundle and visible to every visitor. - A routing fallback rule: so refreshing an inner page doesn’t return a 404.
- HTTPS: browsers block some features, such as service workers, on insecure pages.
Deploying, in short
- Run
npm ci && npm run buildon your computer. - Zip the contents of
dist, soindex.htmlsits at the top of the archive. - Upload it to
public_htmlin the File Manager and extract it. - Create an
.htaccessfile next toindex.html:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
Real files such as images and bundles are served as they are, and any unknown path falls through to the app. The file is explained in what is .htaccess, and the full steps, with cache headers, are in the React deployment guide.
Updating from GitHub
If you commit the dist folder, a .cpanel.yml file can copy it into your site on every deploy from Git Version Control:
---
deployment:
tasks:
- export DEPLOYPATH=/home/USER/public_html/
- /bin/cp -R dist/* $DEPLOYPATH
On AI/Developer plans you can build on the server itself over SSH with Node.js 24 instead of committing dist. Details are in the Git deployment guide.
What every account includes
- LiteSpeed, which serves static files directly and reads
.htaccessrules. - Free SSL issued automatically, daily JetBackup backups and Imunify360 security.
- Each account isolated in CloudLinux CageFS with its own resource limits.
- Deploys from GitHub, or from Claude and Cursor through Araby MCP, and support in Arabic.
Limits to know
- Shared hosting doesn’t run Node.js, so build the app on your computer. SSR needs an AI/Developer plan.
- Any key in front-end code is exposed to visitors. Secrets belong on the server.
- Each build adds files with new hashed names, so delete the old
assetsfolder before uploading to stop them piling up. - No root access and no Docker.
On ArabyHost
For a single-page app, any hosting plan on the pricing page will do. If your project includes a Node.js API or needs SSR, pick one of the AI/Developer plans and run the front end and the API on the same account.
FAQ
Do I need Node.js on the server to run React?
Not for a single-page app. Node.js is only used on your computer to build it, and the output is static files the web server delivers. You need Node.js on the server only for SSR or an Express API.
Why do I get a 404 when I refresh an inner page?
A path like /products exists in React Router, not as a file on the server. Add an .htaccess rule that sends every missing path to index.html, and React renders the right page.
Where do I put a secret API key in a React app?
Not in front-end code: every VITE_ variable is visible to any visitor inside the JavaScript bundle. Keep the key in an API on the server, such as an Express or PHP app, and have the front end call it.