NEWLoisaX CLI 1.4 and 1-command cloud deploys now liveRead post

How to host a Next.js 15 app with SSR and Server Actions

Running Next.js on dedicated compute lets you use dynamic Server Components, Server Actions, Route Handlers, and warm database pools without cold-start penalties.

Updated Nov 14, 2026·12 min read·3 steps

What you will learn:

  • Configurar os scripts de build e start do Next.js 15 para 0.0.0.0 e porta dinâmica.
  • Separar variáveis públicas (NEXT_PUBLIC_*) de segredos exclusivos do servidor.
  • Dimensionar memória RAM adequada para compilação TypeScript e execução SSR.
  • Integrar deploy contínuo via repositório GitHub na LoisaX.
  • Configurar cabeçalhos de proxy (AUTH_TRUST_HOST) para autenticação segura.
  • Conectar domínio próprio com certificado TLS/HTTPS gerenciado.

Download Next.js production starter

Preconfigured Next.js 15 package.json bound to 0.0.0.0 and dynamic $PORT.

Step 01

Configure build and start scripts in package.json

Ensure "build": "next build" and "start": "next start -H 0.0.0.0 -p ${PORT:-3000}" are defined:

1{
2 "name": "minha-app-nextjs",
3 "version": "1.0.0",
4 "private": true,
5 "scripts": {
6 "dev": "next dev",
7 "build": "next build",
8 "start": "next start -H 0.0.0.0 -p ${PORT:-3000}"
9 },
10 "dependencies": {
11 "next": "15.1.0",
12 "react": "19.0.0",
13 "react-dom": "19.0.0"
14 }
15}

Step 02

Separate NEXT_PUBLIC_* from server secrets

Keep DATABASE_URL and API keys unprefixed so they never ship to browser bundles.

Step 03

Allocate 512 MB–1 GB for TypeScript builds

Next.js bundling peaks during compilation; 512 MB or 1 GB prevents out-of-memory kills.

Step 04

Got an error? The most common ones, with the fix

Build exits with code 137 (OOM)

Cause: Large bundle compilation exceeding a tiny RAM tier.

Fix: Select 1 GB RAM for large Next.js monorepos.

Step 05

Frequently asked questions

Yes — your Node server stays warm continuously, reusing pooled connections.

Community & Education

Our commitment to developers

At LoisaX, we believe our role goes beyond providing hosting and cloud computing services. We also want to contribute to the learning and growth of our developer community.

We are continuously expanding our catalog of guides with new content on programming languages, API integrations, automation, and application development.

More deployment guides

All guides