To deploy a SolidStart app on Modelence, build it with vite build and the Nitro plugin, which writes a Node.js server to .output, and add a modelence.config.json file that starts it with node .output/server/index.mjs, then run npx modelence@latest deploy. Modelence is a managed cloud on AWS that runs the app as a long-running server in one of 17 regions, next to managed MongoDB, Postgres and Redis databases, and handles rollouts and backups for you.
This guide uses SolidStart 2, the version create-solid sets up, which builds on Vite and Nitro and needs Node.js 24. It builds a small app whose server function reads from Postgres, deploys it, and then covers what to change before real traffic arrives, including how to keep the server answering while a deploy replaces it. A SolidStart 1 app, built with Vinxi, also writes its server to .output/server/index.mjs and deploys the same way on the node-22-slim image. If you already have an app, skip to Run the app locally. For a React app on the same Vite and Nitro build see TanStack Start, for Vue see Nuxt, and for a plain server see Node.js.
SolidStart on Modelence at a glance
- How it runs
- node .output/server/index.mjs, the Node.js server Nitro builds, runs in a long-lived container on the PORT Modelence sets
- Server functions
- Functions marked "use server" run only in the container, and the browser reaches them through /_server requests, so queries and connection strings stay out of the browser bundle
- Build output
- Nitro bundles the server's dependencies into .output, so the server starts without node_modules
- Regions
- 17 regions on AWS, with the app's containers and its databases in the same region
- Databases
- Managed MongoDB, Postgres and Redis next to the app, with production backups at least every six hours
- Deploys
- The new version starts next to the old one and takes traffic after its health check passes; a crashing version rolls back
- Price
- A free plan, and paid plans from $20 a month that count the whole $20 toward usage
Before you start
- Node.js 24 or newer, which SolidStart 2 asks for, and npm
- A Modelence account, which you can create for free
- Optionally, Claude Code, Cursor or Codex, if you want your coding agent to write the config and run the deploy
Create a SolidStart app
create-solid with --solidstart --v2 creates the basic SolidStart 2 template, which already has the Nitro Vite plugin in vite.config.ts. Nitro is what turns vite build into a server you can run with Node.js: the build writes the server to .output/server/index.mjs and the browser files to .output/public. In package.json, dev runs vite dev, build runs vite build, start runs node .output/server/index.mjs, and engines asks for Node.js 24 or newer. The template comes with a pnpm-lock.yaml, so with npm delete it and run npm install, which writes the package-lock.json that the deploy installs from.
Without nitro() in the plugins, vite build writes dist/client and dist/server instead, which has no server to start. To add it to an existing app, run npm install nitro and put nitro() next to solidStart(), as in the template's file:
// vite.config.ts
import { defineConfig } from "vite";
import { nitro } from "nitro/vite";
import { solidStart } from "@solidjs/start/config";
export default defineConfig({
plugins: [solidStart(),
nitro()
]
});
npm create solid@latest my-app -- --solidstart --v2 --template basic --ts
cd my-app
rm pnpm-lock.yaml
npm installRead Postgres in a server function
Install a Postgres client with npm install pg and npm install -D @types/pg, then create one connection pool in src/lib/db.ts:
// src/lib/db.ts
import pg from "pg";
// One pool per server process, shared by every request.
export const db = new pg.Pool({ connectionString: process.env.DATABASE_URL });
A function whose body starts with "use server" runs only on the server. During server rendering SolidStart calls it directly, and when the visitor navigates in the browser, the call becomes a request to /_server, so the query and DATABASE_URL stay out of the browser bundle. query from Solid Router gives the call a cache key, so the route's preload and the component share one request. Import db only from server functions and API routes, because a component that imports it directly would pull pg into the browser build. Put the server function in its own file:
// src/lib/items.ts
import { query } from "@solidjs/router";
import { db } from "./db";
// "use server" makes this function run only on the server. In the browser
// bundle, getItems becomes a request to the server, so db never ships there.
export const getItems = query(async () => {
"use server";
const { rows } = await db.query<{ id: number; name: string }>(
"SELECT id, name FROM items ORDER BY id"
);
return rows;
}, "items");
The ~/ prefix is the alias the template sets up in tsconfig.json for src/. Add the route file:
import { createAsync, type RouteDefinition } from "@solidjs/router";
import { For } from "solid-js";
import { getItems } from "~/lib/items";
// preload starts the query as soon as the router matches /items, during
// server rendering and before a client-side navigation finishes.
export const route = {
preload: () => getItems(),
} satisfies RouteDefinition;
export default function Items() {
const items = createAsync(() => getItems());
return (
<ul>
<For each={items()}>{(item) => <li>{item.name}</li>}</For>
</ul>
);
}Add a health route
A file in src/routes that exports a function named after an HTTP method is an API route: it answers requests itself instead of rendering a page. Modelence can call this one to decide whether a new container is ready for traffic, which the config in the deploy step turns on. SolidStart picks up the file from its path, so it answers at /api/health:
// An API route: it answers GET /api/health with JSON and renders no page.
export function GET() {
return Response.json({ status: "ok" });
}Run the app locally
Start the development server and open http://localhost:3000/items:
npm run dev
In development, vite dev loads .env, .env.local and .env.development from the project root, so server functions can read DATABASE_URL from there while you work. The production server in .output doesn't read .env files, so in the cloud the variables come from the environment. To work without a .env file, connect the project to a Modelence local environment instead. npx modelence@latest setup opens the browser so you can sign in and pick or create an app and environment, and npx modelence@latest dev then runs the dev script with that environment's connection strings and variables.
npx modelence@latest setup
npx modelence@latest devAdd a database
- MongoDB
MONGODB_URI - Postgres
DATABASE_URL - Redis
REDIS_URL
Modelence hands the app the connection strings for its managed MongoDB, Postgres and Redis as environment variables. Production databases are backed up at least every six hours, and connections are encrypted in transit. MongoDB comes in as MONGODB_URI, and Postgres and Redis use the names you give them in modelence.config.json, usually DATABASE_URL and REDIS_URL.
In a SolidStart app, read these variables only in server code: functions marked "use server" and API routes. Vite puts only variables that start with VITE_ into the browser bundle, through import.meta.env, so a connection string without that prefix stays on the server. Create one client per process in a module that only server code imports, as src/lib/db.ts does above, and pass it to the library you already use, such as pg, Drizzle, Prisma, the MongoDB driver or a Redis client.
A database you already run at Supabase or Neon keeps working. Declare its URL in env with "type": "secret" and enter the value when the deploy asks for it.
Run migrations against the environment's database before you deploy, and keep them out of the start command. Every container runs the start command, and a rollout starts more than one container, so the same migration would run several times at once.
Declare Postgres and Redis as resources next to the app's service, and the deploy creates them before the new version starts:
{
"resources": {
"main-db": { "type": "postgres", "plan": "postgres-1gb" },
"cache": { "type": "redis" }
},
"env": {
"DATABASE_URL": { "type": "resource", "resource": "main-db", "output": "url" },
"REDIS_URL": { "type": "resource", "resource": "cache", "output": "url" }
}
}Describe the app in modelence.config.json
Modelence runs a SolidStart app as a Node.js service on an official Node.js image. The build commands install the dependencies and run vite build, and the start command runs the server Nitro wrote to .output. Nitro reads the PORT variable Modelence sets and listens on all interfaces, so the command needs no flags. The health check calls the /api/health route from the setup steps. Add the file to the root of the repository and commit it:
{
"$schema": "https://cloud.modelence.com/schema/modelence.config.json?version=1",
"resources": {
"web": {
"type": "service",
"image": "node-24-slim",
"build": { "commands": ["npm ci", "npm run build"] },
"start": { "commands": ["node .output/server/index.mjs"] },
"healthCheck": { "type": "http", "path": "/api/health" }
},
"main-db": { "type": "postgres", "plan": "postgres-1gb" }
},
"env": {
"DATABASE_URL": { "type": "resource", "resource": "main-db", "output": "url" }
}
}Adjust the config for your project
npm ciinstalls exactly whatpackage-lock.jsonlists. With pnpm or Yarn, runcorepack enablefirst and then that package manager's frozen-lockfile install.- Never start the app with
vite devorvite preview. The Nitro server in.outputis the production server. - Keep
node-24-slimfor SolidStart 2, which needs Node.js 24 or newer. A SolidStart 1 app runs onnode-22-slim. - Vite writes
VITE_variables into the browser bundle during the build, so give them"scopes": ["build", "runtime"], and never use the prefix for a secret. - Declare API keys and tokens with
"type": "secret"and no value. The deploy asks you for each one, and afterwards you can view or change it in the dashboard under Environment variables, where every view is logged. - Set
rooton the service when the app lives in a folder of a monorepo rather than at the repository root. - The start command doesn't need
node_modules, because Nitro bundles what the server imports,pgincluded, into.output/server.
Check the build locally
Run the commands a deploy runs, in the same order, then open http://localhost:3000/api/health in another terminal. A build that fails here fails in the cloud too. npx modelence@latest verify goes a step further: it copies the project, runs the build commands from modelence.config.json, starts the app the way a container does and checks that it answers. It needs no sign-in and lists the variables the cloud will provide, such as DATABASE_URL.
npm ci && npm run build && PORT=3000 node .output/server/index.mjsDeploy
In the project directory, run:
npx modelence@latest deploy
The command opens the browser, where you sign in, choose or create the organization, app and environment, and fill in any secrets the environment doesn't have yet. It then uploads the project and streams the build until the new version is live. The first deploy to an environment asks for an AWS region, and that environment's containers and databases are created there. Later deploys can skip the prompts with --app <app> --env <env>.
On the first deploy, Modelence creates the Postgres database, starts the app once the database is ready and serves the web service at <app>-<environment>.cloud.modelence.app. To use your own domain, add it in the dashboard under Domains. Every app comes with a sandbox and a production environment, and the same file deploys to both.
Let your coding agent do it
In Claude Code, Cursor or Codex, paste Deploy using https://modelence.com/skill.md in the project. The agent reads the docs, writes modelence.config.json for the app, checks the build and runs the deploy, and it asks you whenever a step needs your account.
Production readiness
Keep serving for 10 seconds after SIGTERM
When a deploy replaces a container, Modelence sends it SIGTERM, and requests can still reach it for about 10 seconds after that. The Nitro server stops accepting connections as soon as it gets SIGTERM, gives open requests 5 seconds to finish and then closes the rest. In our test, a request sent a quarter of a second after SIGTERM was refused, a 3-second request finished and an 8-second request was cut off after about 5 seconds. To keep answering through those 10 seconds, start the server through a small wrapper that holds Nitro's SIGTERM handler back. Add start.mjs at the project root and set the start command to node start.mjs:
// start.mjs
// Starts the server from `vite build` and keeps it serving for 10 seconds
// after SIGTERM, while the load balancer may still send it requests.
// Nitro's own SIGTERM handler stops accepting connections right away, so
// hold it back and call it once the delay is over.
await import('./.output/server/index.mjs')
const nitroHandlers = process.listeners('SIGTERM')
process.removeAllListeners('SIGTERM')
process.once('SIGTERM', () => {
setTimeout(async () => {
// Stop accepting connections, let open requests finish, then exit.
await Promise.all(nitroHandlers.map((handler) => handler('SIGTERM')))
process.exit(0)
}, 10_000)
})
With the wrapper, requests sent up to 9.5 seconds after SIGTERM still got a 200, one sent at 10.5 seconds was refused, and 8-second and 13-second requests that were already running both finished before the process exited. Don't name the file server.mjs, because Nitro picks up a server file at the project root as its own server entry and the build then fails. The process.exit(0) matters too: after a page had queried Postgres, the idle pg pool kept the default server's process alive for 10 more seconds after it had closed. Modelence waits 30 seconds by default before it stops a container for good, which leaves room for the delay and the 5-second drain. If a request can run longer, raise stopTimeout on the service and set SERVER_SHUTDOWN_TIMEOUT to the number of seconds Nitro should wait for open requests.
Keep state out of the container
Containers have no persistent disk, and every deploy replaces all of them, so files written to disk and sessions kept in memory are gone after the next deploy. Keep sessions in a signed cookie or in Redis from the same region, store uploads in object storage, and keep everything else in the database. Under Configure in the dashboard, run the service on two or more containers so the app stays up when one crashes or an availability zone goes down. Availability explains how deploys and rollbacks keep it serving.
Expect open tabs to reload after a deploy
Each build gives the browser files new hashed names, and the new containers serve only the new ones. When a tab opened before the deploy moves to a route whose file is gone, SolidStart catches the failed import and reloads the page once, so the visitor lands on the new version. In our test the reload went to the route the visitor clicked. If a reload in the middle of a long form would lose work, save drafts on the server.
Run background jobs as their own service
Keep queue consumers and scheduled jobs out of the SolidStart server. With more than one container, each one would pick up the same job, and a reminder email would go out once per container. Add a second service to modelence.config.json with its own start command, "healthCheck": { "type": "none" } and "rollout": "recreate", as Multiple services describes.
Watch logs and metrics
The Nitro server prints a line when it starts and doesn't log each request, so log what you need from server functions with console.log or a logger. The environment's Logs page shows everything the app writes to its output, with nothing to set up. For traces and metrics, add a telemetry resource and point the standard OpenTelemetry variables at it, as the modelence.config.json reference describes.
Modelence vs Vercel, Netlify and Cloudflare for SolidStart
SolidStart teams most often weigh Vercel and Netlify, which run it as serverless functions, against Cloudflare, which runs it on Workers. The table is based on each platform's own docs and pricing pages in December 2026.
| Platform | How a SolidStart app runs | Databases | Pricing |
|---|---|---|---|
| Modelence | Nitro's Node.js server as long-running containers on AWS, in 17 regions, across two availability zones | Managed MongoDB, Postgres and Redis in the app's region | Free plan; paid plans from $20 a month with $20 of usage included |
| Vercel | Nitro's Vercel preset builds the app as Vercel Functions with Fluid compute; functions run in iad1 by default, with 1 region on Hobby and up to 5 on Pro | Postgres and Redis through Marketplace providers such as Neon, Supabase and Upstash | Hobby is free with usage limits; Pro is $20 a month with one seat and $20 of credit, plus $20 for each added seat |
| Netlify | Netlify's Vite plugin deploys server rendering, server functions and middleware as Netlify Functions, in Ohio by default, with a 60-second limit per request | Netlify Database, a managed Postgres, on credit-based plans | Free with 300 credits a month; Personal $9 and Pro $20 a month |
| Cloudflare | The Workers runtime, where SolidStart support is in beta and Wrangler deploys the .output build | D1 with SQLite semantics, and Hyperdrive for an existing Postgres or MySQL | Free with 100,000 requests a day; Paid from $5 a month with 10 million requests included |
Netlify has a SolidStart 2 guide of its own, and its Vite plugin needs no Nitro. Vercel's SolidStart templates are for SolidStart 1, and a SolidStart 2 app reaches Vercel through Nitro, which detects the platform during the build. Cloudflare suits an app that should render close to visitors everywhere and can keep its data in D1 or reach its database through Hyperdrive, and its Pages guide for SolidStart now points to Workers. Netlify adds its own Postgres, where every deploy preview gets a branch of the database, while on Vercel the database comes from a Marketplace provider. Modelence fits an app whose server functions do real work against a database and that should run as an ordinary long-lived Node.js server, with the database and its backups in one region you choose. Modelence vs Vercel and Vercel alternatives go into more depth.
Next steps
- modelence.config.json referenceService, health check and stopTimeout settings for a SolidStart app
- Environment variablesSecrets for server functions, and build scopes for VITE_ variables
- DatabasesManaged MongoDB, Postgres and Redis for your server functions
- Multiple servicesRun a worker or a separate API next to the app
- AvailabilityHow rollouts, health checks and rollbacks keep the app up
Frequently asked questions
How do I deploy a SolidStart app?
Build it with vite build and the Nitro plugin, which writes a Node.js server to .output, and run node .output/server/index.mjs on a host that runs Node.js 24 or newer. On Modelence you put those build and start commands in modelence.config.json and run npx modelence@latest deploy, which builds the app, creates the databases it declares and starts it in containers on AWS.
Why does my SolidStart build create dist instead of .output?
Because nitro() is missing from the plugins in vite.config.ts. Without it, vite build writes dist/client and dist/server, which has no server to start. Run npm install nitro, add nitro() from nitro/vite next to solidStart(), and build again to get .output/server/index.mjs.
Can I deploy SolidStart with Docker?
Yes. The .output folder holds everything the server needs, including the dependencies it imports, so a Dockerfile can copy .output into a node:24-slim image and run node .output/server/index.mjs without node_modules. On Modelence you don't need a Dockerfile, because the build and start commands in modelence.config.json run on an official Node.js image.
How do environment variables work in SolidStart?
In development, vite dev loads .env, .env.local and .env.development, and server code reads the values from process.env. The production server in .output doesn't read .env files, so the host has to set the variables. Only variables that start with VITE_ reach the browser, so keep secrets without that prefix and read them in "use server" functions or API routes.
Can I deploy SolidStart to Vercel?
Yes. With the Nitro plugin, the build detects Vercel and turns the app's server into Vercel Functions with Fluid compute, which run in one region by default. Vercel's own SolidStart templates are for SolidStart 1, and the database comes from a Marketplace provider. On Modelence the same build runs as a long-lived Node.js server with a managed database in the same region.
Does SolidStart work on Cloudflare Workers and Pages?
Cloudflare runs SolidStart on Workers, where its support is in beta, and wrangler deploy detects the app and deploys the .output build. Cloudflare's Pages guide for SolidStart sends new projects to Workers and has a migration guide for existing Pages projects.
Is SolidStart production ready?
SolidStart 1.0 came out in May 2024, and SolidStart 2, which builds on Vite and Nitro, is the current release on npm, at 2.2.4 as of December 2026. Its production server is the plain Node.js server Nitro builds, so it runs on any host that runs Node.js 24.
Does this guide work with Solid 2.0?
No, it covers SolidStart 2, which runs on Solid 1.9. Solid 2.0 replaces SolidStart with the start mode of @solidjs/vite-plugin, which builds a different server without Nitro, and the Solid docs treat moving to it as a migration to a new app rather than an upgrade.
How do I disable SSR in SolidStart?
Pass ssr: false to solidStart() in vite.config.ts, and pages render in the browser only. The Nitro server still runs in production, because it serves the page shell, server functions and API routes, so the deploy and start command stay the same.
How much does it cost to host a SolidStart app on Modelence?
It can cost nothing on the free plan, which runs one instance that sleeps when idle. Paid plans start at $20 a month, all of which counts toward usage, and each container is billed by the hour for its size, from about $9 a month for the smallest one with 0.25 vCPU and 0.5 GB of memory.