Skip to content
By stack3 min read

React hosting: what you actually upload and which plan fits

Short answer

A React single-page app becomes static files (HTML, JavaScript and CSS) after npm run build, so it runs on any ArabyHost plan with no Node.js on the server. Upload the contents of dist to public_html and add an .htaccess rule that sends routes to index.html. SSR needs the AI/Developer plans.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. What are you actually hosting?
  2. What a React app needs in production
  3. Deploying, in short
  4. Updating from GitHub
  5. What every account includes
  6. Limits to know
  7. On ArabyHost

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/, set base in vite.config.js and basename in 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

  1. Run npm ci && npm run build on your computer.
  2. Zip the contents of dist, so index.html sits at the top of the archive.
  3. Upload it to public_html in the File Manager and extract it.
  4. Create an .htaccess file next to index.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 .htaccess rules.
  • 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 assets folder 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.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.