<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Next.js &#8211; Aveshost Blog</title>
	<atom:link href="https://blog.aveshost.com/tag/next-js/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.aveshost.com</link>
	<description>Your Blueprint for Online Success</description>
	<lastBuildDate>Wed, 18 Nov 2026 18:47:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://blog.aveshost.com/wp-content/uploads/2026/01/logo-150x150.png</url>
	<title>Next.js &#8211; Aveshost Blog</title>
	<link>https://blog.aveshost.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Fix Next.js Image Optimization Errors After Deployment</title>
		<link>https://blog.aveshost.com/fix-next-js-image-optimization-errors/</link>
					<comments>https://blog.aveshost.com/fix-next-js-image-optimization-errors/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Wed, 18 Nov 2026 18:44:45 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[image optimization]]></category>
		<category><![CDATA[Next.js]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[vps hosting]]></category>
		<category><![CDATA[web hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5995</guid>

					<description><![CDATA[A complete troubleshooting guide to fixing Next.js /_next/image 400, 404, and 500 errors in production across shared web hosting, Docker standalone builds, and self-managed VPS hosting.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Few deployment issues are more frustrating than seeing every image load cleanly on <code>localhost:3000</code>, only to break with <code>400</code>, <code>404</code>, or <code>500</code> status codes on <code>/_next/image</code> once your site goes live. Because <strong>Next.js image optimization</strong> relies on strict hostname allowlists, Linux file paths, and server-side processing, small differences between local development and production servers quickly surface after deployment.</p>



<p class="wp-block-paragraph">Whether you are deploying a static site to <a href="https://www.aveshost.com/web-hosting" rel="noopener">shared web hosting</a> or running a Node.js container on <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">self-managed VPS hosting</a> with Aveshost, each HTTP error code points to a specific configuration or runtime root cause.</p>



<p class="wp-block-paragraph">In this guide, you will learn how to diagnose and fix the most common <strong>Next.js image optimization</strong> failures—including <code>remotePatterns</code> rejections, Next.js 16 <code>qualities</code> and <code>localPatterns</code> rules, missing <code>sharp</code> binaries, <code>output: 'standalone'</code> Docker asset copies, and static export setups.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#quick-diagnosis-what-next-image-status-codes-mean">Quick Diagnosis: What /_next/image Status Codes Mean</a></div><div><a href="#fix-http-400-errors-remotepatterns-qualities-and-svgs">Fix HTTP 400 Errors: remotePatterns, Qualities, and SVGs</a></div><div><a href="#fix-http-404-errors-linux-casing-and-standalone-docker-assets">Fix HTTP 404 Errors: Linux Casing and Standalone Docker Assets</a></div><div><a href="#fix-http-500-errors-install-sharp-and-check-redirects">Fix HTTP 500 Errors: Install sharp and Check Redirects</a></div><div><a href="#fix-image-errors-on-static-exports-and-shared-web-hosting">Fix Image Errors on Static Exports and Shared Web Hosting</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="quick-diagnosis-what-next-image-status-codes-mean" class="wp-block-heading">Quick Diagnosis: What /_next/image Status Codes Mean</h2>



<p class="wp-block-paragraph">Open your browser&#8217;s Network tab and click any broken image request targeting <code>/_next/image?url=...</code>. Before editing code, you can also temporarily add the <code>unoptimized</code> prop to a single <code>&lt;Image /&gt;</code> tag—if the image immediately loads, the file exists and the failure is inside the <strong>Next.js image optimization</strong> pipeline.</p>



<p class="wp-block-paragraph">Use this lookup table to match the HTTP status code to its production fix:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>HTTP Status</th><th>Typical Console / Network Error</th><th>Root Cause &amp; Primary Fix</th></tr></thead><tbody><tr><td>400 Bad Request</td><td>&#8220;url&#8221; parameter is not allowed / invalid quality</td><td>Missing images.remotePatterns, Next.js 16 qualities whitelist, localPatterns, or blocked SVG</td></tr><tr><td>404 Not Found</td><td>The requested resource isn&#8217;t a valid image / file not found</td><td>Linux case-sensitivity mismatch, /public prefix in src, or missing public/ copy in standalone Docker</td></tr><tr><td>500 Internal Server Error</td><td>upstream image response failed / sharp crash</td><td>Missing sharp dependency in production, CDN blocking server IP, or exceeded maximumRedirects</td></tr><tr><td>Build Error (Static)</td><td>Image Optimization using default loader is not compatible with export</td><td>Using output: &#8216;export&#8217; on shared web hosting without images: { unoptimized: true }</td></tr></tbody></table></figure>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1264" height="848" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-error-diagnostic-flow.webp" alt="Next.js /_next/image production error diagnostic flow covering HTTP 400 remotePatterns, HTTP 404 standalone assets, HTTP 500 sharp, and shared web hosting static exports" class="wp-image-5993" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-error-diagnostic-flow.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-error-diagnostic-flow-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-error-diagnostic-flow-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-error-diagnostic-flow-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="fix-http-400-errors-remotepatterns-qualities-and-svgs" class="wp-block-heading">Fix HTTP 400 Errors: remotePatterns, Qualities, and SVGs</h2>



<p class="wp-block-paragraph">An HTTP <code>400 Bad Request</code> on <code>/_next/image</code> means Next.js deliberately rejected the request for security or configuration reasons. According to the <a href="https://nextjs.org/docs/app/api-reference/components/image" rel="noopener">official Next.js Image documentation</a>, four settings trigger 400 errors after deployment:</p>



<p class="wp-block-paragraph">• <strong>1. Missing <code>images.remotePatterns</code>:</strong> Every external hostname (S3, Cloudflare R2, WordPress media, or Cloudinary) must be explicitly whitelisted in <code>next.config.ts</code>. Legacy <code>images.domains</code> arrays are deprecated and removed in Next.js 16.</p>



<p class="wp-block-paragraph">• <strong>2. Next.js 16 <code>images.qualities</code> Enforcement:</strong> In Next.js 16, <code>images.qualities</code> defaults strictly to <code>[75]</code>. If you pass <code>quality={85}</code> or <code>quality={90}</code> on an <code>&lt;Image /&gt;</code> component without adding those numbers to <code>images.qualities</code>, the optimizer rejects or coerces the request.</p>



<p class="wp-block-paragraph">• <strong>3. Dynamic Local Paths &amp; Query Strings (<code>localPatterns</code>):</strong> If local images inside <code>public/</code> include query parameters (such as cache-busting tokens), declare them under <code>images.localPatterns</code>.</p>



<p class="wp-block-paragraph">• <strong>4. Blocked SVG Files:</strong> Next.js blocks SVG optimization by default to prevent XSS attacks. Either render SVGs with a standard <code>&lt;img&gt;</code> tag or enable <code>dangerouslyAllowSVG: true</code> alongside <code>contentDispositionType: 'attachment'</code>.</p>



<pre class="wp-block-code"><code>// next.config.ts — Production Image Optimization Allowlist
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
  images: {
    qualities: &#91;75, 85, 90],
    maximumRedirects: 5,
    dangerouslyAllowSVG: true,
    contentDispositionType: 'attachment',
    remotePatterns: &#91;
      {
        protocol: 'https',
        hostname: 'cdn.yourdomain.com',
        pathname: '/uploads/**',
      },
    ],
  },
};

export default nextConfig;</code></pre>



<h2 id="fix-http-404-errors-linux-casing-and-standalone-docker-assets" class="wp-block-heading">Fix HTTP 404 Errors: Linux Casing and Standalone Docker Assets</h2>



<p class="wp-block-paragraph">Local images that work on Windows or macOS often return <code>404 Not Found</code> after deploying to a Linux server or container:</p>



<p class="wp-block-paragraph">• <strong>Linux Case Sensitivity:</strong> Windows and macOS filesystems treat <code>Hero.PNG</code> and <code>hero.png</code> as identical, whereas Linux servers treat them as completely different files. Always verify exact lowercase filenames across both <code>public/</code> and your JSX <code>src</code> strings.</p>



<p class="wp-block-paragraph">• <strong>Do Not Include <code>/public</code> in <code>src</code>:</strong> Next.js serves files from <code>public/</code> at the root path <code>/</code>. Writing <code>src="/public/banner.webp"</code> produces a 404; use <code>src="/banner.webp"</code> instead.</p>



<p class="wp-block-paragraph">• <strong>Copy <code>public/</code> and <code>.next/static</code> in Standalone Docker Builds:</strong> When deploying with <code>output: 'standalone'</code> on <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">self-managed VPS hosting</a> or <a href="https://www.aveshost.com/fully-managed-vps-hosting" rel="noopener">fully managed VPS hosting</a>, Next.js does not copy <code>public/</code> or <code>.next/static/</code> into <code>.next/standalone</code> automatically. Add both <code>COPY --from=builder</code> lines to your Dockerfile runner stage.</p>



<pre class="wp-block-code"><code># Dockerfile runner stage: prevent 404s on /_next/static and /public images
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static</code></pre>



<h2 id="fix-http-500-errors-install-sharp-and-check-redirects" class="wp-block-heading">Fix HTTP 500 Errors: Install sharp and Check Redirects</h2>



<p class="wp-block-paragraph">When <code>/_next/image</code> returns <code>500 Internal Server Error</code> in production logs (<code>upstream image response failed</code> or out-of-memory crashes), the Node.js optimization worker is failing at runtime:</p>



<p class="wp-block-paragraph">• <strong>Install <code>sharp</code> Explicitly:</strong> Without <code>sharp</code> installed, Next.js falls back to slower WebAssembly image processing that frequently runs out of memory under production traffic. Run <code>npm install sharp</code> and commit it to <code>package.json</code>.</p>



<p class="wp-block-paragraph">• <strong>Verify Docker Architecture &amp; Permissions:</strong> If you build on Apple Silicon (ARM64) and push to an x86_64 VPS without multi-arch builds, native <code>sharp</code> binaries will crash. Always build inside Docker on the target architecture (<code>linux/amd64</code>) using <code>node:22-alpine</code> or <code>node:22-slim</code>.</p>



<p class="wp-block-paragraph">• <strong>Increase <code>maximumRedirects</code> if Your CDN Redirects:</strong> Next.js 16 limits how many HTTP redirects the image optimizer follows when fetching remote images. If your asset CDN uses multiple redirect hops, set <code>maximumRedirects: 5</code> inside <code>images</code> in <code>next.config.ts</code>.</p>



<h2 id="fix-image-errors-on-static-exports-and-shared-web-hosting" class="wp-block-heading">Fix Image Errors on Static Exports and Shared Web Hosting</h2>



<p class="wp-block-paragraph">As covered in our <a href="https://blog.aveshost.com/next-js-static-export-vs-server-hosting/">Next.js static export vs server hosting</a> comparison, running <code>output: 'export'</code> removes the Node.js server completely—meaning there is no <code>/_next/image</code> endpoint available when you upload the <code>out/</code> folder to <a href="https://www.aveshost.com/web-hosting" rel="noopener">shared web hosting</a>.</p>



<p class="wp-block-paragraph">To eliminate build errors and broken images on static hosting, set <code>images: { unoptimized: true }</code> in <code>next.config.ts</code> (or configure a custom external loader such as Cloudinary or Cloudflare Images) and pre-compress your assets to WebP before building.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1264" height="848" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-production-fixes-grid.webp" alt="6 fixes for Next.js image optimization after deployment covering remotePatterns, qualities, standalone copy, sharp, Linux casing, and unoptimized static export" class="wp-image-5994" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-production-fixes-grid.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-production-fixes-grid-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-production-fixes-grid-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-image-production-fixes-grid-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="faq" class="wp-block-heading">Frequently asked questions</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="faq-question-2ee0e026e2ea4b65ac348e0d8c80e7ff" class="rank-math-list-item">
<h3 class="rank-math-question ">Why does /_next/image return 400 Bad Request only after deployment?</h3>
<div class="rank-math-answer ">

<p>An HTTP 400 error on /_next/image usually means the external image hostname is missing from images.remotePatterns in next.config.ts, or—in Next.js 16—you passed a quality prop (such as quality={85}) that is not whitelisted in images.qualities (which defaults strictly to [75]).</p>

</div>
</div>
<div id="faq-question-b99e577e24554079803f7a2c38f8bd80" class="rank-math-list-item">
<h3 class="rank-math-question ">Why do local images in public/ return 404 in a Docker standalone deployment?</h3>
<div class="rank-math-answer ">

<p>When output: &#8216;standalone&#8217; is enabled, Next.js excludes public/ and .next/static/ from .next/standalone by default. You must explicitly add COPY &#8211;from=builder /app/public ./public and COPY &#8211;from=builder /app/.next/static ./.next/static to your Dockerfile runner stage.</p>

</div>
</div>
<div id="faq-question-257c3a8d5da7450499d04cd2eb6a2985" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I fix 500 Internal Server Error on Next.js Image Optimization?</h3>
<div class="rank-math-answer ">

<p>Install sharp as a production dependency (npm install sharp) so Next.js does not rely on the slower WebAssembly fallback, ensure your Docker container matches your VPS CPU architecture, and check whether your external image host is blocking server-side fetches or exceeding Next.js 16&#8217;s maximumRedirects limit.</p>

</div>
</div>
<div id="faq-question-c2bbef8f26a94542ba2a04f4d8c04e32" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I use next/image on shared web hosting with output: &#8216;export&#8217;?</h3>
<div class="rank-math-answer ">

<p>Shared web hosting serves static files without a Node.js /_next/image server. Add images: { unoptimized: true } to next.config.ts (or supply a custom external CDN loader) so Next.js renders standard image URLs inside your static out/ build.</p>

</div>
</div>
<div id="faq-question-f4f516c493f244e5aa32f37d98e6a324" class="rank-math-list-item">
<h3 class="rank-math-question ">How can I quickly test if an image bug is caused by Next.js optimization or a broken URL?</h3>
<div class="rank-math-answer ">

<p>Temporarily add the unoptimized prop to that specific Image component and redeploy or test locally. If the image appears immediately, the file path is valid and the error is inside your /_next/image server config (remotePatterns, qualities, or sharp).</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/fix-next-js-image-optimization-errors/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Next.js Static Export vs Server Hosting: Which Does Your Website Need?</title>
		<link>https://blog.aveshost.com/next-js-static-export-vs-server-hosting/</link>
					<comments>https://blog.aveshost.com/next-js-static-export-vs-server-hosting/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Wed, 18 Nov 2026 17:36:32 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Next.js]]></category>
		<category><![CDATA[Static Export]]></category>
		<category><![CDATA[vps hosting]]></category>
		<category><![CDATA[web hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5983</guid>

					<description><![CDATA[A practical engineering guide comparing Next.js static export (output: 'export') against Node.js server hosting (next start and output: 'standalone') across shared hosting, Ubuntu VPS, and unsupported features.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Choosing between <strong>Next.js static export</strong> and full Node.js server hosting determines both your monthly infrastructure bill and which Next.js features will actually work in production. One option compiles your entire site into plain HTML, CSS, and JavaScript files; the other runs a persistent Node.js server capable of dynamic rendering on every request.</p>



<p class="wp-block-paragraph">For agencies and developers hosting on <a href="https://www.aveshost.com/web-hosting" rel="noopener">Shared Hosting</a> versus an <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Self-Managed VPS</a>, picking the wrong mode leads to broken images, failed builds, or paying for server resources you do not need.</p>



<p class="wp-block-paragraph">In this guide, we compare <strong>Next.js static export</strong> (<code>output: 'export'</code>) against Node.js server hosting (<code>next start</code> and <code>output: 'standalone'</code>) across unsupported features, image optimization, Docker sizing, and real-world website use cases.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#nextjs-static-export-vs-server-hosting-core-differences">Next.js Static Export vs Server Hosting: Core Differences</a></div><div><a href="#what-breaks-with-nextjs-static-export-and-how-to-work-around-it">What Breaks with Next.js Static Export (and How to Work Around It)</a></div><div><a href="#when-to-host-a-static-export-on-directadmin-shared-hosting">When to Host a Static Export on DirectAdmin Shared Hosting</a></div><div><a href="#when-you-need-nodejs-server-hosting-on-a-vps-with-standalone">When You Need Node.js Server Hosting on a VPS with Standalone Mode</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="nextjs-static-export-vs-server-hosting-core-differences" class="wp-block-heading">Next.js Static Export vs Server Hosting: Core Differences</h2>



<p class="wp-block-paragraph">When you build a Next.js application, <code>next build</code> outputs different artifacts depending on the <code>output</code> property in <code>next.config.ts</code>.</p>



<p class="wp-block-paragraph">Here is how <strong>Next.js static export</strong> compares against Node.js server hosting side by side:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Feature / Criterion</th><th>Static Export (output: &#8216;export&#8217;)</th><th>Server Hosting (next start / standalone)</th></tr></thead><tbody><tr><td>Production Output</td><td>Static HTML, CSS &amp; JS files in /out</td><td>Live Node.js 20.9+ server process (server.js)</td></tr><tr><td>Minimum Hosting Stack</td><td>Shared Hosting (DirectAdmin), Nginx, Apache, or CDN</td><td>Ubuntu VPS (PM2 / systemd) or Docker Container</td></tr><tr><td>Server-Side Rendering (SSR)</td><td>Unsupported (build-time rendering only)</td><td>Fully Supported (dynamic request rendering)</td></tr><tr><td>Incremental Static Regeneration (ISR)</td><td>Unsupported (requires full rebuild to update)</td><td>Fully Supported (revalidate &amp; on-demand tags)</td></tr><tr><td>Server Actions &amp; Route Handlers</td><td>Unsupported (no server endpoint at runtime)</td><td>Fully Supported (&#8216;use server&#8217; &amp; route.ts)</td></tr><tr><td>proxy.ts / Middleware</td><td>Unsupported (use client-side redirects or Nginx rules)</td><td>Fully Supported (runs before every route)</td></tr><tr><td>next/image Optimization</td><td>Requires images: { unoptimized: true } or CDN loader</td><td>Automatic WebP/AVIF resizing via /_next/image</td></tr></tbody></table></figure>



<figure class="wp-block-image size-full"><img decoding="async" width="1264" height="848" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-architecture.webp" alt="Next.js Static Export vs Server Hosting request lifecycle diagram comparing DirectAdmin shared hosting vs Ubuntu VPS Node.js standalone deployment" class="wp-image-5981" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-architecture.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-architecture-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-architecture-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-architecture-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="what-breaks-with-nextjs-static-export-and-how-to-work-around-it" class="wp-block-heading">What Breaks with Next.js Static Export (and How to Work Around It)</h2>



<p class="wp-block-paragraph">According to the <a href="https://nextjs.org/docs/app/guides/static-exports" rel="noopener">official Next.js Static Exports documentation</a>, removing the Node.js server eliminates any feature that executes at request time. Before enabling <code>output: 'export'</code>, check these four common build blockers:</p>



<p class="wp-block-paragraph">• <strong>1. Default <code>next/image</code> Optimization:</strong> The built-in <code>/_next/image</code> endpoint resizes images on demand via Node.js. In static export mode, you must set <code>images: { unoptimized: true }</code> in <code>next.config.ts</code> or configure a third-party image CDN loader.</p>



<p class="wp-block-paragraph">• <strong>2. Dynamic Routes Without <code>generateStaticParams</code>:</strong> Any dynamic segment such as <code>app/blog/[slug]/page.tsx</code> must export a <code>generateStaticParams()</code> function so Next.js knows every HTML file to generate during <code>next build</code>.</p>



<p class="wp-block-paragraph">• <strong>3. Server Actions, <code>proxy.ts</code> &amp; API Routes:</strong> Because no Node.js runtime exists on a static file host, <code>'use server'</code> mutations, <code>cookies()</code>, <code>headers()</code>, and <code>proxy.ts</code> will fail the build. Contact forms and auth must call external REST APIs or a backend like <a href="https://blog.aveshost.com/deploy-pocketbase-on-a-vps/">self-hosted PocketBase</a>.</p>



<p class="wp-block-paragraph">• <strong>4. Incremental Static Regeneration (ISR):</strong> Scheduled background revalidation does not exist in static exports; updating a blog post requires re-running <code>next build</code> and re-uploading the <code>out/</code> folder.</p>



<h2 id="when-to-host-a-static-export-on-directadmin-shared-hosting" class="wp-block-heading">When to Host a Static Export on DirectAdmin Shared Hosting</h2>



<p class="wp-block-paragraph">If your website is a company landing page, portfolio, documentation portal, or marketing brochure whose content only changes when you deploy updates, a <strong>Next.js static export</strong> is faster, cheaper, and simpler to maintain than managing a Node.js server.</p>



<p class="wp-block-paragraph">On <a href="https://www.aveshost.com/web-hosting" rel="noopener">Shared Web Hosting</a>, you run <code>npm run build</code> locally or in GitHub Actions, upload the contents of the generated <code>out/</code> directory into <code>public_html/</code>, and add a clean Nginx/Apache fallback rule if needed—with built-in SSL, business email, and zero Node.js memory limits to worry about.</p>



<pre class="wp-block-code"><code>// next.config.ts — Static Export for DirectAdmin Shared Hosting or CDN
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
  output: 'export',
  trailingSlash: true, // Generates /about/index.html for clean shared-hosting URLs
  images: {
    unoptimized: true, // Required unless using a custom CDN image loader
  },
};

export default nextConfig;</code></pre>



<h2 id="when-you-need-nodejs-server-hosting-on-a-vps-with-standalone" class="wp-block-heading">When You Need Node.js Server Hosting on a VPS with Standalone Mode</h2>



<p class="wp-block-paragraph">Once your site requires authenticated dashboards, Server Actions, personalized <code>cookies()</code>, ISR revalidation for thousands of pages, or automatic <code>next/image</code> WebP/AVIF resizing, you need live Node.js server hosting (Node 20.9+ or Node 22 LTS as covered in our <a href="https://blog.aveshost.com/next-js-16-upgrade-guide/">Next.js 16 upgrade guide</a>).</p>



<p class="wp-block-paragraph">When deploying to an <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Ubuntu VPS</a> via Docker or a PaaS like <a href="https://blog.aveshost.com/dokploy-vs-coolify/">Dokploy or Coolify</a>, prefer <code>output: 'standalone'</code> over default <code>next start</code>:</p>



<p class="wp-block-paragraph">• <strong>Smaller Docker Images (~150 MB vs 1 GB+):</strong> Standalone mode traces only the exact JavaScript dependencies required at runtime into <code>.next/standalone/server.js</code>, leaving behind massive dev dependencies.</p>



<p class="wp-block-paragraph">• <strong>Copy Static Assets &amp; Bind <code>0.0.0.0</code>:</strong> Inside your Dockerfile runner stage, manually copy <code>public/</code> and <code>.next/static/</code> into the standalone folder and set <code>ENV HOSTNAME="0.0.0.0"</code> so Caddy or Nginx can proxy traffic to port <code>3000</code>.</p>



<p class="wp-block-paragraph">• <strong>Build Outside Small 1 GB VPS Instances:</strong> Next.js production builds spike RAM usage; build your Docker image in GitHub Actions or on a 4 GB+ RAM VPS with swap enabled so the kernel OOM killer never interrupts compilation.</p>



<pre class="wp-block-code"><code># Dockerfile runner stage for output: 'standalone' on an Ubuntu VPS
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME="0.0.0.0"
ENV PORT=3000

COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static

EXPOSE 3000
CMD &#91;"node", "server.js"]</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1264" height="848" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-decision-matrix.webp" alt="Next.js hosting decision matrix comparing static export for marketing sites vs server hosting for SaaS, image optimization, standalone Docker sizing, and Aveshost hosting fit" class="wp-image-5982" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-decision-matrix.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-decision-matrix-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-decision-matrix-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-static-vs-server-decision-matrix-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="faq" class="wp-block-heading">Frequently asked questions</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="faq-question-41b49793977e4d8e9f19b26aac4f8ebf" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I host a Next.js static export on DirectAdmin shared hosting?</h3>
<div class="rank-math-answer ">

<p>Yes. Setting output: &#8216;export&#8217; in next.config.ts compiles your site into plain HTML, CSS, and JavaScript inside the out/ folder. You can upload those files directly into public_html on DirectAdmin shared hosting with no Node.js runtime required.</p>

</div>
</div>
<div id="faq-question-c5d56fda0cf542969a3f3782af43d5bb" class="rank-math-list-item">
<h3 class="rank-math-question ">Why does next/image fail during a Next.js static export?</h3>
<div class="rank-math-answer ">

<p>By default, the Next.js Image component routes images through /_next/image, which requires a live Node.js server to resize and convert files on demand. For static exports, add images: { unoptimized: true } to next.config.ts or configure a custom external CDN image loader.</p>

</div>
</div>
<div id="faq-question-ad2eda038cb64961a26b5d012e0ea49b" class="rank-math-list-item">
<h3 class="rank-math-question ">What is the difference between next start and output: &#8216;standalone&#8217; on a VPS?</h3>
<div class="rank-math-answer ">

<p>next start runs the full Next.js CLI and requires the entire node_modules directory (often 600 MB to 1.5 GB+ in Docker). output: &#8216;standalone&#8217; bundles only the traced runtime files into .next/standalone/server.js, shrinking Docker images to around 100–250 MB for faster VPS deployments.</p>

</div>
</div>
<div id="faq-question-d2cbf2ba852743529980090bafebee6a" class="rank-math-list-item">
<h3 class="rank-math-question ">Do Server Actions and proxy.ts middleware work in a static export?</h3>
<div class="rank-math-answer ">

<p>No. Both Server Actions (&#8216;use server&#8217;) and proxy.ts (formerly middleware.ts) require a live server runtime to process incoming POST requests and headers. If your app depends on them, deploy with Node.js server hosting on a VPS.</p>

</div>
</div>
<div id="faq-question-7f9c050abbce44c5925bbeec16066d39" class="rank-math-list-item">
<h3 class="rank-math-question ">How much VPS RAM do I need for Next.js server hosting?</h3>
<div class="rank-math-answer ">

<p>At runtime, a standalone Next.js server runs comfortably on a 1 GB to 2 GB RAM Ubuntu VPS. However, running next build directly on the server spikes memory usage—so use at least 2 to 4 GB RAM (with swap) or build your Docker image in CI/CD before pulling it to the VPS.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/next-js-static-export-vs-server-hosting/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Next.js 16 Upgrade Guide: Fix Breaking Changes Before Deployment</title>
		<link>https://blog.aveshost.com/next-js-16-upgrade-guide/</link>
					<comments>https://blog.aveshost.com/next-js-16-upgrade-guide/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Wed, 18 Nov 2026 15:56:37 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Next.js]]></category>
		<category><![CDATA[Next.js 16]]></category>
		<category><![CDATA[React 19]]></category>
		<category><![CDATA[Turbopack]]></category>
		<category><![CDATA[TypeScript]]></category>
		<category><![CDATA[vps hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5978</guid>

					<description><![CDATA[A practical Next.js 16 upgrade guide covering Node.js 20.9+ requirements, renaming middleware.ts to proxy.ts, awaiting dynamic request APIs, default Turbopack builds, and pre-deployment VPS checks.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This <strong>Next.js 16 upgrade guide</strong> walks through every breaking change you need to resolve before pushing your upgraded application to production. Next.js 16 brings React 19.2+, makes Turbopack the default bundler for both development and production builds, and introduces explicit <code>"use cache"</code> components—but it also removes legacy synchronous APIs and Node.js 18 support.</p>



<p class="wp-block-paragraph">Whether you deploy to Docker containers using <a href="https://blog.aveshost.com/dokploy-vs-coolify/">Dokploy or Coolify</a> or run Node.js directly behind Nginx on an <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Self-Managed VPS</a>, catching these breaking changes locally prevents failed CI/CD builds and runtime crashes in production.</p>



<p class="wp-block-paragraph">Below, we cover the minimum runtime requirements, the official <code>@next/codemod</code> migration command, the <code>middleware.ts</code> to <code>proxy.ts</code> rename, strictly asynchronous dynamic APIs, Turbopack compatibility, and image/AMP cleanup.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#nextjs-16-upgrade-guide-minimum-requirements-and-codemod">Next.js 16 Upgrade Guide: Minimum Requirements and Codemod</a></div><div><a href="#breaking-change-1-rename-middleware-ts-to-proxy-ts">Breaking Change 1: Rename middleware.ts to proxy.ts</a></div><div><a href="#breaking-change-2-await-all-async-dynamic-request-apis">Breaking Change 2: Await All Async Dynamic Request APIs</a></div><div><a href="#breaking-change-3-turbopack-default-and-custom-webpack-configs">Breaking Change 3: Turbopack Default and Custom Webpack Configs</a></div><div><a href="#breaking-change-4-next-lint-images-amp-and-use-cache">Breaking Change 4: next lint, Images, AMP, and Explicit Caching</a></div><div><a href="#pre-deployment-checklist-for-vps-and-docker-hosting">Pre-Deployment Checklist for VPS and Docker Hosting</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="nextjs-16-upgrade-guide-minimum-requirements-and-codemod" class="wp-block-heading">Next.js 16 Upgrade Guide: Minimum Requirements and Codemod</h2>



<p class="wp-block-paragraph">Before editing application code, verify that both your local workstation and your production VPS or Docker image meet the baseline runtime versions documented in the <a href="https://nextjs.org/docs/app/guides/upgrading/version-16" rel="noopener">official Next.js 16 upgrade documentation</a>.</p>



<p class="wp-block-paragraph">Next.js 16 officially drops support for Node.js 18. If your CI runner, Dockerfile, or Ubuntu VPS still runs Node 18, <code>next build</code> will fail immediately:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Dependency / Tool</th><th>Next.js 15 Baseline</th><th>Next.js 16 Requirement</th></tr></thead><tbody><tr><td>Node.js Runtime</td><td>Node.js 18.18+ or 20+</td><td>Node.js 20.9.0+ (Node 18 dropped; Node 22 LTS recommended)</td></tr><tr><td>React &amp; React DOM</td><td>React 18 / 19 RC</td><td>React 19.2+ (with React Compiler support)</td></tr><tr><td>TypeScript</td><td>TypeScript 4.5.2+</td><td>TypeScript 5.1.0+</td></tr><tr><td>Default Bundler</td><td>Webpack (Turbopack opt-in for dev)</td><td>Turbopack default for both next dev and next build</td></tr><tr><td>Request Interception File</td><td>middleware.ts (middleware export)</td><td>proxy.ts (proxy export)</td></tr></tbody></table></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1264" height="848" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-migration-pipeline.webp" alt="Next.js 16 upgrade pipeline diagram showing Node.js 20.9+ runtime check, @next/codemod upgrade, proxy.ts and async params migration, and Turbopack VPS deployment" class="wp-image-5976" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-migration-pipeline.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-migration-pipeline-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-migration-pipeline-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-migration-pipeline-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="breaking-change-1-rename-middleware-ts-to-proxy-ts" class="wp-block-heading">Breaking Change 1: Rename middleware.ts to proxy.ts</h2>



<p class="wp-block-paragraph">One of the most visible changes in Next.js 16 is renaming <code>middleware.ts</code> to <code>proxy.ts</code> (and renaming the exported function from <code>middleware</code> to <code>proxy</code>). The Next.js team made this change to clarify that the file acts as a network boundary and reverse-proxy layer in front of your routes rather than a traditional Express-style backend middleware.</p>



<p class="wp-block-paragraph">While <code>middleware.ts</code> still runs temporarily with a deprecation warning, migrating now keeps your codebase aligned with the official convention. Note that <code>proxy.ts</code> runs on the Node.js runtime by default.</p>



<p class="wp-block-paragraph">Run the official codemod or rename the file and exported function manually inside your project root or <code>src/</code> directory.</p>



<pre class="wp-block-code"><code># 1. Run the official Next.js 16 upgrade codemod
npx @next/codemod@canary upgrade latest

# 2. Or rename middleware.ts -&gt; proxy.ts directly
npx @next/codemod@canary middleware-to-proxy

// proxy.ts (Next.js 16)
import { NextResponse, type NextRequest } from 'next/server';

export function proxy(request: NextRequest) {
  return NextResponse.next();
}</code></pre>



<h2 id="breaking-change-2-await-all-async-dynamic-request-apis" class="wp-block-heading">Breaking Change 2: Await All Async Dynamic Request APIs</h2>



<p class="wp-block-paragraph">Next.js 15 introduced asynchronous request APIs with temporary synchronous fallbacks and console warnings. In Next.js 16, those synchronous fallbacks are <strong>completely removed</strong>.</p>



<p class="wp-block-paragraph">Every dynamic request accessor must now be awaited inside Server Components, Route Handlers (<code>route.ts</code>), Server Actions, and <code>generateMetadata</code> functions:</p>



<p class="wp-block-paragraph">• <strong>Route <code>params</code> &amp; <code>searchParams</code>:</strong> Type <code>params</code> and <code>searchParams</code> as <code>Promise&lt;{ ... }&gt;</code> in Pages, Layouts, and Route Handlers and destructure them with <code>await params</code>.</p>



<p class="wp-block-paragraph">• <strong><code>cookies()</code>, <code>headers()</code> &amp; <code>draftMode()</code>:</strong> Calling <code>cookies().get('session')</code> synchronously will throw a runtime TypeError. Always write <code>const cookieStore = await cookies();</code> first.</p>



<p class="wp-block-paragraph">• <strong>Type Generation Helper:</strong> Run <code>npx next typegen</code> after upgrading to automatically generate strict <code>PageProps</code> and <code>LayoutProps</code> types and catch missed synchronous accesses at compile time.</p>



<pre class="wp-block-code"><code>// app/posts/&#91;slug]/page.tsx (Next.js 16)
import { cookies } from 'next/headers';

export default async function PostPage({
  params,
}: {
  params: Promise&lt;{ slug: string }&gt;;
}) {
  const { slug } = await params;
  const cookieStore = await cookies();
  const theme = cookieStore.get('theme')?.value ?? 'light';

  return &lt;main data-theme={theme}&gt;Post: {slug}&lt;/main&gt;;
}</code></pre>



<h2 id="breaking-change-3-turbopack-default-and-custom-webpack-configs" class="wp-block-heading">Breaking Change 3: Turbopack Default and Custom Webpack Configs</h2>



<p class="wp-block-paragraph">Turbopack is now the default bundler for both <code>next dev</code> and <code>next build</code>, delivering dramatically faster Fast Refresh and production builds. However, if your <code>next.config.ts</code> contains a custom <code>webpack(config) { ... }</code> function (for example, SVGR loaders, custom aliases, or raw-loader rules), Turbopack will fail or warn unless you migrate those rules or opt back into Webpack.</p>



<p class="wp-block-paragraph">• <strong>Migrate Loaders to <code>turbopack</code> Config:</strong> Move supported Webpack loaders and resolve aliases into the top-level <code>turbopack</code> block in <code>next.config.ts</code>.</p>



<p class="wp-block-paragraph">• <strong>Temporary Webpack Escape Hatch:</strong> If a third-party plugin relies on an unsupported Webpack plugin and you need to ship urgently, update your <code>package.json</code> build script to <code>next build --webpack</code> until you complete the Turbopack migration.</p>



<h2 id="breaking-change-4-next-lint-images-amp-and-use-cache" class="wp-block-heading">Breaking Change 4: next lint, Images, AMP, and Explicit Caching</h2>



<p class="wp-block-paragraph">Several long-standing CLI commands, image props, and experimental caching flags also changed in Next.js 16:</p>



<p class="wp-block-paragraph">• <strong><code>next lint</code> Removed:</strong> The built-in <code>next lint</code> wrapper has been removed. Update your <code>package.json</code> lint script to invoke ESLint directly (<code>eslint .</code>) or use Biome.</p>



<p class="wp-block-paragraph">• <strong><code>images.domains</code> Removed &amp; <code>next/legacy/image</code> Deprecated:</strong> Replace legacy <code>images.domains</code> arrays in <code>next.config.ts</code> with <code>images.remotePatterns</code>, migrate any remaining <code>next/legacy/image</code> imports to <code>next/image</code>, and note that <code>preload</code> supersedes <code>priority</code> while default image cache TTL increased from 60 seconds to 4 hours.</p>



<p class="wp-block-paragraph">• <strong>AMP Support Removed:</strong> Built-in Accelerated Mobile Pages (AMP) rendering and <code>useAmp</code> have been completely removed from the framework.</p>



<p class="wp-block-paragraph">• <strong>Explicit <code>cacheComponents</code> &amp; <code>"use cache"</code>:</strong> Experimental Partial Prerendering (<code>experimental.ppr</code>) is replaced by <code>cacheComponents: true</code>, shifting Next.js to an explicit opt-in caching model using the <code>"use cache"</code> directive.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1264" height="848" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-breaking-changes-grid.webp" alt="6 Next.js 16 breaking changes to fix before deployment covering proxy.ts, async dynamic APIs, Turbopack default, Node.js 20.9+, image/AMP cleanup, and ESLint/use cache" class="wp-image-5977" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-breaking-changes-grid.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-breaking-changes-grid-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-breaking-changes-grid-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nextjs-16-breaking-changes-grid-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="pre-deployment-checklist-for-vps-and-docker-hosting" class="wp-block-heading">Pre-Deployment Checklist for VPS and Docker Hosting</h2>



<p class="wp-block-paragraph">Once your local <code>npm run build</code> passes cleanly with zero TypeScript or Turbopack errors, verify your deployment target before pushing to production:</p>



<p class="wp-block-paragraph">• <strong>Update Your VPS or Dockerfile Node Version:</strong> On an <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Ubuntu VPS</a>, check <code>node -v</code> and upgrade to Node.js 22 LTS if you are still on Node 18. In Dockerfiles, update your base image to <code>FROM node:22-alpine</code>.</p>



<p class="wp-block-paragraph">• <strong>Keep <code>output: 'standalone'</code> for Lean Containers:</strong> If you deploy via <a href="https://blog.aveshost.com/dokploy-vs-coolify/">Dokploy, Coolify</a>, or Docker Compose, <code>output: 'standalone'</code> trims production container size dramatically and starts in under a second.</p>



<p class="wp-block-paragraph">• <strong>Test Dynamic Routes &amp; Edge Headers Live:</strong> After deploying, verify that your renamed <code>proxy.ts</code> redirects, auth cookies, and dynamic <code>[slug]</code> routes return <code>200 OK</code> with no unhandled Promise rejections in server logs.</p>



<h2 id="faq" class="wp-block-heading">Frequently asked questions</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="faq-question-7fb04c8174e244c094053b165da4b4ef" class="rank-math-list-item">
<h3 class="rank-math-question ">What is the minimum Node.js version required for Next.js 16?</h3>
<div class="rank-math-answer ">

<p>Next.js 16 requires Node.js 20.9.0 or higher (with Node.js 22 LTS recommended for production). Support for Node.js 18 has been completely dropped, so you must update your local environment, CI/CD runners, and VPS/Dockerfile Node runtime before running next build.</p>

</div>
</div>
<div id="faq-question-c4c1b704e870435289b036b99c430833" class="rank-math-list-item">
<h3 class="rank-math-question ">Do I have to rename middleware.ts to proxy.ts in Next.js 16?</h3>
<div class="rank-math-answer ">

<p>In Next.js 16, middleware.ts is deprecated in favor of proxy.ts (exporting function proxy(request: NextRequest)) to reflect its role as a network boundary. While middleware.ts still works temporarily with a deprecation warning, you should run npx @next/codemod@canary middleware-to-proxy to migrate cleanly before the next major release.</p>

</div>
</div>
<div id="faq-question-f5b1566039cd4916a79144cf1f74f909" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I fix &#8216;params should be awaited before using its properties&#8217; in Next.js 16?</h3>
<div class="rank-math-answer ">

<p>Update your Page, Layout, and Route Handler components to async functions, type params and searchParams as Promise, and await them (const { id } = await params). The same strict async requirement applies to cookies(), headers(), and draftMode().</p>

</div>
</div>
<div id="faq-question-2aa1aa02c4eb4164ac15984395bc2be4" class="rank-math-list-item">
<h3 class="rank-math-question ">My custom webpack config broke in Next.js 16—how can I deploy quickly?</h3>
<div class="rank-math-answer ">

<p>Next.js 16 uses Turbopack by default for both next dev and next build, which skips custom webpack() functions in next.config.ts. You can either migrate your loaders into the turbopack configuration key or temporarily force Webpack by changing your build script to next build &#8211;webpack.</p>

</div>
</div>
<div id="faq-question-70e10bb1757c47cc911aa591cb600656" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I automatically upgrade a Next.js 15 project to Next.js 16?</h3>
<div class="rank-math-answer ">

<p>Run npx @next/codemod@canary upgrade latest in your project root. The official Next.js codemod upgrades next, react, and react-dom, applies breaking-change transforms (such as async dynamic APIs and config updates), and flags any remaining manual fixes before you run npm run build.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/next-js-16-upgrade-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Coolify on a VPS: Deploy Next.js and Docker Beyond Vercel and Heroku</title>
		<link>https://blog.aveshost.com/coolify-on-a-vps/</link>
					<comments>https://blog.aveshost.com/coolify-on-a-vps/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Mon, 12 Oct 2026 13:47:20 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Coolify]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Next.js]]></category>
		<category><![CDATA[self-hosted PaaS]]></category>
		<category><![CDATA[vps hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=4955</guid>

					<description><![CDATA[Coolify on a VPS gives you a familiar way to deploy applications while keeping your hosting environment under your control. Connect a Git repository, build your Next.js project or Docker stack, attach a domain and publish through HTTPS—all on our self-managed cloud VPS. If you are ready to move beyond Vercel or Heroku, the appeal [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Coolify on a VPS</strong> gives you a familiar way to deploy applications while keeping your hosting environment under your control. Connect a Git repository, build your Next.js project or Docker stack, attach a domain and publish through HTTPS—all on our self-managed cloud VPS.</p>



<p class="wp-block-paragraph">If you are ready to move beyond Vercel or Heroku, the appeal is straightforward: choose your server capacity, run several suitable projects together and manage the deployment workflow from one dashboard. You can keep the convenience of automated releases while building around a cloud hosting budget you choose.</p>



<p class="wp-block-paragraph">This guide takes you from a fresh Linux VPS to Git-based Next.js deployments and a Docker Compose stack. It also covers environment variables, persistent storage, migration, backups and troubleshooting so your platform remains useful after the first successful deployment.</p>



<ul class="wp-block-list">
<li><strong>Next.js route:</strong> deploy a production Node.js application with Nixpacks.</li>



<li><strong>Docker route:</strong> use a Dockerfile or a repository-based Compose stack.</li>



<li><strong>Hosting foundation:</strong> our self-managed cloud VPS, full root access and SSD storage.</li>



<li><strong>Production essentials:</strong> HTTPS, private databases, health checks and tested recovery.</li>
</ul>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#why">Why use Coolify on a VPS?</a></div><div><a href="#choose">Choose the right self-managed cloud VPS</a></div><div><a href="#prepare">1. Prepare your server and deployment plan</a></div><div><a href="#install">2. Install Coolify and secure the dashboard</a></div><div><a href="#connect">3. Connect your Git repository</a></div><div><a href="#nextjs">4. Deploy a Next.js application</a></div><div><a href="#docker">5. Deploy Docker apps and multi-service stacks</a></div><div><a href="#domains">6. Add your domain and HTTPS</a></div><div><a href="#release">7. Automate releases and plan rollbacks</a></div><div><a href="#backup">8. Back up, monitor and grow your stack</a></div><div><a href="#troubleshoot">Fix common Coolify deployment problems</a></div><div><a href="#migrate">Move from Vercel or Heroku with a clear cutover</a></div><div><a href="#start">Build your deployment platform with us</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="why" class="wp-block-heading">Why use Coolify on a VPS?</h2>



<p class="wp-block-paragraph">Coolify is a deployment platform that runs applications as containers on servers you connect. It helps organise projects, source repositories, builds, domains, variables and services. In the self-hosted approach used here, you install the Coolify dashboard on your VPS and deploy your initial applications to that environment.</p>



<p class="wp-block-paragraph">This is especially useful for developers running client projects, SaaS products, internal tools or an API with background workers. You can choose the application runtime, share available server capacity across suitable workloads and grow the hosting configuration as demand increases.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>What you want</th><th>How this setup helps</th></tr></thead><tbody><tr><td>Git-based releases</td><td>Connect your repository and configure deployments from the chosen branch.</td></tr><tr><td>Flexible application hosting</td><td>Run Next.js, custom Docker images and multi-service Compose definitions.</td></tr><tr><td>Control over your environment</td><td>Choose your Linux configuration, storage, application versions and server region.</td></tr><tr><td>A capacity-based budget</td><td>Select a cloud VPS plan and account for storage, backups and supporting services.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">A normal running container stays available between requests; it is not a per-request serverless function. That makes the setup useful for long-running APIs and workers. Restart policies, health checks and maintenance keep the service operating well.</p>



<p class="wp-block-paragraph">Self-hosted Coolify is available without a Coolify Cloud subscription. Our hosting provides the cloud infrastructure, while you manage the Linux system, Coolify and your application releases. The result is an application platform shaped around your projects.</p>



<h2 id="choose" class="wp-block-heading">Choose the right self-managed cloud VPS</h2>



<p class="wp-block-paragraph">Start with <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">our self-managed cloud VPS packages</a>. They provide full root access, SSD storage and a choice of server regions. You do not need cPanel or DirectAdmin for this workflow; our self-managed plan comes without those control panels, and Coolify supplies the deployment dashboard.</p>



<p class="wp-block-paragraph">Coolify’s <a href="https://coolify.io/docs/start-with-self-hosted" rel="noopener">installation guide</a> lists two CPU cores, 2 GB RAM and 10 GB free disk space as its minimum requirements. Your applications, database, build process and retained images need capacity beyond that minimum. A Next.js production build can use substantially more memory than the running application.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Plan</th><th>RAM</th><th>SSD storage</th><th>Listed monthly USD</th><th>Useful starting role</th></tr></thead><tbody><tr><td>Cloud VPS 2</td><td>8 GB</td><td>100 GB</td><td>$15.51</td><td>A modest application stack with room for builds.</td></tr><tr><td>Cloud VPS 3</td><td>12 GB</td><td>200 GB</td><td>$27.38</td><td>More headroom for active apps and a database.</td></tr><tr><td>Cloud VPS 4</td><td>24 GB</td><td>300 GB</td><td>$38.33</td><td>Larger builds or several busier projects.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">These plan-page prices were checked on 12 October 2026. Your selected region, storage, billing cycle and add-ons determine the order total. Include your domain, backup storage, email delivery and any external services in the full monthly budget.</p>



<p class="wp-block-paragraph">Choose a region near the people using the application and leave storage room for images, build cache, logs and persistent data. Start with a workload-sized plan, measure CPU and memory during both builds and normal traffic, then increase resources when the measurements call for it.</p>



<h2 id="prepare" class="wp-block-heading">1. Prepare your server and deployment plan</h2>



<p class="wp-block-paragraph">Use a fresh VPS with a supported Linux distribution, such as Ubuntu 24.04 LTS. Sign in through SSH, apply system updates and confirm your administrator access works. Keep a working SSH session available while adjusting network rules so you can recover from a configuration error.</p>



<pre class="wp-block-code"><code>apt update
apt upgrade -y
apt install -y curl
free -h
df -h</code></pre>



<p class="wp-block-paragraph">Run these commands as root. They update the OS, install the download tool and show available memory and disk space. Install Coolify only after reviewing the current official prerequisites. Its automated installer can prepare Docker for a fresh environment; an existing customised Docker installation deserves a review before changes.</p>



<p class="wp-block-paragraph">Plan separate hostnames, such as <code>panel.example.com</code> for Coolify and <code>app.example.com</code> for your application. Replace example.com with a domain you control. Decide which Git branch represents production, which data must survive redeployments and where recovery copies will be kept.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Connection</th><th>Port in this guide</th><th>Access approach</th></tr></thead><tbody><tr><td>SSH</td><td>22/TCP, unless changed</td><td>Restrict administrative access to trusted sources.</td></tr><tr><td>Public web traffic</td><td>80/TCP and 443/TCP</td><td>Allow the proxy to serve websites and obtain certificates.</td></tr><tr><td>Bootstrap dashboard</td><td>8000/TCP</td><td>Use a restricted path during initial setup.</td></tr><tr><td>Direct dashboard features</td><td>6001/TCP and 6002/TCP</td><td>Required for direct-IP real-time updates and terminal access.</td></tr><tr><td>Application and database backends</td><td>3000 and 5432 internally</td><td>Route through the proxy; keep database access private.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Follow the <a href="https://coolify.io/docs/core/infrastructure/servers/firewall" rel="noopener">official Coolify firewall guide</a> for your deployment. Docker-published ports need Docker-aware rules; a basic host firewall configuration alone may not control them as you expect. Check both IPv4 and IPv6 exposure, and do not open database ports just to make the application connect.</p>



<h2 id="install" class="wp-block-heading">2. Install Coolify and secure the dashboard</h2>



<p class="wp-block-paragraph">Review the official installer, then run its current command as root on the VPS:</p>



<pre class="wp-block-code"><code>curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash</code></pre>



<p class="wp-block-paragraph">Wait for the success message and dashboard address. Keep initial dashboard access restricted and create the administrator account immediately. The first person reaching an unclaimed installation can register as its administrator, so account creation belongs in the installation process.</p>



<p class="wp-block-paragraph">An SSH tunnel provides a private bootstrap route. From your own computer, use the following command and keep the SSH connection open:</p>



<pre class="wp-block-code"><code>ssh -L 8000:127.0.0.1:8000 \
    -L 6001:127.0.0.1:6001 \
    -L 6002:127.0.0.1:6002 root@YOUR_VPS_IP</code></pre>



<p class="wp-block-paragraph">Replace YOUR_VPS_IP with your server address. Open <code>http://localhost:8000</code> on your computer to reach the dashboard through the encrypted tunnel. The tunnel does not itself block public access, so keep the corresponding public ports restricted using the firewall guidance.</p>



<p class="wp-block-paragraph">Create your administrator, complete onboarding and open <strong>Servers</strong>. Validate the localhost server connection and confirm that the proxy is running. Configure your dashboard hostname with HTTPS before making it your normal access method, and enable supported two-factor authentication.</p>



<p class="wp-block-paragraph">Save a protected copy of <code>/data/coolify/source/.env</code>, including its <code>APP_KEY</code>, outside the live server. The key is needed to decrypt saved instance secrets after recovery. Once the dashboard, real-time connection and terminal work through its HTTPS domain, the firewall guide allows public access to 8000, 6001 and 6002 to be closed.</p>



<h2 id="connect" class="wp-block-heading">3. Connect your Git repository</h2>



<p class="wp-block-paragraph">Create a project and choose an environment, then add a new resource. For a public application repository, use its HTTPS URL and <strong>Check Repository</strong>. For a private repository, configure a supported Git integration or a scoped deploy key with access to the repository you intend to deploy.</p>



<p class="wp-block-paragraph">Select the production branch and the correct base directory. Use <code>/</code> for a project at the repository root. A monorepo needs the appropriate app directory and a build setup that includes its shared packages. Commit the package lockfile so the build installs a reproducible dependency set.</p>



<p class="wp-block-paragraph">Keep application secrets in Coolify’s environment settings, rather than committed .env files. Give staging separate credentials and data. A preview deployment should never accidentally run writes against the production database.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-deployment-flow.webp" alt="Git push deployment workflow with Coolify on a VPS, container health checks and HTTPS traffic" class="wp-image-4958" srcset="https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-deployment-flow.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-deployment-flow-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-deployment-flow-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-deployment-flow-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /><figcaption class="wp-element-caption">A Git event can trigger the build, container startup, health check and HTTPS deployment workflow.</figcaption></figure>



<h2 id="nextjs" class="wp-block-heading">4. Deploy a Next.js application</h2>



<h3 id="nextjs-ready" class="wp-block-heading">Prepare the production scripts</h3>



<p class="wp-block-paragraph">Use the supported Node.js version for your application and verify its production build locally. For a standard npm project, the relevant package.json scripts look like this:</p>



<pre class="wp-block-code"><code>"scripts": {
  "dev": "next dev",
  "build": "next build",
  "start": "next start -H 0.0.0.0 -p 3000"
}</code></pre>



<p class="wp-block-paragraph">Merge these scripts into the existing package.json; this fragment is not a complete replacement file. Run <code>npm ci</code> and <code>npm run build</code> before publishing the repository changes. Production uses the compiled application, not <code>next dev</code>.</p>



<h3 id="nextjs-settings" class="wp-block-heading">Configure the Coolify resource</h3>



<p class="wp-block-paragraph">Following <a href="https://coolify.io/docs/applications/framework-examples/javascript/nextjs" rel="noopener">Coolify’s Next.js example</a>, choose <strong>Nixpacks</strong> as the build pack. In the current configuration interface, this becomes <strong>Build strategy</strong> under <strong>General &gt; Build pipeline</strong>. Select a dynamic web application for a server-rendered project.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Setting</th><th>Standard npm Next.js example</th></tr></thead><tbody><tr><td>Base Directory</td><td>/ for a repository-root project</td></tr><tr><td>Install Command</td><td>npm ci</td></tr><tr><td>Build Command</td><td>npm run build</td></tr><tr><td>Start Command</td><td>npm run start</td></tr><tr><td>Internal listening port / Ports Exposes</td><td>3000</td></tr><tr><td>Site type</td><td>Dynamic / Web application</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Review the detected commands first and override them when your project requires it. Choose a Node version compatible with your installed Next.js release and dependencies. The <a href="https://coolify.io/docs/applications/builds/nixpacks/deploy" rel="noopener">Nixpacks deployment guide</a> explains the repository, command and variable settings.</p>



<h3 id="nextjs-env" class="wp-block-heading">Separate build-time values from server secrets</h3>



<p class="wp-block-paragraph">Add the environment variables your app needs and mark values as available during build only when the build must read them. <code>NEXT_PUBLIC_</code> values are embedded in the browser bundle by Next.js during the build. Changing them requires a new build, and they must never contain passwords, private API keys or database credentials.</p>



<p class="wp-block-paragraph">Server-side values can be read at runtime where your application supports it. A route generated during the build may still need its configuration at build time. Check the actual rendering path to establish which values are needed during the build and at runtime. The <a href="https://nextjs.org/docs/app/guides/self-hosting" rel="noopener">Next.js self-hosting guide</a> covers these distinctions and cache behaviour.</p>



<h3 id="nextjs-health" class="wp-block-heading">Add a small health endpoint and deploy</h3>



<p class="wp-block-paragraph">For an App Router project, create <code>app/api/health/route.ts</code>, or the matching path under src/app:</p>



<pre class="wp-block-code"><code>export const dynamic = 'force-dynamic';

export async function GET() {
  return Response.json({ status: 'ok' });
}</code></pre>



<p class="wp-block-paragraph">Configure the resource’s health check to request <code>/api/health</code> on internal port 3000. This endpoint checks that the web process answers; add separate checks for database-backed workflows. Use a reasonable startup grace period for your app.</p>



<p class="wp-block-paragraph">Select <strong>Deploy</strong> and inspect the deployment logs. Once the container is healthy, test a page, API route, image and login flow through the application URL. Confirm database access and any server-rendered features you use. A static export is suitable only when the project does not need server-only Next.js features.</p>



<h2 id="docker" class="wp-block-heading">5. Deploy Docker apps and multi-service stacks</h2>



<h3 id="dockerfile" class="wp-block-heading">Use a Dockerfile for a portable Next.js image</h3>



<p class="wp-block-paragraph">Choose Dockerfile when the repository should define its own runtime and build stages. For a standalone npm-based Next.js app, add <code>output: 'standalone'</code> to your existing next.config configuration:</p>



<pre class="wp-block-code"><code>const nextConfig = {
  output: 'standalone',
};

export default nextConfig;</code></pre>



<p class="wp-block-paragraph">This example uses an ESM configuration such as next.config.mjs. Preserve your other settings and use the syntax appropriate to your project. Next.js standalone output includes a minimal runtime; copy public files and .next/static into the final image as shown below.</p>



<pre class="wp-block-code"><code>FROM node:24-bookworm-slim AS dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci

FROM node:24-bookworm-slim AS build
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY . .
RUN mkdir -p public &amp;&amp; npm run build

FROM node:24-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
RUN groupadd --gid 1001 appuser     &amp;&amp; useradd --uid 1001 --gid appuser --create-home appuser
COPY --from=build --chown=appuser:appuser /app/public ./public
COPY --from=build --chown=appuser:appuser /app/.next/standalone ./
COPY --from=build --chown=appuser:appuser /app/.next/static ./.next/static
USER appuser
EXPOSE 3000
CMD &#91;"node", "server.js"]</code></pre>



<p class="wp-block-paragraph">Save this as <code>Dockerfile</code> at the repository root. This Dockerfile is designed for package-lock.json, npm scripts, and a standalone app without monorepo-specific tracing requirements. Use the same supported Node major locally and in the container; this example uses Node 24. Keep the base image and application dependencies updated, and include any native system libraries your dependencies need.</p>



<p class="wp-block-paragraph">Add a <code>.dockerignore</code> to keep local dependencies, build output and secrets out of the Docker build context:</p>



<pre class="wp-block-code"><code>node_modules
.next
.git
.env*
npm-debug.log*</code></pre>



<p class="wp-block-paragraph">Commit the files, choose the Dockerfile build strategy in Coolify, select port 3000 and configure the application domain. The image starts <code>server.js</code> directly. If your app uses public build-time variables, explicitly declare and pass the needed non-secret build arguments before <code>npm run build</code>; the Dockerfile above does not inject them automatically.</p>



<h3 id="compose" class="wp-block-heading">Deploy a Next.js and PostgreSQL Compose stack</h3>



<p class="wp-block-paragraph">A Compose definition is useful when the application and its supporting services should be managed together. The following example builds the web app from the Dockerfile above and adds a private PostgreSQL service with persistent storage:</p>



<pre class="wp-block-code"><code>services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
    restart: unless-stopped
    expose:
      - "3000"
    environment:
      NODE_ENV: production
      DATABASE_URL: "postgresql://appuser:${DB_PASSWORD:?}@database:5432/appdb"
    depends_on:
      database:
        condition: service_healthy
    healthcheck:
      test: &#91;"CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then(r=&gt;process.exit(r.ok?0:1)).catch(()=&gt;process.exit(1))"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 60s

  database:
    image: postgres:18
    restart: unless-stopped
    environment:
      POSTGRES_DB: appdb
      POSTGRES_USER: appuser
      POSTGRES_PASSWORD: ${DB_PASSWORD:?}
    volumes:
      - database-data:/var/lib/postgresql
    healthcheck:
      test: &#91;"CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  database-data:</code></pre>



<p class="wp-block-paragraph">Save this as <code>compose.yaml</code> beside the Dockerfile. Add a strong, URL-safe <code>DB_PASSWORD</code> in Coolify—for example, a randomly generated hexadecimal password. If the password contains reserved URL characters, encode them correctly in the database connection string.</p>



<p class="wp-block-paragraph">The database-data mount uses <code>/var/lib/postgresql</code> for the PostgreSQL 18 image shown here. Check the image’s documented data layout before changing major versions. This example gives the web container a connection string; your application still needs a database driver or ORM, its schema, and an explicit migration process to use it.</p>



<p class="wp-block-paragraph">In your project, add a Git-based application and select <strong>Compose</strong> as the build strategy. Set the base directory to <code>/</code> and the Compose location to <code>/compose.yaml</code>, then save and review the parsed definition. In <strong>Domains</strong>, add the web service domain as <code>https://app.example.com:3000</code>.</p>



<p class="wp-block-paragraph">The :3000 suffix in that Coolify setting identifies the container’s internal port. Visitors still use <code>https://app.example.com</code> on the normal HTTPS port. The example has no public database port mapping. Deploy, check each service’s logs and test persistence by writing sample application data and redeploying.</p>



<p class="wp-block-paragraph">Use the <a href="https://coolify.io/docs/applications/builds/docker-compose" rel="noopener">official Compose guide</a> for the exact configuration workflow. Git-based Compose applications support repository events; <strong>Docker Compose Empty</strong> creates a pasted Service without Git events. Keep normal managed routing enabled unless you deliberately maintain all proxy labels and networks yourself.</p>



<p class="wp-block-paragraph">Already building images in CI? Choose a <strong>Docker Image</strong> resource, supply the registry image reference and the internal port, then configure domains and variables. Prefer an immutable release tag or digest for repeatable deployments. An nginx image with internal port 80 is a simple first routing test, as shown in <a href="https://coolify.io/docs/deploy-your-first-app" rel="noopener">Coolify’s first-app guide</a>.</p>



<h2 id="domains" class="wp-block-heading">6. Add your domain and HTTPS</h2>



<p class="wp-block-paragraph">Create an A record for the application hostname pointing to the VPS IPv4 address. Add an AAAA record only when IPv6 is configured and reachable. A stale AAAA record can send some visitors and certificate checks to the wrong destination.</p>



<p class="wp-block-paragraph">Enter the HTTPS domain in the appropriate Coolify resource, confirm the proxy is running and deploy the configuration. Allow HTTP port 80 for the certificate challenge and HTTPS port 443 for the site. Resolve DNS and certificate issues before asking users to sign in.</p>



<p class="wp-block-paragraph">Keep application ports internal and let Coolify’s proxy route web traffic. For a Compose resource, choose the correct receiving service and internal port; for a single app, set Ports Exposes correctly. A process listening only on 127.0.0.1 inside the container cannot normally be reached by a proxy in another container—use 0.0.0.0 inside the application container.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-private-network.webp" alt="Coolify on a VPS routes public HTTPS traffic to Next.js while keeping database storage private" class="wp-image-4959" srcset="https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-private-network.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-private-network-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-private-network-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/10/coolify-private-network-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /><figcaption class="wp-element-caption">Public HTTPS traffic reaches the app through the proxy, while the database and persistent data remain private.</figcaption></figure>



<p class="wp-block-paragraph">If you add Cloudflare, follow <a href="https://blog.aveshost.com/protect-your-website-with-cloudflare/">our website protection guide</a>. Use valid origin certificates and Full (strict) where appropriate. Preserve WebSockets and streaming, and respect Next.js cache headers so authenticated or personalised responses do not enter a public cache.</p>



<h2 id="release" class="wp-block-heading">7. Automate releases and plan rollbacks</h2>



<p class="wp-block-paragraph">First make a manual deployment work. Then enable automatic deployment for the production branch. With a supported Git integration, Coolify’s current documentation uses <strong>Advanced &gt; Deployment &gt; Auto deploy &gt; Deploy on push (webhooks)</strong>. Public-URL and deploy-key sources need the corresponding manual provider webhook setup.</p>



<p class="wp-block-paragraph">Follow the <a href="https://coolify.io/docs/applications/deployments/automatic-deployments" rel="noopener">automatic deployment guide</a>, push a small change and confirm the matching commit appears in deployment history. Keep tests and review in your Git workflow before merging to production. Creating a repository connection alone does not establish every deployment trigger.</p>



<p class="wp-block-paragraph">Retain suitable previous images so a known release remains available. The <a href="https://coolify.io/docs/applications/deployments/rollbacks" rel="noopener">rollback guide</a> explains how to select an older retained image. Review current variables and mounts for compatibility before rolling back, then test the domain, health endpoint and critical user flow.</p>



<p class="wp-block-paragraph">Plan database migrations alongside releases. Prefer backward-compatible schema changes when old and new code may overlap. An image rollback does not undo a database migration or restore uploaded files. Data recovery uses its own tested backup process.</p>



<h2 id="backup" class="wp-block-heading">8. Back up, monitor and grow your stack</h2>



<p class="wp-block-paragraph">Protect three layers: the Coolify instance configuration, your application databases, and persistent files. In Coolify, open <strong>Settings &gt; Backup</strong>, configure a schedule and storage destination, and confirm a successful execution. Preserve the instance APP_KEY separately.</p>



<p class="wp-block-paragraph">The <a href="https://coolify.io/docs/core/backup-and-recovery/instance-backup" rel="noopener">Coolify instance-backup guide</a> covers the dashboard’s own data. Configure database-consistent backups and copies of uploads separately, then keep protected recovery copies outside the live application environment. Add the server backup option you need when ordering our VPS and include it in the budget.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Layer</th><th>What to protect</th><th>What to verify</th></tr></thead><tbody><tr><td>Coolify</td><td>Instance backup and installation encryption key</td><td>Projects, settings and saved secrets recover correctly.</td></tr><tr><td>Database</td><td>Consistent database backups and required roles</td><td>The restored app can read and write representative data.</td></tr><tr><td>Files</td><td>Uploads and other persistent volumes</td><td>Files survive redeployments and open after restoration.</td></tr><tr><td>Release</td><td>Source, build configuration and retained images</td><td>A known application version can be deployed again.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Monitor disk growth, CPU, RAM, health-check failures, HTTPS renewal and backup results. Build images and logs can consume disk even when your application data grows slowly. Configure image cleanup with enough retained releases for your rollback policy; preserve live volumes during routine maintenance.</p>



<p class="wp-block-paragraph">As your projects grow, expand our cloud VPS resources or separate the build workload from the application server. A dedicated build server or CI-built registry image keeps heavy compilation away from live request handling. When you run multiple Next.js instances, plan shared cache behaviour, compatible Server Function encryption keys and consistent deployment versions using the self-hosting documentation.</p>



<h2 id="troubleshoot" class="wp-block-heading">Fix common Coolify deployment problems</h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Symptom</th><th>First checks</th></tr></thead><tbody><tr><td>Build fails</td><td>Read the earliest useful build error; verify lockfile, Node version, base directory and build variables.</td></tr><tr><td>No Available Server or gateway error</td><td>Confirm proxy status, healthy container, listening address and internal port.</td></tr><tr><td>HTTPS certificate fails</td><td>Check A/AAAA records, port 80, port 443 and domain configuration.</td></tr><tr><td>App cannot connect to PostgreSQL</td><td>Use the Compose service name database, correct credentials and internal port 5432.</td></tr><tr><td>Public config stays unchanged</td><td>Rebuild after changing NEXT_PUBLIC_ values.</td></tr><tr><td>Uploaded files disappear</td><td>Mount persistent storage at the path the application actually writes to.</td></tr><tr><td>Build exhausts memory or disk</td><td>Measure build use; increase capacity, clear safe unused images or build externally.</td></tr><tr><td>Git push does not deploy</td><td>Check configured branch, integration or webhook, and the Auto deploy setting.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Fix the configuration that produced the error and redeploy a small, understandable change. Use deployment logs for build failures and runtime logs for a container that starts but cannot serve requests. Avoid opening more public ports as a shortcut for an internal networking problem.</p>



<h2 id="migrate" class="wp-block-heading">Move from Vercel or Heroku with a clear cutover</h2>



<p class="wp-block-paragraph">Before switching, list what your current platform provides: builds, runtime variables, scheduled jobs, database connections, file storage, email, domains and external integrations. Put each item into the VPS deployment plan. Platform-specific SDKs or storage services may need a replacement or can remain connected while you migrate the app.</p>



<ul class="wp-block-list">
<li><strong>Create a staging deployment:</strong> reproduce the production build with separate credentials and a test domain.</li>



<li><strong>Migrate data deliberately:</strong> restore the database and persistent files with version-compatible tools, then verify representative records.</li>



<li><strong>Test real workflows:</strong> login, payments, uploads, emails, scheduled work and background jobs.</li>



<li><strong>Prepare cutover:</strong> reduce DNS TTL ahead of time, plan the final data transfer and stop conflicting writes or duplicate jobs.</li>



<li><strong>Switch and observe:</strong> update DNS, check HTTPS and monitor errors while keeping a defined rollback path.</li>



<li><strong>Retire old resources:</strong> do this after the application and recovery checks pass and you have retained the data you need.</li>
</ul>



<p class="wp-block-paragraph">For a cost comparison, add up the VPS, backups, storage and supporting services, then compare that total with the platform resources you can retire. Several modest applications can share a cloud VPS budget efficiently. Let your actual workloads and operating requirements determine the saving.</p>



<h2 id="start" class="wp-block-heading">Build your deployment platform with us</h2>



<p class="wp-block-paragraph">Coolify on a VPS brings Git-based deployment, container management and HTTPS routing to an environment you control. Start with one Next.js application, add the Docker services it needs and build a repeatable release-and-recovery routine.</p>



<p class="wp-block-paragraph"><a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener"><strong>Explore our self-managed cloud VPS plans</strong></a> to choose your starting capacity, or <a href="https://www.aveshost.com/support" rel="noopener">talk to our team</a> about your server region, storage and backup requirements. Our cloud VPS gives you the root access and flexibility to grow your applications on your terms.</p>



<p class="wp-block-paragraph">Want more uses for your server? Follow <a href="https://blog.aveshost.com/self-host-your-cloud/">our self-hosted cloud guide</a> for files, team documentation and password management. Allocate each new workload the resources and recovery plan it needs.</p>



<h2 id="faq" class="wp-block-heading">Frequently asked questions</h2>


<div id="rank-math-faq" class="rank-math-block">
<div class="rank-math-list ">
<div id="coolify-faq-0" class="rank-math-list-item">
<h3 class="rank-math-question ">Is Coolify a Vercel or Heroku alternative?</h3>
<div class="rank-math-answer ">

<p>Coolify provides a self-hosted deployment workflow for applications, databases and Docker services on servers you choose. It is a useful alternative when you want Git-based deployments and more control over infrastructure. Map any platform-specific functions, storage and integrations before migrating.</p>

</div>
</div>
<div id="coolify-faq-1" class="rank-math-list-item">
<h3 class="rank-math-question ">Can Next.js run on our self-managed cloud VPS?</h3>
<div class="rank-math-answer ">

<p>Yes. Next.js supports production Node.js and Docker deployments. Coolify can build and run the application, route HTTPS traffic and manage deployment settings. Use a production build and start command, then test your application’s server-side features.</p>

</div>
</div>
<div id="coolify-faq-2" class="rank-math-list-item">
<h3 class="rank-math-question ">Do I need cPanel or DirectAdmin for Coolify?</h3>
<div class="rank-math-answer ">

<p>No. Our self-managed cloud VPS comes without those control panels. Coolify supplies the application deployment interface for this guide, while you retain root access and manage the Linux environment.</p>

</div>
</div>
<div id="coolify-faq-3" class="rank-math-list-item">
<h3 class="rank-math-question ">How much RAM should I start with?</h3>
<div class="rank-math-answer ">

<p>Coolify lists a minimum of 2 GB RAM, two CPU cores and 10 GB free disk space for its installation. Applications and builds need additional capacity. Cloud VPS 2 offers 8 GB RAM and 100 GB SSD as a practical starting configuration for a modest stack; choose more capacity for heavier builds, databases or concurrent traffic.</p>

</div>
</div>
<div id="coolify-faq-4" class="rank-math-list-item">
<h3 class="rank-math-question ">Does a Coolify deployment sleep when visitors leave?</h3>
<div class="rank-math-answer ">

<p>A normal running container on your VPS continues running until it is stopped, fails or is affected by a configured lifecycle action. It does not use a per-request serverless startup model. Keep restart policies, health checks, monitoring and sufficient resources in place.</p>

</div>
</div>
<div id="coolify-faq-5" class="rank-math-list-item">
<h3 class="rank-math-question ">Is self-hosted Coolify free?</h3>
<div class="rank-math-answer ">

<p>The self-hosted Coolify software is available without a Coolify Cloud subscription. Your VPS, domain, backups, optional storage and any paid services still have their own costs.</p>

</div>
</div>
<div id="coolify-faq-6" class="rank-math-list-item">
<h3 class="rank-math-question ">Should I open port 3000 publicly for Next.js?</h3>
<div class="rank-math-answer ">

<p>For this design, visitors use the Coolify proxy on HTTPS port 443. Set the application’s internal listening port to 3000 and let the proxy route to it. Avoid public host-port mappings for the app or database unless a specific integration requires them.</p>

</div>
</div>
<div id="coolify-faq-7" class="rank-math-list-item">
<h3 class="rank-math-question ">Will my public environment variables change after restarting?</h3>
<div class="rank-math-answer ">

<p>Next.js NEXT_PUBLIC_ variables are included in the browser bundle during the build. Rebuild after changing them. Keep server secrets out of NEXT_PUBLIC_ variables and configure the correct build-time or runtime scope for each setting.</p>

</div>
</div>
<div id="coolify-faq-8" class="rank-math-list-item">
<h3 class="rank-math-question ">Does rolling back an image restore my database?</h3>
<div class="rank-math-answer ">

<p>No. An image rollback changes application code and image contents. Database migrations, uploaded files and other persistent data need a separate compatible migration or restore plan. Keep suitable images and tested data backups.</p>

</div>
</div>
<div id="coolify-faq-9" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I host several projects on one VPS?</h3>
<div class="rank-math-answer ">

<p>Yes, Coolify can manage multiple resources within the capacity of your plan. Use separate domains, environments, credentials and persistent storage. Monitor CPU, memory and disk use, then expand resources or separate workloads as your applications grow.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/coolify-on-a-vps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
