Deploying a React app on cPanel is mostly a static build upload — unless you need SSR. For Create React App, Vite, or similar SPA builds, you upload the production build or dist folder and fix client-side routing.
Build locally
- Run
npm run build(orpnpm/yarnequivalent). - Confirm the output folder (
buildordist). - Test the build with a static server if possible.
- Note environment variables baked in at build time (
VITE_/REACT_APP_).
Upload to cPanel
- File Manager or FTP into
public_html(or a subdomain folder) - Upload contents of the build folder (not necessarily the folder name itself)
- Ensure
index.htmlsits at the web root you intend
SPA routing (.htaccess)
For React Router browser history, add an Apache rewrite so deep links load index.html:
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]Common failures
- Wrong homepage/base path — set Vite
baseor CRAhomepagefor subfolders. - API calls blocked by mixed content (HTTP API on HTTPS site).
- Caching old bundles — hard refresh after deploy.
- Uploading source instead of the build output.
Related learning
Backend-ish student projects sometimes start on desktop — Tkinter restaurant system — then move to web. Career-wise, deployment habits show up in cloud roles.
FAQ
Can cPanel run npm start?
That’s for development; production uses the static build (unless you have Node hosting).
Do I need Node on the server?
Not for a pure SPA static deploy.
What about SSR Next.js?
Needs Node hosting — different from classic cPanel static.
Build locally, upload the static output, fix base path and SPA rewrites, then verify deep links. That’s the reliable React-on-cPanel path.
Disclaimer
Sengideons.com does not host any files on its servers. All point to content hosted on third-party websites. Sengideons.com does not accept responsibility for content hosted on third-party websites and does not have any involvement in the same.












