[{"data":1,"prerenderedAt":622,"buildId":623},["ShallowReactive",2],{"\u002Fdocs\u002Fgetting-started\u002Fdeployment":3,"\u002Fdocs\u002Fgetting-started\u002Fdeployment-docs-surround":391,"contentNavigation":400,"docsNavigation":568},{"id":4,"title":5,"body":6,"description":379,"extension":380,"links":381,"meta":382,"navigation":383,"path":385,"seo":386,"sitemap":387,"stem":389,"__hash__":390},"docs\u002Fdocs\u002F01.getting-started\u002F6.deployment.md","Deploy a Nuxt 4 SaaS with Docker or Node.js",{"type":7,"value":8,"toc":367},"minimark",[9,18,30,35,38,61,72,86,93,97,120,133,143,148,157,179,185,189,198,232,236,243,282,297,301,304,341,345,348,360,363],[10,11,12,13,17],"p",{},"This starter kit is ",[14,15,16],"strong",{},"vendor-free"," and can be deployed to any platform that supports Node.js and PostgreSQL.",[19,20,21],"warning",{},[10,22,23,24,29],{},"Follow the ",[25,26,28],"a",{"href":27},"\u002Fdocs\u002Fgetting-started\u002Fgoing-to-production","Going to production"," guide before deploying your application to production.",[31,32,34],"h2",{"id":33},"build","Build",[10,36,37],{},"Run the build from the repository root:",[39,40,45],"pre",{"className":41,"code":42,"language":43,"meta":44,"style":44},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm build\n","bash","",[46,47,48],"code",{"__ignoreMap":44},[49,50,53,57],"span",{"class":51,"line":52},"line",1,[49,54,56],{"class":55},"sBMFI","pnpm",[49,58,60],{"class":59},"sfazB"," build\n",[10,62,63,64,67,68,71],{},"The output is a standalone Nuxt server in ",[46,65,66],{},"apps\u002Fweb\u002F.output",". Start it with ",[46,69,70],{},"node apps\u002Fweb\u002F.output\u002Fserver\u002Findex.mjs",".",[73,74,75],"note",{},[10,76,77,78,81,82,85],{},"Some pages are prerendered at build time and read private config while doing so: ",[46,79,80],{},"\u002Fpricing"," loads the Polar products and ",[46,83,84],{},"\u002Ftestimonials"," reads the database. Production builds therefore need the secrets as well. Without them, those pages prerender empty.",[10,87,88,89,71],{},"If the build runs out of memory, see ",[25,90,92],{"href":91},"\u002Fdocs\u002Fsupport\u002Ftroubleshooting","Troubleshooting",[31,94,96],{"id":95},"docker","Docker",[10,98,99,100,103,104,107,108,111,112,115,116,119],{},"The repository ships a ",[46,101,102],{},"Dockerfile"," with a ",[46,105,106],{},"runtime"," target. It builds with Node 26 and pnpm 12 and runs the standalone server as the non-root ",[46,109,110],{},"node"," user on port ",[46,113,114],{},"9009",". ",[46,117,118],{},"\u002Fapp\u002F.data"," is writable for content and image caches.",[10,121,122,123,126,127,130,131,71],{},"The build reads its secrets as BuildKit secret mounts, not as ",[46,124,125],{},"ARG"," or ",[46,128,129],{},"ENV",". When you add a new value that the build needs, add a matching secret mount to the ",[46,132,102],{},[10,134,135,136,139,140,71],{},"A GitHub Actions workflow (",[46,137,138],{},"docker-image.yml",") builds the image and smoke-tests it with the dummy values from ",[46,141,142],{},"apps\u002Fweb\u002F.env.test",[144,145,147],"h3",{"id":146},"coolify","Coolify",[10,149,150,151,156],{},"I deploy the demo with ",[25,152,147],{"href":153,"rel":154},"https:\u002F\u002Fcoolify.io\u002F",[155],"nofollow",":",[158,159,160,173,176],"ol",{},[161,162,163,164,167,168,170,171],"li",{},"Use the Dockerfile build pack with ",[46,165,166],{},"\u002FDockerfile",", target ",[46,169,106],{}," and port ",[46,172,114],{},[161,174,175],{},"Enable build secrets and let the Dockerfile manage build arguments",[161,177,178],{},"Add the environment variables both as runtime variables and as build secrets",[10,180,181,184],{},[46,182,183],{},"deployment\u002Fdocker.md"," in the repository has the details.",[31,186,188],{"id":187},"other-platforms","Other Platforms",[10,190,191,192,197],{},"The starter kit works with any Node.js hosting platform, for example ",[25,193,196],{"href":194,"rel":195},"https:\u002F\u002Frailway.com\u002F",[155],"Railway"," or a VPS (DigitalOcean, Hetzner, Linode, …):",[158,199,200,203,206,212,215,221,227],{},[161,201,202],{},"Install Node.js 26 and pnpm 12",[161,204,205],{},"Clone your repository",[161,207,208,209],{},"Install dependencies with ",[46,210,211],{},"pnpm install",[161,213,214],{},"Set the environment variables",[161,216,217,218],{},"Build the application with ",[46,219,220],{},"pnpm build",[161,222,223,224],{},"Run migrations with ",[46,225,226],{},"pnpm db:migrate",[161,228,229,230],{},"Start the server with ",[46,231,70],{},[31,233,235],{"id":234},"environment-variables","Environment Variables",[10,237,238,239,242],{},"Ensure all required environment variables are set in your deployment platform. The server refuses to start when one is missing (error ",[46,240,241],{},"NUXT_E8014","):",[244,245,246,252,258,264,270,276],"ul",{},[161,247,248,251],{},[46,249,250],{},"NUXT_BETTER_AUTH_SECRET"," - Secret for better-auth",[161,253,254,257],{},[46,255,256],{},"NUXT_PRIVATE_DATABASE_URL"," - PostgreSQL connection string",[161,259,260,263],{},[46,261,262],{},"NUXT_PUBLIC_BASE_URL"," - Your production URL",[161,265,266,269],{},[46,267,268],{},"NUXT_PRIVATE_POLAR_ACCESS_TOKEN"," - Polar access token",[161,271,272,275],{},[46,273,274],{},"NUXT_PRIVATE_EMAIL_CONTACT"," - Address that receives contact form submissions",[161,277,278,281],{},[46,279,280],{},"NUXT_PRIVATE_FROM_EMAIL"," - Sender address of all emails",[10,283,284,285,288,289,292,293,296],{},"Also set ",[46,286,287],{},"NUXT_PRIVATE_POLAR_SERVER=production"," (the default is ",[46,290,291],{},"sandbox",") and the values of the features you use: email provider, storage, OAuth credentials and analytics. ",[46,294,295],{},"apps\u002Fweb\u002F.env.example"," lists all of them.",[31,298,300],{"id":299},"database","Database",[10,302,303],{},"Make sure your PostgreSQL database is accessible from your deployment platform. Most platforms offer:",[244,305,306,309],{},[161,307,308],{},"Managed PostgreSQL add-ons (recommended)",[161,310,311,312],{},"Or connect to external PostgreSQL services like:\n",[244,313,314,321,328,334],{},[161,315,316],{},[25,317,320],{"href":318,"rel":319},"https:\u002F\u002Fneon.tech\u002F",[155],"Neon",[161,322,323],{},[25,324,327],{"href":325,"rel":326},"https:\u002F\u002Fsupabase.com\u002F",[155],"Supabase",[161,329,330],{},[25,331,196],{"href":332,"rel":333},"https:\u002F\u002Frailway.app\u002F",[155],[161,335,336],{},[25,337,340],{"href":338,"rel":339},"https:\u002F\u002Frender.com\u002F",[155],"Render",[31,342,344],{"id":343},"post-deploy","Post-Deploy",[10,346,347],{},"After deployment, run the database migrations:",[39,349,351],{"className":41,"code":350,"language":43,"meta":44,"style":44},"pnpm db:migrate\n",[46,352,353],{"__ignoreMap":44},[49,354,355,357],{"class":51,"line":52},[49,356,56],{"class":55},[49,358,359],{"class":59}," db:migrate\n",[10,361,362],{},"Most platforms support running commands after deployment or you can run this manually.",[364,365,366],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":44,"searchDepth":368,"depth":368,"links":369},2,[370,371,375,376,377,378],{"id":33,"depth":368,"text":34},{"id":95,"depth":368,"text":96,"children":372},[373],{"id":146,"depth":374,"text":147},3,{"id":187,"depth":368,"text":188},{"id":234,"depth":368,"text":235},{"id":299,"depth":368,"text":300},{"id":343,"depth":368,"text":344},"Build the standalone Nuxt server and deploy it anywhere with Node.js and PostgreSQL, or use the included Dockerfile and its GitHub Actions smoke test.","md",null,{},{"title":384},"Deployment","\u002Fdocs\u002Fgetting-started\u002Fdeployment",{"title":5,"description":379},{"loc":385,"lastmod":388},"2026-12-02","docs\u002F01.getting-started\u002F6.deployment","I3x_xtvb42cQkgdSBH8vTKgGfPIbve6enHgewn7MJvU",[392,397],{"title":393,"path":394,"stem":395,"description":396,"children":-1},"Upgrade to the Layer Architecture","\u002Fdocs\u002Fgetting-started\u002Fupgrade-to-layer-architecture","docs\u002F01.getting-started\u002F5.upgrade-to-layer-architecture","Move a project from the Turborepo version of Nuxt Starter Kit to the layer architecture: new .env location, Zod-validated config and moved folders.",{"title":28,"path":27,"stem":398,"description":399,"children":-1},"docs\u002F01.getting-started\u002F7.going-to-production","Checklist before launch: rename and rebrand the app, replace the intruder redirects, adapt the email templates, switch Polar to production and check SEO.",[401,431],{"title":402,"path":403,"stem":404,"children":405,"page":430},"Blog","\u002Fblog","blog",[406,410,414,418,422,426],{"title":407,"path":408,"stem":409},"How to Build a SaaS with Nuxt 4, better-auth, and Polar","\u002Fblog\u002Fbuild-saas-with-nuxt-4-better-auth-polar","blog\u002Fbuild-saas-with-nuxt-4-better-auth-polar",{"title":411,"path":412,"stem":413},"DIY vs Nuxt Starter Kit - The Real Cost of Auth and Payments","\u002Fblog\u002Fdiy-vs-nuxt-starter-kit-cost","blog\u002Fdiy-vs-nuxt-starter-kit-cost",{"title":415,"path":416,"stem":417},"Nuxt Boilerplate for Solo Founders - Ship Without Rebuilding Foundations","\u002Fblog\u002Fnuxt-boilerplate-for-solo-founders","blog\u002Fnuxt-boilerplate-for-solo-founders",{"title":419,"path":420,"stem":421},"Best Nuxt SaaS Boilerplate in 2026 - What Actually Matters","\u002Fblog\u002Fnuxt-saas-boilerplate-comparison","blog\u002Fnuxt-saas-boilerplate-comparison",{"title":423,"path":424,"stem":425},"Nuxt Starter Kit v3: Delete the Features You Don't Need","\u002Fblog\u002Fnuxt-starter-kit-v3-layer-architecture","blog\u002Fnuxt-starter-kit-v3-layer-architecture",{"title":427,"path":428,"stem":429},"Polar Checkout and Customer Portal in Nuxt with the better-auth Plugin","\u002Fblog\u002Fpolar-checkout-customer-portal-better-auth-nuxt","blog\u002Fpolar-checkout-customer-portal-better-auth-nuxt",false,{"title":432,"path":433,"stem":434,"children":435,"page":430},"Documentation","\u002Fdocs","docs",[436,459,471,478,486,493,501,509,516,523,530,538,545,552,562],{"title":437,"path":438,"stem":439,"children":440,"icon":458},"Getting Started","\u002Fdocs\u002Fgetting-started","docs\u002F01.getting-started\u002F1.index",[441,443,447,451,455,456,457],{"title":442,"path":438,"stem":439},"Introduction",{"title":444,"path":445,"stem":446},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F01.getting-started\u002F2.installation",{"title":448,"path":449,"stem":450},"Setup","\u002Fdocs\u002Fgetting-started\u002Fsetup","docs\u002F01.getting-started\u002F3.setup",{"title":452,"path":453,"stem":454},"Pull Updates","\u002Fdocs\u002Fgetting-started\u002Fpull-updates","docs\u002F01.getting-started\u002F4.pull-updates",{"title":393,"path":394,"stem":395},{"title":384,"path":385,"stem":389},{"title":28,"path":27,"stem":398},"i-lucide-square-play",{"title":460,"path":461,"stem":462,"children":463,"icon":470},"Architecture","\u002Fdocs\u002Farchitecture","docs\u002F02.architecture\u002F1.index",[464,466],{"title":465,"path":461,"stem":462},"Tech Stack",{"title":467,"path":468,"stem":469},"Layers","\u002Fdocs\u002Farchitecture\u002Flayers","docs\u002F02.architecture\u002F2.layers","i-lucide-layers",{"title":300,"path":472,"stem":473,"children":474,"icon":477},"\u002Fdocs\u002Fdatabase","docs\u002F03.database\u002F1.index",[475],{"title":476,"path":472,"stem":473},"PostgreSQL","i-lucide-database",{"title":479,"path":480,"stem":481,"children":482,"icon":485},"Emails","\u002Fdocs\u002Femails","docs\u002F04.emails\u002F1.index",[483],{"title":484,"path":480,"stem":481},"Overview","i-lucide-mail",{"title":487,"path":488,"stem":489,"children":490,"icon":492},"Authentication","\u002Fdocs\u002Fauthentication","docs\u002F05.authentication\u002F1.index",[491],{"title":484,"path":488,"stem":489},"i-lucide-lock-keyhole",{"title":494,"path":495,"stem":496,"children":497,"icon":500},"Payments","\u002Fdocs\u002Fpayments","docs\u002F06.payments\u002F1.index",[498],{"title":499,"path":495,"stem":496},"Polar","i-lucide-circle-dollar-sign",{"title":502,"path":503,"stem":504,"children":505,"icon":508},"Admin","\u002Fdocs\u002Fadmin","docs\u002F07.admin\u002F1.index",[506],{"title":507,"path":503,"stem":504},"Features","i-lucide-user-cog",{"title":510,"path":511,"stem":512,"children":513,"icon":515},"Images","\u002Fdocs\u002Fimages","docs\u002F08.images\u002F1.index",[514],{"title":484,"path":511,"stem":512},"i-lucide-image",{"title":517,"path":518,"stem":519,"children":520,"icon":522},"i18n","\u002Fdocs\u002Fi18n","docs\u002F09.i18n\u002F1.index",[521],{"title":484,"path":518,"stem":519},"i-lucide-languages",{"title":524,"path":525,"stem":526,"children":527,"icon":529},"SEO","\u002Fdocs\u002Fseo","docs\u002F10.seo\u002F1.index",[528],{"title":484,"path":525,"stem":526},"i-lucide-globe",{"title":531,"path":532,"stem":533,"children":534,"icon":537},"Analytics","\u002Fdocs\u002Fanalytics","docs\u002F11.analytics\u002F1.index",[535],{"title":536,"path":532,"stem":533},"Umami","i-lucide-chart-line",{"title":539,"path":540,"stem":541,"children":542,"icon":544},"Security","\u002Fdocs\u002Fsecurity","docs\u002F12.security\u002F1.index",[543],{"title":484,"path":540,"stem":541},"i-lucide-file-lock",{"title":546,"path":547,"stem":548,"children":549,"icon":551},"Testing","\u002Fdocs\u002Ftesting","docs\u002F13.testing\u002F1.index",[550],{"title":546,"path":547,"stem":548},"i-lucide-test-tube",{"title":553,"path":554,"stem":555,"children":556,"icon":561},"Support","\u002Fdocs\u002Fsupport","docs\u002F14.support\u002F1.index",[557,559],{"title":558,"path":554,"stem":555},"Help",{"title":92,"path":91,"stem":560},"docs\u002F14.support\u002F2.troubleshooting","i-lucide-message-circle-question",{"title":563,"path":564,"stem":565,"children":566},"LLMs","\u002Fdocs\u002Fllms","docs\u002F15.llms\u002F1.index",[567],{"title":563,"path":564,"stem":565},[569,578,582,585,588,591,594,597,600,603,606,609,612,615,619],{"title":437,"path":438,"stem":439,"children":570,"icon":458},[571,572,573,574,575,576,577],{"title":442,"path":438,"stem":439},{"title":444,"path":445,"stem":446},{"title":448,"path":449,"stem":450},{"title":452,"path":453,"stem":454},{"title":393,"path":394,"stem":395},{"title":384,"path":385,"stem":389},{"title":28,"path":27,"stem":398},{"title":460,"path":461,"stem":462,"children":579,"icon":470},[580,581],{"title":465,"path":461,"stem":462},{"title":467,"path":468,"stem":469},{"title":300,"path":472,"stem":473,"children":583,"icon":477},[584],{"title":476,"path":472,"stem":473},{"title":479,"path":480,"stem":481,"children":586,"icon":485},[587],{"title":484,"path":480,"stem":481},{"title":487,"path":488,"stem":489,"children":589,"icon":492},[590],{"title":484,"path":488,"stem":489},{"title":494,"path":495,"stem":496,"children":592,"icon":500},[593],{"title":499,"path":495,"stem":496},{"title":502,"path":503,"stem":504,"children":595,"icon":508},[596],{"title":507,"path":503,"stem":504},{"title":510,"path":511,"stem":512,"children":598,"icon":515},[599],{"title":484,"path":511,"stem":512},{"title":517,"path":518,"stem":519,"children":601,"icon":522},[602],{"title":484,"path":518,"stem":519},{"title":524,"path":525,"stem":526,"children":604,"icon":529},[605],{"title":484,"path":525,"stem":526},{"title":531,"path":532,"stem":533,"children":607,"icon":537},[608],{"title":536,"path":532,"stem":533},{"title":539,"path":540,"stem":541,"children":610,"icon":544},[611],{"title":484,"path":540,"stem":541},{"title":546,"path":547,"stem":548,"children":613,"icon":551},[614],{"title":546,"path":547,"stem":548},{"title":553,"path":554,"stem":555,"children":616,"icon":561},[617,618],{"title":558,"path":554,"stem":555},{"title":92,"path":91,"stem":560},{"title":563,"path":564,"stem":565,"children":620},[621],{"title":563,"path":564,"stem":565},1796282654038,"e90768e1-1006-4f68-a0b7-e7c6553b660f"]