Skip to content

Unable to run preview or deploy TanStack Start app with SSR (Coolify self-host) #5476

@Nodzimo

Description

@Nodzimo

Which project does this relate to?

Start

Describe the bug

Hi! I have a question about running and deploying a TanStack Start app with SSR.
I wanted to start my new project using TanStack Start, spent a few days trying — but I couldn’t even get the preview server to run or deploy the app to Coolify.
The documentation and examples are very confusing and unclear, in my opinion. I’ve re-read them multiple times, but nothing worked.

1. Preview / Production build problem

I created a project using:
bun create @tanstack/start@latest

In the prompts, I chose the standard setup:

  • Tailwind
  • TanStack Query, Form, Table
  • Hosting: none (because I’m self-hosting via Coolify)

The project scaffolds correctly, bun dev works, and the app runs fine in the browser.

But how do I run it in preview / production mode?

When I run:
vite preview

and open http://localhost:4173, I get:
Cannot GET /

Browser console:
GET http://localhost:4173/ 404 (Not Found)

How am I supposed to start the preview server and test SSR/SSG?
For example, in Next.js this works out of the box with next start.
There’s no clear documentation explaining how to run a production preview for TanStack Start.

2. Deploying to Coolify (self-hosted PaaS)

I’m hosting apps on Coolify, which is basically a self-hosted Vercel:
Image

Next.js apps deploy there perfectly — one click, no manual configuration.

But when I try to deploy the same TanStack Start project to Coolify, the app builds and deploys — but opening it in a browser gives:
GET https://domain-example.com/ net::ERR_HTTP_RESPONSE_CODE_FAILURE 404 (Not Found)

So what should I do to deploy TanStack Start just like Next.js?

I’ve read the Hosting section of the docs several times, but I still don’t understand what exactly is required for deployment:

  • Is the Nitro plugin required?
  • If yes, should I use the bun preset?
  • If yes, what comes next?

Why does only dev mode work, but preview and deployed builds fail?

3. Attempt with Nitro plugin

I tried copying the server implementation example from the documentation,
installed the @tanstack/nitro-v2-vite-plugin with the nitroV2Plugin({ preset: 'bun' }), and ran: ASSET_PRELOAD_VERBOSE_LOGGING=true bun run server.ts

The server starts and responds, but the app loads without any styles (plain HTML), screen:
Image

Repository: https://github.com/Nodzimo/tss-dep
Here’s the repo I’m trying to run in preview and deploy via Coolify.

Summary

I really wanted to start my new project on TanStack Start, but after a few days of trying I simply couldn’t get it to start — not in preview, not in production.
dev mode works perfectly, but everything else fails.

Please help clarify how this is supposed to work,
and whether deploying on self-hosted platforms like Coolify is currently supported.

Thanks 🙏

Your Example Website or App

https://github.com/Nodzimo/tss-dep

Steps to Reproduce the Bug or Issue

  1. bun create @tanstack/start@latest
  2. "preview": "vite preview" / Deploy to Coolify
  3. Error: Cannot GET /

Expected behavior

As a developer, I expected to be able to run a production preview or deploy the app somewhere without needing divine intervention.

Ideally, I’d also expect TanStack Start to actually... well, start 😅

Screenshots or Videos

No response

Platform

  • @tanstack/react-start: 1.132.0
  • OS: Windows
  • Browser: any
  • Browser Version: latest
  • Bundler: vite
  • Bundler Version: 7.1.7

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions