A minimal React + Vite starter you can deploy on Cloudways or any static host.
Includes a Cloudways-branded sample home page so you can confirm the deploy worked, then replace it with your own site.
- React 19 with TypeScript and Vite
- Static site output (
npm run build→dist/) - Cloudways-branded sample home page
.htaccess.examplefor SPA routing on Apache / Cloudways- Works on Cloudways, Netlify, Vercel, Cloudflare Pages, GitHub Pages, and any Apache/Nginx host
git clone https://github.com/YOUR_USERNAME/cloudways-react-template.git
cd cloudways-react-template
npm install
npm run devOpen http://localhost:5173 to see the Cloudways-branded sample home page.
| Command | Description |
|---|---|
npm run dev |
Start local development server |
npm run build |
Build production files into dist/ |
npm run preview |
Preview the production build locally |
npm run lint |
Run the linter |
Cloudways serves static sites from your application’s public_html directory over Apache (ports 80/443).
- Sign in to the Cloudways dashboard.
- Create a server (DigitalOcean, AWS, etc.).
- Add a new application (PHP/Custom Application is fine for static files).
Option A — Build locally, then upload
npm install
npm run buildUpload the contents of dist/ into public_html/ via SFTP, or:
# Example: sync dist to Cloudways public_html
scp -r dist/* master@YOUR_SERVER_IP:~/applications/YOUR_APP/public_html/Option B — Build on the server (SSH)
ssh master@YOUR_SERVER_IP
cd ~/applications/YOUR_APP/public_html
git clone https://github.com/YOUR_USERNAME/cloudways-react-template.git .
npm install
npm run build
# Move built files to the web root (or point the docroot at dist/)
cp -r dist/* .Copy .htaccess.example to public_html/.htaccess so client-side routes fall back to index.html.
For this single-page sample, Apache can serve the generated files as-is — no Node process or PM2 is required.
Visit your Cloudways application URL. You should see the Cloudways-branded sample home page.
This template is host-agnostic. Build once, deploy dist/.
| Platform | Notes |
|---|---|
| Netlify / Vercel / Cloudflare Pages | Connect the repo; build command npm run build, publish directory dist |
| GitHub Pages | Build in CI and publish dist/ (set base in vite.config.ts if needed) |
| Nginx / VPS / Docker | Serve dist/ as the document root |
.
├── public/ # Static assets (copied to dist as-is)
│ ├── cloudways-logo.svg
│ ├── favicon.ico
│ └── hero-cloud.svg
├── src/
│ ├── App.tsx # Sample home page
│ ├── App.css # Home page styles
│ ├── index.css # Cloudways brand tokens
│ └── main.tsx # React entry
├── .htaccess.example # SPA fallback for Apache / Cloudways
├── index.html
├── vite.config.ts
└── package.json
- Edit
src/App.tsxto replace the sample home page. - Add components under
src/(or introduce React Router for multiple pages). - Put images and other static files in
public/. - Update site metadata in
index.html.
| Issue | Fix |
|---|---|
| Blank page / old content | Confirm public_html contains the latest dist/ output |
| CSS/images 404 | Deploy the full dist/ folder, not only index.html |
| Client routes 404 | Copy .htaccess.example to .htaccess |
| Build fails on server | Use Node 20+ (node -v); upgrade via Cloudways if needed |
MIT — see LICENSE.
PRs welcome. Fork, branch, and open a pull request.
Use this repo as a GitHub template: click Use this template on GitHub to create your own project from this starter.