Deploying a React or Next.js app

Developer Guides

This guide covers deploying React (static build) and Next.js (standalone server) to TransPark.

React (Static Build — e.g. Vite, CRA)

A React SPA compiles to static HTML/CSS/JS files. Use the Static HTML site type.

  1. Dashboard → Add Site → Select Static HTML
  2. Enter your domain → Create
  3. Build your React app locally: npm run build
  4. Upload the contents of your dist/ or build/ folder to the document root via SFTP

That's it. Nginx serves the static files with proper caching headers and gzip.

Client-side routing: If you use React Router, you need a fallback rule. Create a file called .htaccess — wait, this is Nginx, not Apache. Instead, ask support to add this to your Nginx vhost:

try_files $uri $uri/ /index.html;

Next.js (Standalone Server)

Next.js with server-side rendering needs a Node.js site.

  1. Dashboard → Add Site → Select Node.js (port 3000)
  2. In your next.config.js, enable standalone output:
module.exports = {
  output: 'standalone',
};
  1. Build locally: npm run build
  2. Upload .next/standalone/ to the server via SFTP or Git
  3. Also upload .next/static/ into .next/standalone/.next/static/
  4. Upload your public/ folder into .next/standalone/public/
  5. SSH in and start:
cd /home/[siteuser]/htdocs/[domain]
pm2 start .next/standalone/server.js --name "nextjs-app"
pm2 save

Next.js (Static Export)

If your Next.js app doesn't need SSR, you can export it as static:

// next.config.js
module.exports = { output: 'export' };

Then deploy like a regular React static build (see above).

Still need help?

Our team responds within a few hours during business days.

Open a Support Ticket →