Deploying a Next.js 15 App with App Router on Deployxa: Complete Guide | Deployxa
Next.js 15 with the App Router is the most popular React framework. Here is how to deploy it on Deployxa with zero configuration and AI-native features.
← Back to Dispatch Articles
Deploying a Next.js 15 App with App Router on Deployxa
Next.js 15 with the App Router is the most popular React framework in 2026, and it is the default choice for AI-generated full-stack apps. The App Router introduced server components, streaming, and improved data fetching, which make it powerful but also complex to deploy correctly. Deployxa's zero-config engine handles the Next.js 15 deployment automatically, detecting the framework and configuring the build, start, and routing. Here is how to deploy a Next.js 15 app with the App Router on Deployxa.
The direct answer is that Deployxa auto-detects Next.js 15 from your package.json (which includes next) and your app/ directory (which indicates the App Router). It configures the build and start commands: the build command is npm run build, the start command is npm start, and the port is configured via the PORT environment variable. The AutoRepairService handles missing dependencies, the localhost rewriter fixes hardcoded URLs, and the build resilience injector bypasses ESLint and TypeScript strictness. You do not write a Dockerfile, and the platform handles all the configuration. For more on Next.js deployment, see our article on why AI-generated Next.js apps fail to build.
Why Next.js 15 Is the Default for AI-Generated Apps
Three reasons explain why Next.js 15 is the default for AI-generated apps. First, it is the most popular React framework, which means the LLM's training data is dominated by Next.js examples, making code generation more reliable. Second, the App Router's server components and streaming provide excellent performance and UX, which means the generated apps are fast out of the box. Third, the App Router's file-based routing and built-in data fetching simplify the code, which means the LLM can generate clean, correct code with minimal guidance. For more on React deployment, see our article on fixing module not found in Vite + React apps.
The Architecture: Next.js 15 + Node Server + Container
Here is how Deployxa deploys a Next.js 15 app.
The Next.js container
The ingestion service detects Next.js 15 from your package.json and app/ directory. It configures the build and start commands:
- Build command: npm run build
- Start command: npm start (which runs next start)
- Runtime: Node 20
The App Router configuration
Next.js 15's App Router uses server components by default, which means the app needs a running Node server (not just static files). Deployxa's persistent containers are perfect for this, because they provide a long-running process that handles server-side rendering.
The reverse proxy
Traefik v3 routes traffic from your custom domain to the Next.js container, with automatic SSL via Let's Encrypt.
Step-by-Step: Deploying a Next.js 15 App
Here is the exact workflow for a typical Cursor-generated Next.js 15 app.
Step 1: Create your Next.js 15 app
npx create-next-app@latest my-app --app --typescript --tailwind --eslint
cd my-app
Step 2: Create a server component
// app/page.tsx
import { Suspense } from 'react';
async function getUsers() {
const res = await fetch('https://jsonplaceholder.typicode.com/users');
return res.json();
}
async function UserList() {
const users = await getUsers();
return (
{users.map((user: any) => (
- {user.name} ({user.email})
))}
);
}
export default function Home() {
return (
Users
Loading...
}>
);
}
Step 3: Add a health check endpoint
// app/api/health/route.ts
import { NextResponse } from 'next/server';
export async function GET() {
return NextResponse.json({ status: 'ok' });
}
Step 4: Push to GitHub
git init
git add .
git commit -m "next.js 15 app"
git remote add origin https://github.com/yourname/my-app.git
git push -u origin main
Step 5: Connect to Deployxa
In the Deployxa dashboard, connect your repository. Deployxa auto-detects Next.js 15:
[ingest] Detected Node.js project
[ingest] Framework: nextjs
[ingest] Version: 15.x
[ingest] Router: app
[ingest] Runtime: node 20.x
[ingest] Build command: npm run build
[ingest] Start command: npm start
[ingest] Port: $PORT
Step 6: Configure environment variables
In the Deployxa dashboard, add any environment variables your app needs. For Next.js 15, NEXT_PUBLIC_* variables are inlined at build time, so they need to be set before the build runs. For more on environment variables, see our article on the vibe coder's guide to environment variables.
Step 7: Deploy
Click Deploy. The build runs npm run build, the container starts with npm start, and your app is live within 60 to 90 seconds. The AutoRepairService stands by to patch any missing dependencies.
Step 8: Add a custom domain
Add a custom domain in the Deployxa dashboard. SSL is provisioned automatically.
Step 9: Verify with deployxa doctor
Run deployxa doctor to verify health. The 14-point readiness engine checks SSL, DNS, environment variables, health endpoints, and container status. For more on the readiness engine, see our article on the 14-point readiness engine.
Common Pitfalls and Troubleshooting
The first pitfall is server components vs. client components. Next.js 15's App Router uses server components by default, which means 'use client' is needed for components that use hooks (useState, useEffect) or browser APIs. AI assistants sometimes forget to add 'use client', which causes build errors. The fix is to add 'use client' at the top of any file that uses hooks or browser APIs. The second pitfall is the PORT environment variable. Next.js apps typically listen on port 3000 by default, but Deployxa assigns a dynamic port via the PORT environment variable. Next.js 15 respects the PORT environment variable automatically when using npm start. The third pitfall is environment variable timing. NEXT_PUBLIC_* variables are inlined at build time, which means changing them requires a rebuild. The fix is to set them in the Deployxa dashboard before triggering the build. The fourth pitfall is the output: 'export' configuration. If you set output: 'export' in next.config.js, the app becomes a static site (no server), which changes the deployment model. The fix is to only use output: 'export' if you want a static site, and to leave it unset for a server-rendered app. The fifth pitfall is middleware. Next.js 15's middleware runs on the Edge runtime by default, which has different capabilities from the Node runtime. The fix is to be aware of the limitations (e.g., no Node.js APIs in middleware) and to test middleware thoroughly.
Performance: Next.js 15 vs Other Frameworks
Next.js 15, SvelteKit, and Nuxt 3 are the leading meta-frameworks in 2026. Next.js 15 produces bundles of 100-300KB per page (because React includes a runtime), but it has the largest ecosystem and the most features (RSC, streaming, ISR). SvelteKit produces smaller bundles (10-50KB per page), because Svelte's compiler eliminates the runtime. Nuxt 3 produces bundles similar to Next.js. For apps that need the React ecosystem, Next.js 15 is the best choice. For apps that need maximum performance, SvelteKit is better. For apps that need the Vue ecosystem, Nuxt 3 is better. Deployxa supports all three equally, with the AutoRepairService and the zero-config engine handling each framework automatically. For more on framework comparisons, see our articles on deploying a SvelteKit app and deploying a Nuxt 3 app.
Advanced Next.js 15 Patterns
Beyond the basics, Next.js 15 apps benefit from several advanced patterns. The first is Server Components. Server Components run on the server and send HTML to the client, which reduces the JavaScript bundle and improves performance. Use Server Components by default, and only use 'use client' when you need interactivity. The second is Streaming. Next.js 15's streaming (via Suspense) lets you stream HTML to the client as it becomes available, which improves perceived performance. Use Suspense around slow data fetches to show a loading state while the data loads. The third is ISR (Incremental Static Regeneration). ISR lets you static-render pages at build time and revalidate them at runtime, which combines the performance of static sites with the freshness of server-rendered pages. The fourth is Route Handlers. Route Handlers (in app/api/) replace API routes and provide a Web Standards-based API for building endpoints. The fifth is Middleware. Middleware runs before every request, which is useful for auth, redirects, and A/B testing. For more on testing, see our article on the testing void. For more on Next.js deployment, see our articles on deploying a Vue 3 + Vite SPA and deploying a Fastify API.
Conclusion: Next.js 15 Without the Configuration
Next.js 15 with the App Router is the most popular React framework, and deploying it should be as simple as pushing to Git. Deployxa's zero-config engine makes it so: no Dockerfile, no server configuration, no build management. Stop configuring servers and start shipping.
Ready to deploy your Next.js 15 app? Drag your project to Deployxa Drop for an instant live preview, or install the CLI with npm i -g @deployxa/cli and deploy from your terminal. For more on framework deep-dives, see our articles on deploying a Vue 3 + Vite SPA and deploying a Fastify API. Learn about deploying a NestJS app and deploying a Gatsby static site in our companion articles. Explore our free developer tools to speed up your workflow.
Ready to deploy with Deployxa?
Deploy your apps globally with automatic SSL and AI diagnostics.
Start Free Now