How to host SolidJS applications
How to Host SolidJS Applications on Square Cloud
Hosting SolidJS on Square Cloud is simple and extremely efficient. Depending on your project's architecture, you will either follow the path of a static deployment or a high-performance Vinxi server.
1. Build
If you are using standard SolidJS managed by Vite, your application generates static files that need to be "served" by a lightweight Node.js process.
Step 1: Production Build
In your local terminal, run:
npm run buildThis will generate the dist/ folder at the root of your project.
2. Configuring the Port and Start Command
Square Cloud makes port 80 available for your application to use and receive requests. If you are using SolidStart, it uses Vinxi as its infrastructure engine.
In this case, the application runs a real server that enables server-side rendering (SSR).
Startup Command
Generally, SolidStart generates an output that can be started via Node.js or through the Vinxi CLI itself:
npx vinxi start --port 80
(Make sure your start script in package.json already points to the correct execution on port 80).
3. Preparing the Deployment (.zip)
To ensure that the deployment is fast and error-free, your .zip file should contain only the essentials:
- For Vite: See here.
- For SolidStart/Vinxi: The
.output/(ordist/) folder,package.json, andpackage-lock.json.
Tip: Never upload the node_modules folder. Square Cloud will perform a clean installation of dependencies on the server.4. Environment Variables (ENV)
If your SolidJS app consumes APIs or has private keys:
- Go to the Square Cloud Dashboard.
- On your application's tab, access Environment Variables.
- Configure keys like
API_URLorDB_AUTHthere. In SolidJS, remember that variables exposed to the client in Vite must start withVITE_.
5. Performance Tips
- Hydration: If you are using SSR with SolidStart, monitor memory usage. SolidJS is highly efficient, but the server hydration process consumes resources during traffic spikes.
- Cache: Use Square Cloud's caching for static assets (images, CSS) to decrease the initial loading time (LCP).
Updated on: 05/26/2026
Thank you!
