<?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>Docker &#8211; Aveshost Blog</title>
	<atom:link href="https://blog.aveshost.com/tag/docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.aveshost.com</link>
	<description>Your Blueprint for Online Success</description>
	<lastBuildDate>Mon, 23 Nov 2026 21:23:02 +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>Docker &#8211; Aveshost Blog</title>
	<link>https://blog.aveshost.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Self-Host NocoDB on a VPS with PostgreSQL and HTTPS</title>
		<link>https://blog.aveshost.com/self-host-nocodb-vps-postgresql-https/</link>
					<comments>https://blog.aveshost.com/self-host-nocodb-vps-postgresql-https/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Mon, 23 Nov 2026 21:23:00 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[NocoDB]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[self-hosting]]></category>
		<category><![CDATA[vps hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=6150</guid>

					<description><![CDATA[A complete production guide to self-hosting NocoDB on a Linux VPS using Docker Compose and PostgreSQL—covering NC_DB, NC_AUTH_JWT_SECRET, NC_PUBLIC_URL, Caddy/Nginx HTTPS reverse proxy, and firewall hardening.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Learning how to <strong>self-host NocoDB</strong> on your own Linux VPS gives your team an open-source Airtable alternative without per-seat SaaS fees or row-count limits. NocoDB turns any relational database into a fast collaborative spreadsheet UI with kanban boards, forms, webhooks, and a full REST API.</p>



<p class="wp-block-paragraph">While NocoDB can start quickly on embedded SQLite for local testing, production teams should pair it with <strong>PostgreSQL</strong> for concurrent multi-user writes, reliable backups, and cleaner scaling—especially when deployed behind an HTTPS reverse proxy like Caddy or Nginx.</p>



<p class="wp-block-paragraph">Whether you run <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> with Aveshost, this guide walks through deploying NocoDB with Docker Compose, PostgreSQL 16, automatic Let&#8217;s Encrypt HTTPS, and essential security hardening.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#why-pair-nocodb-with-postgresql-and-a-reverse-proxy">Why Pair NocoDB with PostgreSQL and a Reverse Proxy</a></div><div><a href="#prerequisites-and-environment-variables">Prerequisites and Required NocoDB Environment Variables</a></div><div><a href="#step-1-deploy-nocodb-and-postgresql-with-docker-compose">Step 1: Deploy NocoDB and PostgreSQL 16 with Docker Compose</a></div><div><a href="#step-2-configure-https-with-caddy-or-nginx">Step 2: Add Automatic HTTPS with Caddy (or Nginx + Certbot)</a></div><div><a href="#step-3-backups-and-production-hardening">Step 3: Back Ups, Firewall Rules, and Production Checklist</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="why-pair-nocodb-with-postgresql-and-a-reverse-proxy" class="wp-block-heading">Why Pair NocoDB with PostgreSQL and a Reverse Proxy</h2>



<p class="wp-block-paragraph">Out of the box, NocoDB stores metadata in SQLite when no external database is configured. For solo experiments that works fine, but as soon as multiple teammates edit views, trigger webhooks, or upload attachments simultaneously, PostgreSQL eliminates write-lock contention (see our <a href="https://blog.aveshost.com/sqlite-vs-postgresql-vps/">SQLite vs PostgreSQL on a VPS comparison</a>).</p>



<p class="wp-block-paragraph">Separating storage into two layers also makes upgrades safer: PostgreSQL holds your workspace metadata, table schemas, and user permissions, while the <code>nocodb_data</code> Docker volume mounted at <code>/usr/app/data</code> stores uploaded file attachments and runtime state. You can recreate or upgrade the NocoDB container anytime without touching your relational data.</p>



<p class="wp-block-paragraph">Binding NocoDB strictly to <code>127.0.0.1:8080</code> and placing Caddy or Nginx in front of it keeps port <code>8080</code> and PostgreSQL port <code>5432</code> completely off the public internet while terminating TLS on port <code>443</code>.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-architecture.webp" alt="Architecture diagram showing self-hosted NocoDB behind Caddy or Nginx HTTPS proxy connected to PostgreSQL 16" class="wp-image-6148" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-architecture.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-architecture-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-architecture-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-architecture-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="prerequisites-and-environment-variables" class="wp-block-heading">Prerequisites and Required NocoDB Environment Variables</h2>



<p class="wp-block-paragraph">Prepare an Ubuntu 22.04 or 24.04 VPS (at least 2 GB RAM recommended for PostgreSQL + NocoDB) with Docker Engine and Docker Compose installed, and point an A record (such as <code>nocodb.yourdomain.com</code>) to your server&#8217;s public IPv4 address. If you are setting up a fresh server, check our <a href="https://blog.aveshost.com/deploy-fastapi-ubuntu-vps/">Ubuntu VPS setup guide</a> for initial SSH and UFW steps.</p>



<p class="wp-block-paragraph">According to the <a href="https://docs.nocodb.com/getting-started/installation/" rel="noopener">official NocoDB installation documentation</a>, three environment variables matter most for a stable PostgreSQL + HTTPS deployment:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Environment Variable</th><th>Purpose</th><th>Production Example / Note</th></tr></thead><tbody><tr><td>NC_DB</td><td>PostgreSQL connection string for NocoDB metadata</td><td>pg://postgres:5432?u=nocodb&amp;p=STRONG_PASS&amp;d=nocodb</td></tr><tr><td>NC_AUTH_JWT_SECRET</td><td>Signs user session and API JWT tokens</td><td>Generate a long random 32+ character secret</td></tr><tr><td>NC_PUBLIC_URL</td><td>Canonical HTTPS URL behind reverse proxy</td><td>https://nocodb.yourdomain.com (fixes webhooks &amp; links)</td></tr></tbody></table></figure>



<h2 id="step-1-deploy-nocodb-and-postgresql-with-docker-compose" class="wp-block-heading">Step 1: Deploy NocoDB and PostgreSQL 16 with Docker Compose</h2>



<p class="wp-block-paragraph">Create a project directory such as <code>/opt/nocodb</code> and save the <code>docker-compose.yml</code> file below. Two details make this production-ready: first, binding NocoDB&#8217;s port to <code>127.0.0.1:8080:8080</code> instead of <code>8080:8080</code> prevents Docker from bypassing UFW on the public interface (<a href="https://blog.aveshost.com/docker-ufw-unexpected-ports/">Docker and UFW port safety guide</a>).</p>



<p class="wp-block-paragraph">Second, adding a <code>pg_isready</code> healthcheck on the PostgreSQL service with <code>condition: service_healthy</code> guarantees NocoDB does not crash on boot while PostgreSQL is still initializing its data directory. Also make sure <code>NC_AUTH_JWT_SECRET</code> is set explicitly in your environment or <code>.env</code> file rather than left blank; otherwise, container restarts invalidate active user sessions.</p>



<p class="wp-block-paragraph">Start the stack with <code>sudo docker compose up -d</code> and check <code>sudo docker compose logs -f nocodb</code> until it reports listening on port <code>8080</code>. You can verify the container health locally with <code>curl -I http://127.0.0.1:8080/api/v1/health</code> before wiring up your domain.</p>



<pre class="wp-block-code"><code>services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: nocodb
      POSTGRES_USER: nocodb
      POSTGRES_PASSWORD: CHANGE_ME_STRONG_DB_PASSWORD
    volumes:
      - pg_data:/var/lib/postgresql/data
    healthcheck:
      test: &#91;"CMD-SHELL", "pg_isready -U nocodb -d nocodb"]
      interval: 10s
      timeout: 5s
      retries: 10

  nocodb:
    image: nocodb/nocodb:latest
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      NC_DB: "pg://postgres:5432?u=nocodb&amp;p=CHANGE_ME_STRONG_DB_PASSWORD&amp;d=nocodb"
      NC_AUTH_JWT_SECRET: "REPLACE_WITH_LONG_RANDOM_SECRET"
      NC_PUBLIC_URL: "https://nocodb.yourdomain.com"
    volumes:
      - nocodb_data:/usr/app/data

volumes:
  pg_data:
  nocodb_data:</code></pre>



<pre class="wp-block-code"><code>sudo docker compose up -d
sudo docker compose logs -f nocodb</code></pre>



<h2 id="step-2-configure-https-with-caddy-or-nginx" class="wp-block-heading">Step 2: Add Automatic HTTPS with Caddy (or Nginx + Certbot)</h2>



<p class="wp-block-paragraph">With NocoDB listening on <code>127.0.0.1:8080</code>, configure a reverse proxy to terminate HTTPS on port <code>443</code>. <strong>Caddy</strong> is the fastest option because it obtains and renews Let&#8217;s Encrypt TLS certificates automatically with a five-line <code>Caddyfile</code>.</p>



<p class="wp-block-paragraph">If you already run Nginx on your VPS, create a standard server block with <code>proxy_pass http://127.0.0.1:8080</code> (including WebSocket <code>Upgrade</code> and <code>X-Forwarded-Proto</code> headers) and run <code>sudo certbot --nginx -d nocodb.yourdomain.com</code>.</p>



<p class="wp-block-paragraph">Open <code>https://nocodb.yourdomain.com</code> in your browser to create your first Super Admin account. Because <code>NC_PUBLIC_URL</code> matches your domain, shared views, invite links, and API docs will all resolve cleanly over HTTPS.</p>



<pre class="wp-block-code"><code># /etc/caddy/Caddyfile
nocodb.yourdomain.com {
    reverse_proxy 127.0.0.1:8080
}</code></pre>



<pre class="wp-block-code"><code># Optional UFW firewall check
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw status</code></pre>



<h2 id="step-3-backups-and-production-hardening" class="wp-block-heading">Step 3: Back Ups, Firewall Rules, and Production Checklist</h2>



<p class="wp-block-paragraph">To keep your NocoDB instance resilient on <a href="https://www.aveshost.com/" rel="noopener">Aveshost</a> self-managed VPS hosting or fully managed VPS hosting, keep only ports <code>80</code> and <code>443</code> open publicly in UFW. If you only want internal team access—or want to lock down SSH—pair your VPS with <a href="https://blog.aveshost.com/secure-vps-access-tailscale-without-public-ports/">Tailscale private VPS access</a>.</p>



<p class="wp-block-paragraph">Never expose PostgreSQL port <code>5432</code> in your Compose file or firewall; keeping PostgreSQL on the internal Docker bridge network ensures only the NocoDB container can query it. When applying container updates later, pull the new image and recreate only the application service with <code>sudo docker compose pull &amp;&amp; sudo docker compose up -d</code>.</p>



<p class="wp-block-paragraph">Finally, schedule automated daily <code>pg_dump</code> exports of your PostgreSQL database alongside backups of the <code>nocodb_data</code> volume (<code>/usr/app/data</code>) so both structured tables and uploaded attachments can be restored cleanly. Test restoring a dump to a staging container periodically to confirm your backup files are complete.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-production-checklist.webp" alt="Six-step production checklist for self-hosting NocoDB with PostgreSQL and HTTPS on a VPS" class="wp-image-6149" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-production-checklist.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-production-checklist-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-production-checklist-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/nocodb-vps-production-checklist-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<pre class="wp-block-code"><code># Daily PostgreSQL dump
sudo docker compose exec -T postgres pg_dump -U nocodb nocodb &gt; /opt/nocodb/nocodb-backup.sql</code></pre>



<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-ce89c46a56d646bda42c3f19ac2e6ed0" class="rank-math-list-item">
<h3 class="rank-math-question ">How much RAM does a self-hosted NocoDB + PostgreSQL VPS need?</h3>
<div class="rank-math-answer ">

<p>While NocoDB can boot on 1 GB RAM for light testing, 2 GB to 4 GB RAM is recommended on an Ubuntu VPS when running PostgreSQL 16, NocoDB, and a reverse proxy together in production.</p>

</div>
</div>
<div id="faq-question-78d5f776f32e4780ade24e15c0a12250" class="rank-math-list-item">
<h3 class="rank-math-question ">Why should I set NC_PUBLIC_URL when running NocoDB behind Caddy or Nginx?</h3>
<div class="rank-math-answer ">

<p>Without NC_PUBLIC_URL set to your full https:// domain, NocoDB may generate localhost or HTTP links for shared views, password resets, OAuth callbacks, and webhook payloads behind a reverse proxy.</p>

</div>
</div>
<div id="faq-question-7b593bcd9cc84ee38faa6ca60d7af8ba" class="rank-math-list-item">
<h3 class="rank-math-question ">Why bind NocoDB to 127.0.0.1:8080:8080 instead of 8080:8080 in Docker Compose?</h3>
<div class="rank-math-answer ">

<p>Binding to 127.0.0.1 ensures only your local Caddy or Nginx reverse proxy can reach NocoDB, preventing Docker&#8217;s iptables rules from exposing unencrypted port 8080 to the public internet.</p>

</div>
</div>
<div id="faq-question-ac62d359a6ac45ffbcf2ffb1a18e6293" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I migrate NocoDB from SQLite to PostgreSQL later?</h3>
<div class="rank-math-answer ">

<p>Starting directly on PostgreSQL 16 is much simpler for production. If you already run SQLite, NocoDB supports connecting external PostgreSQL data sources or exporting/migrating bases, though starting with NC_DB pointed at PostgreSQL avoids manual metadata migration.</p>

</div>
</div>
<div id="faq-question-e583ba808e09421fb6dcf3717dc210cf" class="rank-math-list-item">
<h3 class="rank-math-question ">Which reverse proxy is easier for NocoDB HTTPS: Caddy or Nginx?</h3>
<div class="rank-math-answer ">

<p>Caddy is simpler for single-app VPS setups because it provisions and renews Let&#8217;s Encrypt TLS certificates automatically with minimal config. Nginx + Certbot is ideal if you already host multiple sites on the same VPS.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/self-host-nocodb-vps-postgresql-https/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Self-Host RustDesk on an Ubuntu VPS for Remote Desktop Access</title>
		<link>https://blog.aveshost.com/self-host-rustdesk-ubuntu-vps/</link>
					<comments>https://blog.aveshost.com/self-host-rustdesk-ubuntu-vps/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Sat, 21 Nov 2026 18:49:44 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Remote Desktop]]></category>
		<category><![CDATA[RustDesk]]></category>
		<category><![CDATA[Ubuntu VPS]]></category>
		<category><![CDATA[vps hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=6121</guid>

					<description><![CDATA[A complete step-by-step tutorial on how to self-host RustDesk on an Ubuntu VPS with Docker Compose—covering hbbs and hbbr setup, UFW firewall ports, Ed25519 key enforcement, and desktop/mobile client configuration.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Learning how to <strong>self-host RustDesk</strong> on your own Ubuntu VPS gives you fast, private remote desktop access without recurring TeamViewer or AnyDesk licensing limits. Instead of routing your support sessions through crowded public relay servers, your own server handles client discovery and encrypted relay traffic exclusively for your team.</p>



<p class="wp-block-paragraph">The open-source RustDesk server stack runs cleanly in two lightweight Docker containers—<code>hbbs</code> (the ID and rendezvous server) and <code>hbbr</code> (the relay server)—and easily runs alongside other services on a 1 GB or 2 GB RAM <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> plan from Aveshost.</p>



<p class="wp-block-paragraph">In this guide, you will deploy RustDesk with Docker Compose on Ubuntu, open the exact required UFW ports, lock down your server with <code>ENCRYPTED_ONLY=1</code> and an Ed25519 public key, and connect your desktop and mobile clients.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#how-self-hosted-rustdesk-architecture-works">How Self-Hosted RustDesk Works (hbbs vs hbbr)</a></div><div><a href="#prerequisites-and-required-firewall-ports">Prerequisites and Required Ubuntu UFW Firewall Ports</a></div><div><a href="#deploy-rustdesk-server-with-docker-compose">Step 1: Deploy RustDesk Server with Docker Compose</a></div><div><a href="#configure-rustdesk-desktop-and-mobile-clients">Step 2: Connect RustDesk Desktop and Mobile Clients</a></div><div><a href="#security-hardening-and-vps-maintenance">Step 3: Harden Your RustDesk VPS and Prevent Common Issues</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="how-self-hosted-rustdesk-architecture-works" class="wp-block-heading">How Self-Hosted RustDesk Works (hbbs vs hbbr)</h2>



<p class="wp-block-paragraph">When you <strong>self-host RustDesk</strong>, your Ubuntu VPS acts as the private broker between your controller device and your remote computers. According to the <a href="https://rustdesk.com/docs/en/self-host/" rel="noopener">official RustDesk self-hosting documentation</a>, the server splits into two complementary services:</p>



<p class="wp-block-paragraph">• <strong>hbbs (ID / Rendezvous Server):</strong> Registers client IDs, checks NAT types, and coordinates direct peer-to-peer (P2P) UDP hole-punching so two machines on friendly networks can talk directly.</p>



<p class="wp-block-paragraph">• <strong>hbbr (Relay Server):</strong> Steps in automatically whenever strict corporate firewalls or symmetric NAT block direct P2P connections, relaying end-to-end encrypted traffic over TCP port <code>21117</code>.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1536" height="1024" src="https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-architecture.webp" alt="Architecture diagram showing how self-hosted RustDesk hbbs and hbbr containers work on an Ubuntu VPS" class="wp-image-6119" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-architecture.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-architecture-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-architecture-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-architecture-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="prerequisites-and-required-firewall-ports" class="wp-block-heading">Prerequisites and Required Ubuntu UFW Firewall Ports</h2>



<p class="wp-block-paragraph">Before installing the containers, prepare an Ubuntu 22.04 or 24.04 VPS with Docker Engine, Docker Compose, and a non-root sudo user. If you have not hardened your server yet, our <a href="https://blog.aveshost.com/deploy-fastapi-ubuntu-vps/">Ubuntu VPS deployment guide</a> walks through initial SSH and firewall setup.</p>



<p class="wp-block-paragraph">RustDesk requires three core ports (including both TCP and UDP on port <code>21116</code>) and two optional WebSocket ports that you should keep closed unless you specifically serve the browser web client behind an HTTPS reverse proxy:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Port &amp; Protocol</th><th>Service</th><th>Purpose</th><th>Should You Open It?</th></tr></thead><tbody><tr><td>21115 / TCP</td><td>hbbs</td><td>NAT type test</td><td>Yes (required)</td></tr><tr><td>21116 / TCP &amp; UDP</td><td>hbbs</td><td>ID registration, heartbeat (UDP), and TCP hole-punching</td><td>Yes (required — both TCP and UDP)</td></tr><tr><td>21117 / TCP</td><td>hbbr</td><td>Encrypted relay fallback service</td><td>Yes (required)</td></tr><tr><td>21118–21119 / TCP</td><td>hbbs / hbbr</td><td>WebSocket support for browser Web Client</td><td>No (leave closed unless proxied via HTTPS)</td></tr></tbody></table></figure>



<pre class="wp-block-code"><code># Open required RustDesk ports in UFW on Ubuntu
sudo ufw allow 21115/tcp
sudo ufw allow 21116/tcp
sudo ufw allow 21116/udp
sudo ufw allow 21117/tcp
sudo ufw reload</code></pre>



<h2 id="deploy-rustdesk-server-with-docker-compose" class="wp-block-heading">Step 1: Deploy RustDesk Server with Docker Compose</h2>



<p class="wp-block-paragraph">Create a dedicated project directory such as <code>/opt/rustdesk</code> on your Ubuntu VPS and configure <code>docker-compose.yml</code>. Notice two critical production settings: passing <code>-r your-vps-ip-or-domain:21117</code> to <code>hbbs</code> so clients know your relay endpoint, and setting <code>ENCRYPTED_ONLY=1</code> on both containers.</p>



<p class="wp-block-paragraph">Enabling <code>ENCRYPTED_ONLY=1</code> tells <code>hbbs</code> and <code>hbbr</code> to reject any unencrypted client connection and enforce your Ed25519 keypair. Without this variable, anyone who discovers your VPS IP could attempt to use your relay unauthenticated.</p>



<p class="wp-block-paragraph">Once you run <code>docker compose up -d</code>, RustDesk automatically generates <code>id_ed25519</code> (private key) and <code>id_ed25519.pub</code> (public key) inside <code>./data</code>. Print your public key with <code>cat ./data/id_ed25519.pub</code> and keep it ready for your client apps.</p>



<pre class="wp-block-code"><code># /opt/rustdesk/docker-compose.yml
services:
  hbbs:
    container_name: hbbs
    image: rustdesk/rustdesk-server:latest
    command: hbbs -r your-vps-ip-or-domain:21117
    volumes:
      - ./data:/root
    environment:
      - ENCRYPTED_ONLY=1
    ports:
      - "21115:21115"
      - "21116:21116"
      - "21116:21116/udp"
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: hbbr
    image: rustdesk/rustdesk-server:latest
    command: hbbr
    volumes:
      - ./data:/root
    environment:
      - ENCRYPTED_ONLY=1
    ports:
      - "21117:21117"
    restart: unless-stopped</code></pre>



<pre class="wp-block-code"><code># Start RustDesk server containers and read your public key
mkdir -p /opt/rustdesk &amp;&amp; cd /opt/rustdesk
sudo docker compose up -d
cat ./data/id_ed25519.pub</code></pre>



<h2 id="configure-rustdesk-desktop-and-mobile-clients" class="wp-block-heading">Step 2: Connect RustDesk Desktop and Mobile Clients</h2>



<p class="wp-block-paragraph">With both containers running, configure every RustDesk client (Windows, macOS, Linux, Android, or iOS) to point at your private Ubuntu VPS instead of the public RustDesk servers:</p>



<p class="wp-block-paragraph">• <strong>1. Open Network Settings:</strong> Launch RustDesk on your device, click the three-dot menu next to your ID, and open <strong>Settings → Network</strong> (click <strong>Unlock network settings</strong> if prompted).</p>



<p class="wp-block-paragraph">• <strong>2. Enter ID and Relay Server:</strong> Set <strong>ID Server</strong> to your VPS public IP or domain name (for example, <code>remote.yourdomain.com</code>). You can also enter the same host in <strong>Relay Server</strong>.</p>



<p class="wp-block-paragraph">• <strong>3. Paste Your Public Key:</strong> Copy the exact string from <code>cat ./data/id_ed25519.pub</code> (with no extra spaces or trailing line breaks) into the <strong>Key</strong> field and click <strong>Apply</strong>.</p>



<p class="wp-block-paragraph">• <strong>4. Verify Status:</strong> Return to the main RustDesk window. The status indicator at the bottom should turn green and read <strong>Ready</strong>. Repeat this setup on any remote computer you want to access.</p>



<h2 id="security-hardening-and-vps-maintenance" class="wp-block-heading">Step 3: Harden Your RustDesk VPS and Prevent Common Issues</h2>



<p class="wp-block-paragraph">Because Docker modifies <code>iptables</code> directly when publishing container ports, always double-check how your firewall interacts with published ports—see our guide on <a href="https://blog.aveshost.com/docker-ufw-unexpected-ports/">stopping Docker containers from exposing unexpected ports with UFW</a>. Also monitor container logs and image layers periodically so old images do not fill your VPS disk (<a href="https://blog.aveshost.com/docker-disk-space-full/">how to find what is using Docker disk space</a>).</p>



<p class="wp-block-paragraph">Follow the six-step security checklist below to keep your self-hosted RustDesk server locked down on <a href="https://www.aveshost.com/" rel="noopener">Aveshost</a> self-managed VPS hosting or fully managed VPS hosting:</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/11/rustdesk-vps-security-checklist.webp" alt="Six-step security checklist for self-hosting RustDesk on an Ubuntu VPS" class="wp-image-6120" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-security-checklist.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-security-checklist-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-security-checklist-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/rustdesk-vps-security-checklist-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></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-ca7b2b9573f146dea9a99819bc635bc4" class="rank-math-list-item">
<h3 class="rank-math-question ">How much RAM and CPU does a self-hosted RustDesk server need?</h3>
<div class="rank-math-answer ">

<p>RustDesk&#8217;s hbbs and hbbr containers are written in Rust and use very little memory—typically under 100 MB of RAM at idle. A 1 vCPU, 1 GB RAM Ubuntu VPS comfortably handles dozens of concurrent remote desktop sessions, while 2 GB RAM gives extra headroom if you run other tools.</p>

</div>
</div>
<div id="faq-question-3f95ec91d1f648658e91ea393c9c6bd7" class="rank-math-list-item">
<h3 class="rank-math-question ">Why does RustDesk say &#x27;Not ready. Please check your connection&#x27; after setup?</h3>
<div class="rank-math-answer ">

<p>This usually happens when port 21116/udp is blocked in UFW or your cloud security group, when the Key field in the client does not match ./data/id_ed25519.pub, or when ENCRYPTED_ONLY=1 rejects a client missing the public key.</p>

</div>
</div>
<div id="faq-question-5fcdb129f14a4ac1afa1cd62b4aae803" class="rank-math-list-item">
<h3 class="rank-math-question ">Do I need a domain name to self-host RustDesk on a VPS?</h3>
<div class="rank-math-answer ">

<p>No. You can enter your Ubuntu VPS public IPv4 address directly in the hbbs -r flag and in your RustDesk client ID Server field. However, pointing an A record such as remote.yourdomain.com to your VPS makes it easier to migrate servers later without reconfiguring every client.</p>

</div>
</div>
<div id="faq-question-b85c5a1e13414ac0abfa9a1fc8ea3e83" class="rank-math-list-item">
<h3 class="rank-math-question ">Should I open ports 21118 and 21119 in UFW?</h3>
<div class="rank-math-answer ">

<p>Only if you plan to host the RustDesk Web Client. Per the official RustDesk documentation, keep ports 21118 and 21119 closed unless you place them behind a properly configured HTTPS/WSS reverse proxy.</p>

</div>
</div>
<div id="faq-question-cdaf46918888454eaf1546178f2b9499" class="rank-math-list-item">
<h3 class="rank-math-question ">What happens if I lose my id_ed25519 key files?</h3>
<div class="rank-math-answer ">

<p>If ./data/id_ed25519 and id_ed25519.pub are deleted, RustDesk generates a brand-new keypair on container restart and existing clients will fail key verification until updated. Back up the ./data directory right after your first deployment.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/self-host-rustdesk-ubuntu-vps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Docker and UFW: How to Stop Containers Exposing Unexpected Ports</title>
		<link>https://blog.aveshost.com/docker-ufw-unexpected-ports/</link>
					<comments>https://blog.aveshost.com/docker-ufw-unexpected-ports/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Thu, 19 Nov 2026 17:44:55 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[Linux VPS]]></category>
		<category><![CDATA[UFW]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=6013</guid>

					<description><![CDATA[Learn why Docker-published ports can bypass UFW and how to reduce exposure with private networks, loopback bindings, backend-aware rules and external testing.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Docker and UFW</strong> need separate attention on a Linux VPS. A container published with <code>8080:80</code> can remain reachable even when UFW denies incoming port 8080. The most reliable first fix is to remove unnecessary host port mappings, bind host-only services to loopback, and filter any deliberately public Docker traffic at the correct layer.</p>



<p class="wp-block-paragraph">Our recommended workflow is to inventory exposure, choose who should reach each service, change its mapping, and test from outside the VPS. A green “active” status in UFW is not proof that a container port is private.</p>



<p class="wp-block-paragraph">This guide covers rootful Docker Engine with bridge networking on an Ubuntu VPS. Host networking, Swarm ingress, rootless Docker and routed container networks require their own review. Before changing firewall rules, keep your current SSH session open, confirm recovery-console access and preserve your existing configuration.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#why-bypass">1. Why Docker-published ports can bypass UFW</a></div><div><a href="#audit">2. Audit mappings, network mode and firewall backend</a></div><div><a href="#choose-access">3. Decide which services actually need a public port</a></div><div><a href="#loopback">4. Bind host-only services to loopback</a></div><div><a href="#apply">5. Apply Compose changes without losing persistent data</a></div><div><a href="#iptables">6. Use DOCKER-USER for deliberate iptables filtering</a></div><div><a href="#nftables">7. Treat native nftables and host networking separately</a></div><div><a href="#verify">8. Verify Docker and UFW from outside the VPS</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="why-bypass" class="wp-block-heading">1. Why Docker-published ports can bypass UFW</h2>



<p class="wp-block-paragraph">UFW commonly controls traffic addressed to services on the host through the INPUT path. Docker’s bridge port publishing uses destination NAT and forwarding rules. Container-bound packets can therefore take a different path before the usual host-service rules apply. Docker documents this <a href="https://docs.docker.com/engine/network/packet-filtering-firewalls/" rel="noopener">UFW incompatibility</a>.</p>



<p class="wp-block-paragraph">For example, a host-installed SSH service on port 22 and a container mapped from host port 8080 to container port 80 need different checks. Adding <code>ufw deny 8080/tcp</code> does not establish that the Docker mapping is blocked.</p>



<p class="wp-block-paragraph">Keep UFW for appropriate host-service policy. Review Docker exposure alongside it. Do not set Docker’s <code>iptables</code> or <code>ip6tables</code> options to false as a shortcut: this can break masquerading and container networking without delivering the intended protection.</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/11/docker-ufw-traffic-paths.webp" alt="Docker and UFW traffic paths comparing host INPUT filtering with Docker DNAT and FORWARD traffic to a container." class="wp-image-6015" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/docker-ufw-traffic-paths.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-ufw-traffic-paths-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-ufw-traffic-paths-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-ufw-traffic-paths-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="audit" class="wp-block-heading">2. Audit mappings, network mode and firewall backend</h2>



<p class="wp-block-paragraph">Start with read-only checks. Replace <code>web</code> with the container you are investigating:</p>



<pre class="wp-block-code"><code>sudo docker version
sudo docker ps --format 'table {{.Names}}	{{.Ports}}'
sudo docker port web
sudo docker inspect web --format '{{.HostConfig.NetworkMode}}'
sudo ufw status verbose
ip -br address</code></pre>



<p class="wp-block-paragraph">In <code>docker ps</code>, <code>0.0.0.0:8080-&gt;80/tcp</code> indicates an IPv4 wildcard mapping; <code>[::]:8080-&gt;80/tcp</code> indicates an IPv6 wildcard mapping. A plain <code>80/tcp</code> entry is an exposed container port, not by itself a host publication. The <a href="https://docs.docker.com/reference/cli/docker/container/port/" rel="noopener">docker port command</a> lists actual mappings.</p>



<p class="wp-block-paragraph">Check the effective Compose configuration with <code>sudo docker compose config</code> from the project directory. Include the same override files and environment inputs used during deployment. Its rendered output can contain secrets; inspect it locally and redact it before sharing.</p>



<p class="wp-block-paragraph">For backend diagnosis, inspect <code>sudo systemctl cat docker</code> and, if present, <code>/etc/docker/daemon.json</code>. Then inspect <code>sudo iptables -S DOCKER-USER</code> and, where available, <code>sudo nft list ruleset</code>. Do not infer Docker’s native backend solely from <code>iptables --version</code>: an <code>nf_tables</code> version string can mean the iptables compatibility frontend.</p>



<h2 id="choose-access" class="wp-block-heading">3. Decide which services actually need a public port</h2>



<p class="wp-block-paragraph">Build a short access list before editing anything. A website, its database and its administration screen rarely need identical reachability. Record the owner and intended clients for every published port.</p>



<p class="wp-block-paragraph">For container-to-container traffic, attach the services to an appropriate shared Docker network and use service names, such as <code>db:5432</code>. Remove the database’s host <code>ports:</code> mapping when no external client needs it. Compose networking provides service discovery; <code>expose:</code> is not a firewall or a host-port publication.</p>



<p class="wp-block-paragraph">Limit shared-network membership too: removing a host mapping does not prevent peer containers on that network from reaching the service. Docker’s <a href="https://docs.docker.com/reference/compose-file/networks/" rel="noopener">Compose networking reference</a> describes network membership.</p>



<p class="wp-block-paragraph">For remote maintenance, prefer an authenticated VPN or SSH tunnel instead of a public database or dashboard port. A deliberately public service still needs authentication, updates and application-level access controls.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Client</th><th>Suitable arrangement</th><th>Public host mapping</th></tr></thead><tbody><tr><td>Another container</td><td>Shared network; service-name connection</td><td>Usually none</td></tr><tr><td>Reverse proxy installed on host</td><td>Backend bound to loopback</td><td>Backend stays local</td></tr><tr><td>Visitors to a website</td><td>Public proxy with private backends</td><td>Only required web ports</td></tr><tr><td>Administrator</td><td>VPN or SSH tunnel</td><td>Avoid direct public admin port</td></tr></tbody></table></figure>



<h2 id="loopback" class="wp-block-heading">4. Bind host-only services to loopback</h2>



<p class="wp-block-paragraph">If a reverse proxy installed directly on the VPS needs to reach a container, change the mapping from <code>8080:80</code> to <code>127.0.0.1:8080:80</code>. Merge this fragment into the existing service, preserving its image, volumes, environment and other settings:</p>



<pre class="wp-block-code"><code>services:
  app:
    ports:
      - "127.0.0.1:8080:80"</code></pre>



<p class="wp-block-paragraph">Point the host proxy at <code>http://127.0.0.1:8080</code>. The application inside the container normally still listens on its container interface, often <code>0.0.0.0:80</code>. Binding the host side and binding inside the container are different settings.</p>



<p class="wp-block-paragraph">If the reverse proxy is also a container, its <code>127.0.0.1</code> refers to itself. Put proxy and application on a suitable shared network, use an upstream such as <code>app:80</code>, and remove the application’s host mapping.</p>



<p class="wp-block-paragraph">Without a host address, published mappings normally bind all host addresses. Review IPv6 mappings separately. Docker also warns that releases older than 28.0.0 have a same-L2 reachability issue for localhost-published ports; upgrade before relying on that boundary. See <a href="https://docs.docker.com/engine/network/port-publishing/" rel="noopener">Docker’s port-publishing documentation</a>.</p>



<p class="wp-block-paragraph">For a temporary SSH tunnel, run this on your workstation, replacing the username and VPS address:</p>



<pre class="wp-block-code"><code>ssh -N -L 127.0.0.1:18080:127.0.0.1:8080 user@VPS_ADDRESS</code></pre>



<p class="wp-block-paragraph">Then visit <code>http://127.0.0.1:18080</code> locally. The SSH account must be permitted to forward connections. This example follows the <a href="https://man.openbsd.org/ssh#L" rel="noopener">OpenSSH local-forwarding syntax</a>; the tunnel ends when that SSH connection ends.</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/11/docker-minimal-port-exposure.webp" alt="Four Docker access patterns: private container networks, host loopback, public web proxy and VPN or SSH administration." class="wp-image-6016" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/docker-minimal-port-exposure.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-minimal-port-exposure-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-minimal-port-exposure-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-minimal-port-exposure-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="apply" class="wp-block-heading">5. Apply Compose changes without losing persistent data</h2>



<p class="wp-block-paragraph">Before recreation, verify backups and persistent mounts. Files stored only in a container’s writable layer can be lost when it is replaced. Arrange a maintenance window for services that cannot tolerate interruption.</p>



<p class="wp-block-paragraph">Check the merged configuration for both the intended loopback mapping and any old wildcard mapping. Compose override files or a deployment platform can reintroduce ports. Edit the configuration that actually owns the deployment.</p>



<pre class="wp-block-code"><code>sudo docker compose config
sudo docker compose up -d --no-deps app
sudo docker compose ps
sudo docker port YOUR_APP_CONTAINER</code></pre>



<p class="wp-block-paragraph">Replace the service and container names with your own. <code>compose up</code> recreates a service when its configuration changes; a plain restart does not apply a changed port mapping. See the <a href="https://docs.docker.com/reference/cli/docker/compose/up/" rel="noopener">Compose up reference</a>.</p>



<p class="wp-block-paragraph">Check the website, health endpoint and database connection immediately. If rollback is needed, restore the reviewed configuration and redeploy that service. Do not use <code>docker compose down -v</code> for a port change; deleting volumes is unnecessary and can destroy persistent data.</p>



<h2 id="iptables" class="wp-block-heading">6. Use DOCKER-USER for deliberate iptables filtering</h2>



<p class="wp-block-paragraph">For Docker’s iptables backend, user restrictions belong in <code>DOCKER-USER</code>, before Docker’s forwarding decisions. DNAT has already happened there, so matching the original published host port requires conntrack. Its use can add processing overhead. Follow <a href="https://docs.docker.com/engine/network/firewall-iptables/" rel="noopener">Docker’s iptables guidance</a>.</p>



<p class="wp-block-paragraph">Here is a narrow IPv4/TCP example for a standard VPS that is not routing unrelated networks. It drops traffic entering <code>ens3</code> to original destination port 8080 unless its source is <code>198.51.100.10</code>. Replace the interface and documentation-only source address first; it covers that port on all destination addresses reached through the interface:</p>



<pre class="wp-block-code"><code>sudo iptables -I DOCKER-USER 1 -i ens3 -p tcp ! -s 198.51.100.10/32 -m conntrack --ctdir ORIGINAL --ctorigdstport 8080 -j DROP</code></pre>



<p class="wp-block-paragraph">The permitted source continues through existing rules; this does not override other restrictions. ORIGINAL direction avoids dropping return packets for container-initiated connections. Inspect rule counters and test with fresh connections from permitted and denied clients:</p>



<pre class="wp-block-code"><code>sudo iptables -vnL DOCKER-USER --line-numbers</code></pre>



<p class="wp-block-paragraph">To remove exactly the example rule, use the same arguments with <code>-D</code>:</p>



<pre class="wp-block-code"><code>sudo iptables -D DOCKER-USER -i ens3 -p tcp ! -s 198.51.100.10/32 -m conntrack --ctdir ORIGINAL --ctorigdstport 8080 -j DROP</code></pre>



<p class="wp-block-paragraph">This rule covers neither UDP nor IPv6. Before relying on it, review those paths and your existing rule order. Make persistence explicit using your firewall-management process, ensure the chain exists before restoring the rule, and test after Docker restarts and a reboot. Do not flush Docker’s chains.</p>



<h2 id="nftables" class="wp-block-heading">7. Treat native nftables and host networking separately</h2>



<p class="wp-block-paragraph">Docker’s native nftables backend has no <code>DOCKER-USER</code> chain. Custom filtering belongs in separate tables and base chains at suitable hook priorities; do not edit Docker-owned tables. Docker describes support introduced in Engine 29.0.0 as experimental at the time of writing. Consult its <a href="https://docs.docker.com/engine/network/firewall-nftables/" rel="noopener">nftables documentation</a> for the installed release.</p>



<p class="wp-block-paragraph">A chain left over from a previous iptables configuration does not prove it will keep protecting traffic after a backend switch or reboot. Do not switch backends merely to make a copied command run. Use loopback or remove publication while a qualified administrator designs the required rules.</p>



<p class="wp-block-paragraph">With <code>network_mode: host</code>, containers share the host network namespace and port-publishing settings do not provide isolation. Audit application listeners and host firewall policy directly; see the <a href="https://docs.docker.com/engine/network/drivers/host/" rel="noopener">host-network driver documentation</a>. If a service unexpectedly uses host mode, changing its <code>ports:</code> list will not solve the exposure.</p>



<h2 id="verify" class="wp-block-heading">8. Verify Docker and UFW from outside the VPS</h2>



<p class="wp-block-paragraph">From an external workstation you control, test the VPS’s actual IPv4 and IPv6 addresses. For the example TCP port, using OpenBSD-style netcat:</p>



<pre class="wp-block-code"><code>nc -4 -vz -w 3 VPS_IPV4 8080
nc -6 -vz -w 3 VPS_IPV6 8080</code></pre>



<p class="wp-block-paragraph">A private backend should fail externally while its intended local proxy or tunnel still works. For a source allowlist, test from both permitted and denied networks. Test public HTTPS and open a second SSH session before closing the first. A test from the VPS itself does not exercise the same incoming path.</p>



<p class="wp-block-paragraph">A timeout alone cannot identify which layer blocked traffic. Compare mapping output, rule counters and application health; upstream firewalls can mask a host misconfiguration. Repeat after redeployment, firewall reload, Docker restart and a planned reboot. Review UDP services separately rather than treating a TCP result as proof.</p>



<p class="wp-block-paragraph">Keep UFW’s host rules aligned with the services you intentionally run, using the <a href="https://ubuntu.com/server/docs/how-to/security/firewalls/" rel="noopener">Ubuntu firewall guide</a>. If an upstream VPS firewall is available, use it as another layer, with separate IPv4 and IPv6 policy.</p>



<p class="wp-block-paragraph">For a deployment you maintain yourself, explore our <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">self-managed VPS hosting</a>. If you need help reviewing an Aveshost server, <a href="https://www.aveshost.com/support" rel="noopener">contact our support team</a> with redacted port mappings and the intended access list. Our <a href="https://blog.aveshost.com/docker-disk-space-full/">Docker storage troubleshooting guide</a> covers another common VPS maintenance problem.</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-096838292548430796504dd2f68da213" class="rank-math-list-item">
<h3 class="rank-math-question ">Does ufw deny 8080 guarantee a Docker container is blocked?</h3>
<div class="rank-math-answer ">

<p>No. A bridge-network published port can take Docker’s forwarding path instead of the host INPUT path. Remove or narrow the mapping, or apply backend-appropriate filtering, then verify externally.</p>

</div>
</div>
<div id="faq-question-ca7e291839414cb09f8af6b9e65af158" class="rank-math-list-item">
<h3 class="rank-math-question ">Does EXPOSE in a Dockerfile publish a public port?</h3>
<div class="rank-math-answer ">

<p>EXPOSE documents intended container ports. Host publication is a separate operation. Audit explicit publish flags, publish-all flags, Compose ports and deployment-platform settings.</p>

</div>
</div>
<div id="faq-question-1b3a26b573174e8d84105bd18d2fe5ba" class="rank-math-list-item">
<h3 class="rank-math-question ">Can another container reach a service bound to host loopback?</h3>
<div class="rank-math-answer ">

<p>A host loopback binding restricts that host publication. Peer containers sharing the application network may still reach its container port directly. Control network membership and application authentication too.</p>

</div>
</div>
<div id="faq-question-c5962ad8eb25410a9e52f4e0c4fc9301" class="rank-math-list-item">
<h3 class="rank-math-question ">Should I disable Docker iptables integration to fix UFW?</h3>
<div class="rank-math-answer ">

<p>That is not a general fix. Docker relies on generated networking rules, and disabling them requires a complete replacement design. Prefer reducing published ports and applying filtering for the active backend.</p>

</div>
</div>
<div id="faq-question-86e877aeedd248e39fad306bddf8426e" class="rank-math-list-item">
<h3 class="rank-math-question ">Why can I still reach the old port after editing Compose?</h3>
<div class="rank-math-answer ">

<p>Check whether the container was recreated, whether an override file retained the mapping, and whether another container or host process owns the port. Compare the rendered configuration with actual mappings and repeat an external test.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/docker-ufw-unexpected-ports/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Docker Disk Space Full? How to Find What Is Using Your VPS Storage</title>
		<link>https://blog.aveshost.com/docker-disk-space-full/</link>
					<comments>https://blog.aveshost.com/docker-disk-space-full/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Thu, 19 Nov 2026 17:17:25 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux VPS]]></category>
		<category><![CDATA[VPS storage]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=6005</guid>

					<description><![CDATA[Find what is filling your Docker VPS with practical Linux commands, targeted cleanup guidance, log rotation and checks that protect persistent data.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">When you see a <strong>Docker disk space full</strong> error, start with <code>df -h</code>, <code>df -i</code> and <code>docker system df -v</code>. Together, they show whether the problem is filesystem capacity, exhausted inodes or Docker objects. The largest culprit may be container logs, database volumes, build cache or backups outside Docker.</p>



<p class="wp-block-paragraph">Our approach is to measure first, identify the owner of the data, and remove only what you can safely replace. A database volume can be essential even when Docker calls it unused. Never delete files directly from Docker’s internal storage directories to make an alert disappear.</p>



<p class="wp-block-paragraph">This guide covers Docker Engine on a Linux VPS, with GNU/Linux commands suitable for Ubuntu and Debian. Connect over SSH using an account with sudo rights. Docker commands below use <code>sudo</code> for a rootful installation; for rootless Docker, run them as the owning user without sudo.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#check-filesystem">1. Check disk capacity and inodes first</a></div><div><a href="#locate-directories">2. Find the largest host directories</a></div><div><a href="#docker-usage">3. Compare Docker images, containers and build cache</a></div><div><a href="#volumes-mounts">4. Trace persistent volumes and bind mounts</a></div><div><a href="#logs-hidden-space">5. Check logs and space that du cannot explain</a></div><div><a href="#targeted-cleanup">6. Reclaim space with targeted cleanup</a></div><div><a href="#rotation">7. Prevent Docker disk space full errors with log rotation</a></div><div><a href="#verify-capacity">8. Recheck storage and decide whether to expand</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="check-filesystem" class="wp-block-heading">1. Check disk capacity and inodes first</h2>



<p class="wp-block-paragraph">Run these read-only checks before any cleanup:</p>



<pre class="wp-block-code"><code>df -h
df -i
lsblk -f</code></pre>



<p class="wp-block-paragraph">In <code>df -h</code>, check the filesystem containing the failing path and its <code>Avail</code>, <code>Use%</code> and mount point. A full root filesystem can stop image pulls, database writes and deployments. Repeated overlay entries often report the same backing filesystem; do not add their sizes together.</p>



<p class="wp-block-paragraph">In <code>df -i</code>, a filesystem at 100% inode usage can reject new files despite having free bytes. Large numbers of tiny cache or session files can cause this. <code>lsblk -f</code> helps identify disks and mount points. See the <a href="https://www.gnu.org/software/coreutils/manual/html_node/df-invocation.html" rel="noopener">GNU df documentation</a> for these filesystem checks.</p>



<p class="wp-block-paragraph">If production writes are already failing, pause nonessential builds, imports and backup jobs while you investigate. Avoid writing a fresh backup onto the full filesystem; use a verified off-server destination. Do not repeatedly restart a database that has no room to recover.</p>



<h2 id="locate-directories" class="wp-block-heading">2. Find the largest host directories</h2>



<p class="wp-block-paragraph">Start at the affected mount point. For a full root filesystem:</p>



<pre class="wp-block-code"><code>sudo du -xhd1 / 2&gt;/dev/null | sort -h
sudo du -xhd1 /var 2&gt;/dev/null | sort -h
sudo du -xhd1 /var/lib 2&gt;/dev/null | sort -h</code></pre>



<p class="wp-block-paragraph">The <code>-x</code> option stays on one filesystem and <code>-d1</code> limits the displayed depth. Repeat against the biggest directory. If Docker or application data lives on a separate mounted disk, scan that mount separately. Permission or I/O errors hidden by the redirection still need investigation if totals look incomplete.</p>



<p class="wp-block-paragraph">Check <code>/var/log</code>, application uploads, deployment folders and local backup archives as well as Docker. Directory scans can create noticeable I/O on busy servers; run them one level at a time. The <a href="https://www.gnu.org/software/coreutils/manual/html_node/du-invocation.html" rel="noopener">GNU du manual</a> explains these options.</p>



<p class="wp-block-paragraph">Locate Docker’s configured data root and storage backend:</p>



<pre class="wp-block-code"><code>sudo docker info --format '{{.DockerRootDir}}'
sudo docker info</code></pre>



<p class="wp-block-paragraph">The usual rootful data directory is <code>/var/lib/docker</code>, but fresh Docker Engine 29.0 and later installations use the containerd image store by default. Image contents and container snapshots then live under <code>/var/lib/containerd</code>, while volumes and other Docker data remain under the Docker data root. Custom and rootless installations differ. Changing Docker’s <code>data-root</code> does not move containerd’s separate data; check the <a href="https://docs.docker.com/engine/daemon/" rel="noopener">daemon storage documentation</a>.</p>



<h2 id="docker-usage" class="wp-block-heading">3. Compare Docker images, containers and build cache</h2>



<pre class="wp-block-code"><code>sudo docker system df -v
sudo docker ps -a --size
sudo docker image ls
sudo docker buildx du</code></pre>



<p class="wp-block-paragraph">The verbose <code>docker system df</code> output separates images, containers, local volumes and build cache. Shared image layers mean individual image sizes cannot simply be added together. “Reclaimable” describes Docker references; it does not tell you whether an old deployment or its data matters to your business.</p>



<p class="wp-block-paragraph">The size shown by <code>docker ps --size</code> measures container writable layers. It excludes mounted data and logging-driver files, so a small container can still be responsible for substantial disk usage. See Docker’s <a href="https://docs.docker.com/engine/storage/drivers/" rel="noopener">writable-layer explanation</a>.</p>



<p class="wp-block-paragraph">If you use Buildx, <code>docker buildx du</code> reports cache for the selected builder. Other builders can retain separate caches. If the command is unavailable, check whether Buildx is installed; do not install extra tooling during an outage simply to follow this optional check.</p>



<p class="wp-block-paragraph">For example, if the filesystem has 72 GB used but Docker objects explain only 28 GB, investigate logs, bind mounts, backups and host files. These example totals illustrate the investigation; they are not a complete accounting formula.</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/11/docker-vps-storage-breakdown.webp" alt="Six VPS storage consumers: Docker images, writable layers, volumes, bind mounts, container logs and host files." class="wp-image-6007" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/docker-vps-storage-breakdown.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-vps-storage-breakdown-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-vps-storage-breakdown-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-vps-storage-breakdown-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="volumes-mounts" class="wp-block-heading">4. Trace persistent volumes and bind mounts</h2>



<p class="wp-block-paragraph">Replace <code>app</code> and <code>app_data</code> below with names from your own server:</p>



<pre class="wp-block-code"><code>sudo docker inspect app --format '{{json .Mounts}}'
sudo docker volume ls
sudo docker volume inspect app_data
sudo docker ps -a --filter volume=app_data</code></pre>



<p class="wp-block-paragraph">The mount list identifies whether a container writes to a Docker volume or a host bind mount. For a bind mount, inspect the reported host source directory with <code>du</code>. For local volumes, compare the volume names and sizes in <code>docker system df -v</code>; remote volume drivers need their own storage checks.</p>



<p class="wp-block-paragraph">A PostgreSQL data volume, an upload directory or n8n’s persistent data can grow even when application images stay small. Use the application’s retention and maintenance tools after checking backups. Never manually remove PostgreSQL WAL files, database table files or Docker layer directories.</p>



<p class="wp-block-paragraph">Before removing a volume, establish which service owns it, whether stopped containers reference it, and whether its contents have a tested backup. An unattached volume may belong to a temporarily removed Compose project. Our <a href="https://blog.aveshost.com/supabase-vps-requirements/">Supabase VPS sizing guide</a> explains why persistent storage needs its own capacity allowance.</p>



<h2 id="logs-hidden-space" class="wp-block-heading">5. Check logs and space that du cannot explain</h2>



<p class="wp-block-paragraph">Inspect the logging driver and path for the container you suspect:</p>



<pre class="wp-block-code"><code>sudo docker inspect app --format '{{.HostConfig.LogConfig.Type}} {{.LogPath}}'
sudo journalctl --disk-usage
sudo lsof +L1</code></pre>



<p class="wp-block-paragraph">For a rootful container using a file-based driver, inspect the reported log path’s allocated size with <code>sudo du -h /exact/reported/log/path</code>. A blank path can be normal for other drivers. Repeated application errors can fill logs quickly; inspect a short recent sample with <code>sudo docker logs --tail 100 app</code>.</p>



<p class="wp-block-paragraph">Docker’s default <code>json-file</code> logging does not rotate files unless configured. Docker recommends the rotating <code>local</code> driver for many non-Kubernetes use cases. See its <a href="https://docs.docker.com/engine/logging/configure/" rel="noopener">logging-driver guidance</a>. Do not delete or truncate Docker-managed log files behind the daemon.</p>



<p class="wp-block-paragraph">If <code>df</code> shows far more use than <code>du</code>, <code>lsof +L1</code> can reveal deleted files still held open by processes. Space returns when the last open reference closes. Identify the service and plan a controlled restart or supported log reopen; do not kill unfamiliar processes. If lsof is unavailable, skip this check until suitable tooling is available.</p>



<p class="wp-block-paragraph">Filesystem metadata, reserved space and files hidden beneath mounts can also explain differences. A large systemd journal is separate from container logs. The <a href="https://www.freedesktop.org/software/systemd/man/latest/journalctl.html" rel="noopener">journalctl manual</a> documents its disk-usage and retention controls.</p>



<h2 id="targeted-cleanup" class="wp-block-heading">6. Reclaim space with targeted cleanup</h2>



<p class="wp-block-paragraph">Once you know the cause, choose a matching action. The commands in this section delete data; inspect candidates and preserve rollback requirements first. They are alternatives, not a script to run from top to bottom.</p>



<p class="wp-block-paragraph">To remove dangling images that no container references:</p>



<pre class="wp-block-code"><code>sudo docker image prune</code></pre>



<p class="wp-block-paragraph">To prune dangling build cache older than seven days with the default builder:</p>



<pre class="wp-block-code"><code>sudo docker builder prune --filter "until=168h"</code></pre>



<p class="wp-block-paragraph">To remove one confirmed disposable stopped container, including its writable layer:</p>



<pre class="wp-block-code"><code>sudo docker rm old-test-container</code></pre>



<p class="wp-block-paragraph">The first two commands prompt for confirmation. Keep those prompts. Cached build layers can be regenerated, but future builds may take longer. Retain images needed for rollback and verify registry access before removing them. The <a href="https://docs.docker.com/engine/manage-resources/pruning/" rel="noopener">Docker pruning guide</a> describes each object type.</p>



<p class="wp-block-paragraph">Avoid starting with <code>docker system prune -a --volumes</code>. System prune removes stopped containers, unused networks, image data and build cache; <code>-a</code> broadens image removal and <code>--volumes</code> adds unused anonymous volumes. Separate volume pruning with <code>-a</code> can also remove unused named volumes. “Unused” does not mean safe to lose.</p>



<p class="wp-block-paragraph">For large host journals, archive needed incident evidence first, then use an agreed retention policy. For example, <code>sudo journalctl --rotate --vacuum-size=500M</code> removes older archived journal files toward the example limit; it is not a hard cap on total journal storage. Do not remove database or upload data to hit an arbitrary free-space target.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Space consumer</th><th>Preferred response</th><th>Main tradeoff</th></tr></thead><tbody><tr><td>Dangling images</td><td>Review and prune dangling images</td><td>May lose locally retained artifacts</td></tr><tr><td>Build cache</td><td>Prune cache for the relevant builder</td><td>Slower future builds</td></tr><tr><td>Container logs</td><td>Fix noisy app; configure rotation</td><td>Recreation may interrupt service</td></tr><tr><td>Database or uploads</td><td>Apply app retention or add capacity</td><td>Data requires verified backups</td></tr></tbody></table></figure>



<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/11/docker-storage-recovery-workflow.webp" alt="Five-step Docker storage recovery workflow: measure, locate, protect data, clean selectively and prevent repeats." class="wp-image-6008" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/docker-storage-recovery-workflow.webp 1536w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-storage-recovery-workflow-300x200.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-storage-recovery-workflow-1024x683.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/docker-storage-recovery-workflow-768x512.webp 768w" sizes="(max-width: 1536px) 100vw, 1536px" /></figure>



<h2 id="rotation" class="wp-block-heading">7. Prevent Docker disk space full errors with log rotation</h2>



<p class="wp-block-paragraph">Configure rotation in the service’s Compose definition. Merge this example under the existing service instead of replacing the whole file:</p>



<pre class="wp-block-code"><code>services:
  app:
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"</code></pre>



<p class="wp-block-paragraph">This retains a bounded set of JSON log files per container, roughly 30 MB with these example settings, plus overhead. Choose limits that fit your troubleshooting and compliance needs. See the <a href="https://docs.docker.com/engine/logging/drivers/json-file/" rel="noopener">JSON-file logging options</a>. Application logs written inside volumes need their own rotation.</p>



<p class="wp-block-paragraph">Changing the definition does not retrofit existing containers. Validate with <code>docker compose config</code>, verify persistent mounts, and recreate the affected service during a suitable maintenance window. Recreation can discard files kept only in its writable layer and interrupt requests. A plain restart does not apply a new logging configuration.</p>



<p class="wp-block-paragraph">Monitor free bytes and inodes on each data filesystem. Example alerts at 80% and 90% are starting points; adjust for growth rate and response time. Keep backups off-server, enforce retention and leave room for image extraction, database maintenance and temporary deployment files.</p>



<h2 id="verify-capacity" class="wp-block-heading">8. Recheck storage and decide whether to expand</h2>



<pre class="wp-block-code"><code>df -h
df -i
sudo docker system df -v
sudo docker ps</code></pre>



<p class="wp-block-paragraph">Compare the same filesystem before and after cleanup. Check the application’s health endpoint, perform a normal read/write transaction and confirm scheduled backups still work. If usage climbs again immediately, address the writer or retention policy rather than repeating broad pruning.</p>



<p class="wp-block-paragraph">If required application data dominates storage, additional capacity may be the right fix. A larger virtual disk may still need partition and filesystem expansion inside Linux; follow the procedure for the actual filesystem. Plan storage moves for Docker and containerd separately.</p>



<p class="wp-block-paragraph">For a new deployment, explore our <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">self-managed VPS hosting</a> and size storage for persistent data, logs, builds and backup staging. If you need help assessing a running Aveshost server, <a href="https://www.aveshost.com/support" rel="noopener">contact our support team</a> with the filesystem figures and largest directories. Redact credentials and private application data before sharing diagnostic output.</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-9b639d933b26468dafe46553c592fe5e" class="rank-math-list-item">
<h3 class="rank-math-question ">Why is my VPS full when Docker reports little disk usage?</h3>
<div class="rank-math-answer ">

<p>Docker object totals do not explain every host file. Check bind-mounted data, logging-driver files, local backups, system journals and deleted files held open by processes. Confirm which filesystem is full before comparing totals.</p>

</div>
</div>
<div id="faq-question-2f3d0f198e4c43a9b9a68110767b7f21" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I delete /var/lib/docker/overlay2 to free space?</h3>
<div class="rank-math-answer ">

<p>No. Docker manages layer files and metadata together. Manual deletion can corrupt containers and images. Identify disposable objects through Docker commands, preserve persistent data and use supported removal operations.</p>

</div>
</div>
<div id="faq-question-5aef7d8b21e04187879edd5cb7ec34bb" class="rank-math-list-item">
<h3 class="rank-math-question ">Does docker system prune remove running containers?</h3>
<div class="rank-math-answer ">

<p>It does not remove running containers, but it removes stopped containers and other unused objects. Flags broaden its scope. A stopped container can contain valuable writable-layer data, so review what you need before confirming.</p>

</div>
</div>
<div id="faq-question-67cd483b664b44aba8b9f89a2f3e92b3" class="rank-math-list-item">
<h3 class="rank-math-question ">Why does Docker still say no space left when df -h shows free space?</h3>
<div class="rank-math-answer ">

<p>Check inode usage with df -i and inspect the filesystem containing the exact failing path. A separate full mount, a quota or a filesystem-specific limit can also block writes while another filesystem has free capacity.</p>

</div>
</div>
<div id="faq-question-eec221d9fabd402b923397319548e681" class="rank-math-list-item">
<h3 class="rank-math-question ">Will increasing VPS RAM fix a full Docker disk?</h3>
<div class="rank-math-answer ">

<p>Additional RAM does not increase disk capacity. Reclaim confirmed disposable storage, reduce growth or expand storage. Investigate swap separately if it is a significant disk consumer; removing it without a memory plan can destabilise services.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/docker-disk-space-full/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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 loading="lazy" 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 loading="lazy" 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 loading="lazy" 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>How to Create a Public Website Status Page with Uptime Kuma</title>
		<link>https://blog.aveshost.com/public-website-status-page-with-uptime-kuma/</link>
					<comments>https://blog.aveshost.com/public-website-status-page-with-uptime-kuma/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Tue, 17 Nov 2026 13:38:08 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Status Page]]></category>
		<category><![CDATA[Ubuntu VPS]]></category>
		<category><![CDATA[Uptime Kuma]]></category>
		<category><![CDATA[Website Monitoring]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5957</guid>

					<description><![CDATA[A complete step-by-step tutorial on building a self-hosted public website status page with Uptime Kuma, Docker Compose, Caddy or Nginx WebSockets, and custom domains.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Setting up a <strong>public website status page with Uptime Kuma</strong> gives your customers, developers, and stakeholders a transparent, real-time window into the health of your websites, APIs, and mail servers—without paying monthly per-monitor or per-subscriber fees to commercial SaaS status tools.</p>



<p class="wp-block-paragraph">Built by Louis Lam (<a href="https://github.com/louislam/uptime-kuma" rel="noopener">louislam/uptime-kuma</a>), Uptime Kuma combines sub-minute HTTP/TCP/DNS monitoring, 90+ private notification channels (Telegram, Slack, Discord, Email SMTP, PagerDuty, and Webhooks), SSL certificate expiration alerts, and branded multi-group status pages inside a single lightweight Docker container.</p>



<p class="wp-block-paragraph">In this tutorial, you will deploy Uptime Kuma on an <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Self-Managed VPS</a>, configure reliable service monitors, build a <strong>public website status page with Uptime Kuma</strong>, map a custom subdomain like <code>status.yourdomain.com</code> over HTTPS, and post live incident and maintenance updates.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#why-build-a-public-website-status-page-with-uptime-kuma">Why Build a Public Website Status Page with Uptime Kuma?</a></div><div><a href="#step-1-deploy-uptime-kuma-on-a-vps-with-docker-compose">Step 1: Deploy Uptime Kuma on a VPS with Docker Compose</a></div><div><a href="#step-2-create-website-api-and-ssl-expiry-monitors">Step 2: Create Website, API, and SSL Expiry Monitors</a></div><div><a href="#step-3-create-and-customize-your-public-status-page">Step 3: Create and Customize Your Public Status Page</a></div><div><a href="#step-4-map-a-custom-domain-and-configure-websocket-https">Step 4: Map a Custom Domain and Configure WebSocket HTTPS</a></div><div><a href="#step-5-post-live-incidents-and-schedule-maintenance-windows">Step 5: Post Live Incidents and Schedule Maintenance Windows</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="why-build-a-public-website-status-page-with-uptime-kuma" class="wp-block-heading">Why Build a Public Website Status Page with Uptime Kuma?</h2>



<p class="wp-block-paragraph">When an unexpected outage or upstream network issue occurs, customers immediately check whether the problem is on their connection or your server. Publishing a dedicated status page cuts duplicate support tickets and builds long-term trust.</p>



<p class="wp-block-paragraph">Unlike hosted status pages that charge extra for custom domains, team seats, or SSL monitoring, self-hosting a <strong>public website status page with Uptime Kuma</strong> on a small Ubuntu VPS gives you complete control over both private alerting and public transparency:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Capability / Feature</th><th>Uptime Kuma (Self-Hosted on VPS)</th><th>Typical Hosted SaaS Status Pages</th></tr></thead><tbody><tr><td>Check Interval Speed</td><td>Down to every 20 seconds</td><td>1 to 5 minutes on base tiers</td></tr><tr><td>Supported Monitor Types</td><td>HTTP(s), Keyword, JSON Query, Ping, TCP, DNS, Push, Docker</td><td>Mostly HTTP(s) and Ping (extra cost for TCP/DNS)</td></tr><tr><td>Public Status Pages &amp; Custom Domains</td><td>Unlimited pages &amp; custom subdomains included</td><td>Often restricted to 1 page or paid add-ons</td></tr><tr><td>SSL Certificate Expiry Display</td><td>Built-in public badge + private expiry alerts</td><td>Rarely shown on public status pages</td></tr><tr><td>Notification Integrations</td><td>90+ built-in providers (Slack, Telegram, Discord, SMTP, etc.)</td><td>Limited by plan tier or webhook quotas</td></tr><tr><td>Server Resource Footprint</td><td>~120 MB – 200 MB RAM in Docker</td><td>Cloud-hosted (paid per monitor/subscriber)</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/uptime-kuma-status-page-architecture.webp" alt="Public website status page with Uptime Kuma architecture diagram showing monitored targets, Docker container on port 3001, 90+ alert channels, and Caddy or Nginx WebSocket proxy" class="wp-image-5955" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-architecture.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-architecture-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-architecture-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-architecture-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="step-1-deploy-uptime-kuma-on-a-vps-with-docker-compose" class="wp-block-heading">Step 1: Deploy Uptime Kuma on a VPS with Docker Compose</h2>



<p class="wp-block-paragraph">For accurate uptime tracking, avoid hosting Uptime Kuma on the exact same machine as the primary website you are monitoring—if that single server loses power or network connectivity, your status page would go offline at the exact moment users need it. Running Uptime Kuma on a lightweight secondary <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Ubuntu VPS</a> (1 vCPU, 1–2 GB RAM) ensures independent external monitoring.</p>



<p class="wp-block-paragraph">According to the <a href="https://github.com/louislam/uptime-kuma/wiki" rel="noopener">official Uptime Kuma documentation</a>, you should always mount a persistent volume to <code>/app/data</code> so your SQLite database, monitor history, and status page settings survive container upgrades.</p>



<p class="wp-block-paragraph">Bind the container port to loopback (<code>127.0.0.1:3001:3001</code>) rather than <code>0.0.0.0:3001</code> so external traffic must pass through your HTTPS reverse proxy.</p>



<pre class="wp-block-code"><code># 1. Create a dedicated directory for Uptime Kuma
mkdir -p ~/uptime-kuma &amp;&amp; cd ~/uptime-kuma

# 2. Create docker-compose.yml with a persistent volume bound to localhost:3001
cat &lt;&lt;'EOF' &gt; docker-compose.yml
services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    restart: always
    ports:
      - "127.0.0.1:3001:3001"
    volumes:
      - uptime-kuma-data:/app/data

volumes:
  uptime-kuma-data:
EOF

# 3. Start Uptime Kuma in the background
docker compose up -d</code></pre>



<h2 id="step-2-create-website-api-and-ssl-expiry-monitors" class="wp-block-heading">Step 2: Create Website, API, and SSL Expiry Monitors</h2>



<p class="wp-block-paragraph">Before building your public page, populate Uptime Kuma with the underlying monitors you want to track. Only the display name, status badge, and heartbeat bar percentages are shown publicly—your raw target URLs, webhook secrets, and IP addresses remain private inside your admin dashboard.</p>



<p class="wp-block-paragraph">Click <strong>+ Add New Monitor</strong> in the top-left corner and configure these four core monitor patterns for a production stack:</p>



<p class="wp-block-paragraph">• <strong>HTTP(s) — Keyword Monitor (Best for Websites &amp; WordPress):</strong> Instead of a basic HTTP <code>200 OK</code> check (which can pass even if a database error page renders), select <strong>HTTP(s) &#8211; Keyword</strong>, enter your website URL, and set a keyword from your footer or hero heading. Enable <strong>Certificate Expiry Notification</strong> so Uptime Kuma alerts you 7, 14, and 21 days before TLS renewal is due.</p>



<p class="wp-block-paragraph">• <strong>HTTP(s) — JSON Query Monitor (Best for REST APIs):</strong> Point Uptime Kuma to your API&#8217;s <code>/health</code> endpoint (for example, a <a href="https://blog.aveshost.com/deploy-pocketbase-on-a-vps/">PocketBase backend</a> or <a href="https://blog.aveshost.com/self-host-dify-on-a-vps/">self-hosted Dify</a> instance) and verify that the JSON response returns <code>status: ok</code>.</p>



<p class="wp-block-paragraph">• <strong>DNS &amp; Mail Port Monitors:</strong> Add a <strong>DNS</strong> monitor to verify your domain&#8217;s <code>A</code> and <code>MX</code> records resolve properly, and a <strong>TCP Port</strong> monitor on port <code>443</code> or <code>587</code> for critical services.</p>



<p class="wp-block-paragraph">• <strong>Push / Heartbeat Monitor (Best for Backups &amp; Cron Jobs):</strong> Select <strong>Push</strong> to generate a unique heartbeat URL, then append <code>curl -fsS https://status.yourdomain.com/api/push/TOKEN?status=up&amp;msg=OK</code> to the end of your nightly backup script.</p>



<h2 id="step-3-create-and-customize-your-public-status-page" class="wp-block-heading">Step 3: Create and Customize Your Public Status Page</h2>



<p class="wp-block-paragraph">Once your monitors are collecting green heartbeats, you are ready to build your <strong>public website status page with Uptime Kuma</strong>:</p>



<p class="wp-block-paragraph">• <strong>1. Create a New Status Page Slug:</strong> Click <strong>Status Pages</strong> in the top navigation bar, then click <strong>+ New Status Page</strong>. Enter a clear title (such as <em>Aveshost Cloud Status</em>) and a URL slug (for example, <code>main</code>, which creates <code>/status/main</code>), then click <strong>Next</strong>.</p>



<p class="wp-block-paragraph">• <strong>2. Organize Monitors into Service Groups:</strong> Inside Edit mode, click <strong>+ Add Group</strong> to create logical sections such as <em>Core Websites &amp; Storefront</em>, <em>Customer APIs &amp; Webhooks</em>, and <em>Email &amp; DNS Infrastructure</em>. Use the <strong>Add a monitor</strong> dropdown to assign each monitor to its group. You can click the gear icon next to any monitor to toggle public tag visibility or URL linking.</p>



<p class="wp-block-paragraph">• <strong>3. Customize Branding, Theme &amp; SSL Badges:</strong> In the left sidebar, upload your brand logo, set a custom description and footer text, choose Light, Dark, or Auto theme, and toggle <strong>Show Certificate Expiry</strong> if you want visitors to see that your HTTPS certificates are valid. You can also inject custom styling in the <strong>Custom CSS</strong> box (such as matching your brand font or hiding the footer credit) before clicking <strong>Save</strong>.</p>



<h2 id="step-4-map-a-custom-domain-and-configure-websocket-https" class="wp-block-heading">Step 4: Map a Custom Domain and Configure WebSocket HTTPS</h2>



<p class="wp-block-paragraph">By default, visitors have to type <code>https://status.yourdomain.com/status/main</code>, while visiting the root URL <code>https://status.yourdomain.com/</code> redirects to your private <code>/dashboard</code> login screen. Two settings inside Uptime Kuma fix this cleanly so your root subdomain loads the public status page directly:</p>



<p class="wp-block-paragraph">• <strong>Add Your Subdomain to Status Page Domain Names:</strong> Open your status page, click <strong>Edit Status Page</strong>, locate <strong>Domain Names</strong> in the left sidebar, add <code>status.yourdomain.com</code> (without <code>https://</code>), and click <strong>Save</strong>.</p>



<p class="wp-block-paragraph">• <strong>Set the Default Entry Page &amp; Trust Proxy:</strong> Click your profile icon in the top-right corner, go to <strong>Settings &gt; General</strong>, and under <strong>Entry Page</strong> select your status page (<code>/status/main</code>). Next, open <strong>Settings &gt; Reverse Proxy</strong>, set <strong>Trust Proxy</strong> to <strong>Yes</strong>, and click <strong>Save</strong>.</p>



<p class="wp-block-paragraph">Finally, point a DNS <code>A</code> record for <code>status.yourdomain.com</code> to your VPS IP address and configure <strong>Caddy</strong> or <strong>Nginx</strong> as an HTTPS reverse proxy. As noted in the <a href="https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy" rel="noopener">Uptime Kuma Reverse Proxy Wiki</a>, Uptime Kuma relies on <strong>Socket.IO WebSockets</strong>—if you use Nginx, you must pass the <code>Upgrade</code> and <code>Connection "upgrade"</code> headers or the status page will hang on a loading spinner.</p>



<pre class="wp-block-code"><code># === OPTION A: Caddy Reverse Proxy (/etc/caddy/Caddyfile) ===
# Automatically provisions Let's Encrypt HTTPS and proxies WebSockets
status.yourdomain.com {
    reverse_proxy 127.0.0.1:3001
}

# === OPTION B: Nginx Reverse Proxy (/etc/nginx/sites-available/uptime-kuma) ===
server {
    listen 443 ssl http2;
    server_name status.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/status.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/status.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}</code></pre>



<h2 id="step-5-post-live-incidents-and-schedule-maintenance-windows" class="wp-block-heading">Step 5: Post Live Incidents and Schedule Maintenance Windows</h2>



<p class="wp-block-paragraph">A great status page does more than show automated green or red bars—it explains <em>why</em> a service is degraded and when planned upgrades will happen:</p>



<p class="wp-block-paragraph">• <strong>Posting Live Incident Banners:</strong> Open your status page, click <strong>Edit Status Page</strong>, and click <strong>Create Incident</strong> at the top. Choose a severity colour (<em>Info</em> in blue, <em>Warning</em> in amber, or <em>Danger</em> in red), write a concise title and Markdown update (for example, <em>Investigating elevated API latency in EU-West</em>), and click <strong>Pin</strong>. Once resolved, click <strong>Unpin</strong> to clear the banner.</p>



<p class="wp-block-paragraph">• <strong>Scheduling Planned Maintenance Windows:</strong> Before running server kernel updates or migrating containers with <a href="https://blog.aveshost.com/dokploy-vs-coolify/">Dokploy or Coolify</a>, click <strong>Maintenance</strong> in the top dashboard bar and select <strong>+ Schedule Maintenance</strong>. Choose a one-time window or recurring cron schedule, attach the affected monitors and your public status page, and save. During the maintenance window, Uptime Kuma turns those monitors blue (<em>Under Maintenance</em>) on the public page and suppresses false-alarm downtime alerts.</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/uptime-kuma-status-page-setup-guide.webp" alt="6-step Uptime Kuma public status page checklist covering Docker volume deployment, HTTPS and SSL monitors, status groups, custom domain mapping, WebSocket proxy, and incident banners" class="wp-image-5956" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-setup-guide.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-setup-guide-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-setup-guide-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/uptime-kuma-status-page-setup-guide-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-90f55eeb08734206b05a74ef74ce1353" class="rank-math-list-item">
<h3 class="rank-math-question ">Does a public website status page with Uptime Kuma expose my admin dashboard or monitor URLs?</h3>
<div class="rank-math-answer ">

<p>No. Visitors viewing your public status page only see the friendly monitor names, group titles, uptime percentages, and heartbeat bars you explicitly add to that page. Your underlying target URLs, IP addresses, authentication headers, and other unshared monitors remain locked behind your admin login.</p>

</div>
</div>
<div id="faq-question-7b1acfd7d5a84bdbb543fe7fdf0b27e0" class="rank-math-list-item">
<h3 class="rank-math-question ">How do I stop status.yourdomain.com from redirecting visitors to the /dashboard login page?</h3>
<div class="rank-math-answer ">

<p>Do two things inside Uptime Kuma: first, open your status page in Edit mode and add status.yourdomain.com under Domain Names in the left sidebar. Second, go to Settings &gt; General &gt; Entry Page and select your public status page instead of Dashboard. Visitors hitting the root domain will then land directly on your status page, while admins can still log in at /dashboard.</p>

</div>
</div>
<div id="faq-question-08b66b438609496b9a4d2150ca92237a" class="rank-math-list-item">
<h3 class="rank-math-question ">Why is my Uptime Kuma status page stuck on &#x27;Cannot connect to the socket server&#x27;?</h3>
<div class="rank-math-answer ">

<p>Uptime Kuma uses Socket.IO WebSockets for real-time updates. That error happens when your reverse proxy (such as Nginx, Apache, or Cloudflare) blocks or strips WebSocket upgrade headers. In Nginx, add proxy_http_version 1.1, proxy_set_header Upgrade $http_upgrade, and proxy_set_header Connection &#8216;upgrade&#8217; inside your location / block.</p>

</div>
</div>
<div id="faq-question-f2e4090e19634aaabaf0de583acf661c" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I host multiple public status pages for different clients on one Uptime Kuma instance?</h3>
<div class="rank-math-answer ">

<p>Yes. You can create as many status pages as you need (such as /status/client-a and /status/client-b), assign different monitor groups to each page, and map a separate custom subdomain to each status page inside its Domain Names list.</p>

</div>
</div>
<div id="faq-question-ee31aa75f2ef4249a164ccc93bf7f5b6" class="rank-math-list-item">
<h3 class="rank-math-question ">Should I host Uptime Kuma on the same VPS as my main production website?</h3>
<div class="rank-math-answer ">

<p>Ideally, no. If your main production VPS suffers a kernel panic, disk full error, or data-center network issue, an Uptime Kuma container running on that same machine will go offline too—preventing it from sending outage alerts or serving your status page. Running Uptime Kuma on a separate lightweight 1 GB or 2 GB RAM VPS guarantees independent external monitoring.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/public-website-status-page-with-uptime-kuma/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Dokploy vs Coolify: Which Deployment Platform Fits Your VPS?</title>
		<link>https://blog.aveshost.com/dokploy-vs-coolify/</link>
					<comments>https://blog.aveshost.com/dokploy-vs-coolify/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Sun, 15 Nov 2026 14:53:12 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Coolify]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Docker Swarm]]></category>
		<category><![CDATA[Dokploy]]></category>
		<category><![CDATA[self-hosted PaaS]]></category>
		<category><![CDATA[vps hosting]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5945</guid>

					<description><![CDATA[An engineering comparison of Dokploy vs Coolify covering control-plane RAM usage, Docker Swarm vs agentless SSH multi-server scaling, Traefik vs Caddy routing, one-click templates, and VPS sizing.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Evaluating <strong>Dokploy vs Coolify</strong> is one of the highest-leverage architectural decisions you will make when turning a Linux VPS into a self-hosted Platform-as-a-Service (PaaS). Both platforms replace unpredictable per-seat cloud bills from Vercel, Render, and Heroku with automated Git push deployments, managed databases, and Let&#8217;s Encrypt SSL certificates on your own server.</p>



<p class="wp-block-paragraph">Despite solving the same problem, <strong>Dokploy</strong> (<a href="https://github.com/Dokploy/dokploy" rel="noopener">Dokploy/dokploy</a>) and <strong>Coolify</strong> (<a href="https://github.com/coollabsio/coolify" rel="noopener">coollabsio/coolify</a>) take distinctly different engineering paths. Dokploy pairs a lightweight Next.js and TypeScript control plane (~350 MB idle RAM) with native Docker Swarm clustering, whereas Coolify v4 uses a full-featured PHP Laravel and Livewire control plane (~600 MB idle RAM) that coordinates standalone Docker hosts over agentless SSH.</p>



<p class="wp-block-paragraph">Whether you are deploying on an <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Self-Managed VPS</a> or scaling across multiple instances, this <strong>Dokploy vs Coolify</strong> guide compares memory footprints, build engines, reverse proxies, multi-server scaling, and open-source licensing so you can choose the right fit.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#dokploy-vs-coolify-at-a-glance-core-architecture-compared">Dokploy vs Coolify at a Glance: Core Architecture Compared</a></div><div><a href="#control-plane-footprint-and-ui-experience-why-dokploy-feels-lighter">Control Plane Footprint and UI Experience: Why Dokploy Feels Lighter</a></div><div><a href="#open-source-licensing-caddy-support-and-templates-where-coolify-wins">Open-Source Licensing, Caddy Support, and Templates: Where Coolify Wins</a></div><div><a href="#multi-server-scaling-docker-swarm-clusters-vs-agentless-ssh">Multi-Server Scaling: Docker Swarm Clusters vs Agentless SSH</a></div><div><a href="#git-builds-railpack-and-automated-s3-backups-compared">Git Builds, Railpack, and Automated S3 Backups Compared</a></div><div><a href="#how-to-install-dokploy-or-coolify-on-an-ubuntu-vps">How to Install Dokploy or Coolify on an Ubuntu VPS</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="dokploy-vs-coolify-at-a-glance-core-architecture-compared" class="wp-block-heading">Dokploy vs Coolify at a Glance: Core Architecture Compared</h2>



<p class="wp-block-paragraph">When comparing <strong>Dokploy vs Coolify</strong>, start by looking at how each platform manages containers on your host and how much memory its control plane reserves before you deploy your first application.</p>



<p class="wp-block-paragraph">Here is how the two platforms stack up side by side across RAM usage, orchestration, build packs, and licensing:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Feature / Criterion</th><th>Dokploy (Dokploy/dokploy)</th><th>Coolify v4 (coollabsio/coolify)</th></tr></thead><tbody><tr><td>Control Plane Tech Stack</td><td>TypeScript, Next.js, PostgreSQL, Redis</td><td>PHP (Laravel), Livewire, PostgreSQL, Redis, Soketi</td></tr><tr><td>Idle RAM Consumption</td><td>~350 MB – 400 MB</td><td>~600 MB – 750 MB</td></tr><tr><td>Minimum Ubuntu VPS Specs</td><td>2 vCPU / 2 GB RAM / 30 GB NVMe</td><td>2 vCPU / 2 GB RAM (4 GB+ recommended)</td></tr><tr><td>Initial Setup Port</td><td>Port 3000</td><td>Port 8000 (plus 6001/6002 WebSockets)</td></tr><tr><td>Reverse Proxy Options</td><td>Traefik (native default)</td><td>Traefik (default), Caddy, or Custom/None</td></tr><tr><td>Multi-Server Scaling Model</td><td>Native Docker Swarm manager/worker cluster</td><td>Agentless SSH orchestration across standalone Docker hosts</td></tr><tr><td>Supported Build Engines</td><td>Nixpacks, Railpack, Dockerfile, Compose, Heroku &amp; Paketo</td><td>Nixpacks, Railpack, Dockerfile, Compose, Static</td></tr><tr><td>One-Click Service Templates</td><td>90+ self-hosted apps &amp; databases</td><td>280+ pre-configured services &amp; databases</td></tr><tr><td>Source Code License</td><td>Open-core (Apache 2.0 core + commercial enterprise directory)</td><td>100% Apache License 2.0 (zero self-hosted feature paywalls)</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/dokploy-vs-coolify-architecture.webp" alt="Dokploy vs Coolify control plane and multi-server architecture comparison diagram showing Next.js Swarm stack vs Laravel SSH orchestration" class="wp-image-5943" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-architecture.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-architecture-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-architecture-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-architecture-768x515.webp 768w" sizes="(max-width: 1264px) 100vw, 1264px" /></figure>



<h2 id="control-plane-footprint-and-ui-experience-why-dokploy-feels-lighter" class="wp-block-heading">Control Plane Footprint and UI Experience: Why Dokploy Feels Lighter</h2>



<p class="wp-block-paragraph">On a single VPS, your deployment control plane shares CPU cores and RAM with your production web apps and databases. That makes control-plane efficiency a major factor in the <strong>Dokploy vs Coolify</strong> decision for smaller servers.</p>



<p class="wp-block-paragraph">According to the <a href="https://docs.dokploy.com/docs/core" rel="noopener">official Dokploy documentation</a>, Dokploy runs a compiled Next.js and TypeScript dashboard backed by PostgreSQL, Redis, and Traefik. Here is what sets its daily experience apart:</p>



<p class="wp-block-paragraph">• <strong>Lower Idle Memory (~350 MB RAM):</strong> Because Dokploy avoids heavy background worker pools at idle, it leaves roughly 250 MB to 350 MB more free RAM than Coolify on a 2 GB VPS—enough headroom for an extra Redis cache or Node.js microservice.</p>



<p class="wp-block-paragraph">• <strong>Instant Single-Page Application (SPA) Navigation:</strong> Built with Next.js and clean shadcn/ui components, switching between application logs, environment variables, Docker Compose editors, and server metrics feels snappy with minimal full-page reloads.</p>



<p class="wp-block-paragraph">• <strong>Built-in Traefik File Editor &amp; Real-Time Monitoring:</strong> Dokploy includes a visual Traefik configuration editor right inside the sidebar, alongside built-in CPU, memory, disk, and container alert notifications for Slack, Telegram, Discord, and email.</p>



<h2 id="open-source-licensing-caddy-support-and-templates-where-coolify-wins" class="wp-block-heading">Open-Source Licensing, Caddy Support, and Templates: Where Coolify Wins</h2>



<p class="wp-block-paragraph">While Dokploy wins on raw memory footprint, <strong>Coolify v4</strong> remains the gold standard for teams that prioritize strict open-source licensing, proxy flexibility, and an expansive one-click service ecosystem.</p>



<p class="wp-block-paragraph">As documented in the <a href="https://coolify.io/docs/" rel="noopener">official Coolify v4 docs</a>, Coolify&#8217;s Laravel, Livewire, and Soketi WebSocket architecture delivers several capabilities that appeal to agencies and power users:</p>



<p class="wp-block-paragraph">• <strong>100% Apache 2.0 Open Source Without Paywalls:</strong> Every single feature in Coolify&#8217;s repository is licensed under Apache 2.0. You get unlimited team members, role-based access, and multi-server support on your self-hosted instance without touching a proprietary enterprise directory.</p>



<p class="wp-block-paragraph">• <strong>280+ One-Click Service Templates:</strong> Coolify maintains one of the largest self-hosted template catalogs available—letting you spin up Supabase, Plausible Analytics, Ghost, Uptime Kuma, MinIO, or AI tools like <a href="https://blog.aveshost.com/dify-vs-flowise-vs-n8n/">Dify, Flowise, and n8n</a> in seconds.</p>



<p class="wp-block-paragraph">• <strong>Choice of Traefik or Caddy Reverse Proxy:</strong> Unlike Dokploy, which is coupled to Traefik, Coolify lets you switch any managed server&#8217;s reverse proxy between <strong>Traefik</strong> and <strong>Caddy</strong> (or disable the built-in proxy entirely if you run your own external Nginx or Cloudflare Tunnel setup).</p>



<h2 id="multi-server-scaling-docker-swarm-clusters-vs-agentless-ssh" class="wp-block-heading">Multi-Server Scaling: Docker Swarm Clusters vs Agentless SSH</h2>



<p class="wp-block-paragraph">Once your projects outgrow a single VPS, <strong>Dokploy vs Coolify</strong> diverges sharply in how multiple servers are connected and orchestrated.</p>



<p class="wp-block-paragraph"><strong>Dokploy uses native Docker Swarm clustering:</strong> During installation, Dokploy initializes your primary VPS as a Docker Swarm manager node. From the Cluster settings tab, you can generate a Swarm join token to attach additional worker VPS nodes and connect a container registry (such as GitHub Container Registry or Docker Hub). Scaling a stateless web app across three servers is as simple as bumping the replica count in Dokploy&#8217;s UI, and Traefik automatically load-balances traffic across healthy nodes.</p>



<p class="wp-block-paragraph"><strong>Coolify uses agentless SSH orchestration:</strong> Coolify does not require Docker Swarm for multi-server management. Instead, you register additional servers via SSH keys, and Coolify issues standard Docker and Docker Compose commands over SSH. This makes it effortless to designate a secondary VPS as a dedicated <strong>Build Server</strong> so heavy TypeScript, Rust, or Next.js image builds never steal CPU cycles from your live production database server.</p>



<p class="wp-block-paragraph">Note that Dokploy also added remote server and build server support alongside its Swarm cluster features, while Coolify offers experimental Swarm support—but Docker Swarm remains Dokploy&#8217;s native foundation, and standalone SSH orchestration remains Coolify&#8217;s strongest workflow.</p>



<h2 id="git-builds-railpack-and-automated-s3-backups-compared" class="wp-block-heading">Git Builds, Railpack, and Automated S3 Backups Compared</h2>



<p class="wp-block-paragraph">For day-to-day CI/CD pipelines, both platforms cover all the essentials you expect from a modern Vercel or Heroku replacement:</p>



<p class="wp-block-paragraph">• <strong>Nixpacks, Railpack, and Buildpacks:</strong> Both Dokploy and Coolify support <strong>Nixpacks</strong> and Railway&#8217;s newer BuildKit-powered <strong>Railpack</strong> engine to build Node.js, Python, Go, PHP, and Rust repositories without writing a <code>Dockerfile</code>. Dokploy goes a step further by also supporting classic <strong>Heroku Buildpacks</strong> and <strong>Paketo Buildpacks</strong>.</p>



<p class="wp-block-paragraph">• <strong>Native Docker Compose &amp; PR Preview Deployments:</strong> Both platforms parse raw <code>docker-compose.yml</code> files directly from your Git repository—making it easy to deploy multi-container stacks like <a href="https://blog.aveshost.com/self-host-dify-on-a-vps/">self-hosted Dify</a> or <a href="https://blog.aveshost.com/self-host-openhands-on-a-vps/">OpenHands</a>—and both automatically spin up isolated Pull Request preview URLs when developers open a GitHub PR.</p>



<p class="wp-block-paragraph">• <strong>Scheduled Database &amp; Volume Backups to S3:</strong> Both platforms include built-in cron scheduling to dump PostgreSQL, MySQL, MariaDB, and MongoDB databases directly to S3-compatible object storage (AWS S3, Cloudflare R2, Backblaze B2, or MinIO). Dokploy also provides a built-in UI workflow for backing up and restoring arbitrary Docker volumes.</p>



<h2 id="how-to-install-dokploy-or-coolify-on-an-ubuntu-vps" class="wp-block-heading">How to Install Dokploy or Coolify on an Ubuntu VPS</h2>



<p class="wp-block-paragraph">Always install either platform on a fresh Ubuntu 22.04 LTS or 24.04 LTS VPS with root access and ports <code>80</code> and <code>443</code> open. Never install both on the same server, as their Traefik reverse proxies and Docker networks will collide.</p>



<p class="wp-block-paragraph">Connect to your <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Ubuntu VPS</a> over SSH and run the official one-line installer for your chosen platform:</p>



<pre class="wp-block-code"><code># === OPTION 1: Install Dokploy on Ubuntu VPS ===
# Minimum: 2 vCPU / 2 GB RAM / 30 GB NVMe (Opens initial setup on port 3000)
curl -sSL https://dokploy.com/install.sh | sh
# After install, visit: http://YOUR_VPS_IP:3000

# === OPTION 2: Install Coolify v4 on Ubuntu VPS ===
# Minimum: 2 vCPU / 2-4 GB RAM / 30 GB NVMe (Opens initial setup on port 8000)
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
# After install, visit: http://YOUR_VPS_IP:8000

# === RECOMMENDED: Add a 4 GB Swap File on 2 GB - 4 GB VPS Nodes ===
# Prevents Out-Of-Memory (OOM) kills during concurrent Nixpacks / Next.js builds
sudo fallocate -l 4G /swapfile &amp;&amp; sudo chmod 600 /swapfile
sudo mkswap /swapfile &amp;&amp; sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab</code></pre>



<p class="wp-block-paragraph">As soon as you create your admin account, bind a custom HTTPS domain (for example, <code>panel.yourdomain.com</code>) inside the platform&#8217;s settings and close raw access to port <code>3000</code> or <code>8000</code> in your UFW or cloud firewall. For terminal-first AI coding workflows on your server, see our guide on how to <a href="https://blog.aveshost.com/run-opencode-on-a-vps/">run OpenCode on a VPS with secure remote access</a>.</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/dokploy-vs-coolify-decision-matrix.webp" alt="Dokploy vs Coolify VPS sizing and decision matrix comparing 2 GB starter VPS, 8 GB production VPS, multi-node scaling, and licensing" class="wp-image-5944" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-decision-matrix.webp 1264w, https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-decision-matrix-300x201.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-decision-matrix-1024x687.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/dokploy-vs-coolify-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-f553dedf25cc44fd8a6f5fca2c5b7087" class="rank-math-list-item">
<h3 class="rank-math-question ">Which uses less RAM on a small VPS: Dokploy or Coolify?</h3>
<div class="rank-math-answer ">

<p>Dokploy uses less RAM at idle—typically around 350 MB to 400 MB—because its control plane is a lightweight Next.js and TypeScript application. Coolify v4 runs a Laravel, Livewire, Redis, and Soketi WebSocket stack that consumes roughly 600 MB to 750 MB at idle, making Dokploy a better fit for 2 GB RAM VPS instances.</p>

</div>
</div>
<div id="faq-question-71d6ade2577f47cda0905536f748e5a4" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I install both Dokploy and Coolify on the same VPS?</h3>
<div class="rank-math-answer ">

<p>No. Both Dokploy and Coolify bind their reverse proxies to ports 80 and 443 and manage their own Docker networks and Traefik instances, which causes port conflicts and routing collisions. Always install one PaaS per clean Linux server.</p>

</div>
</div>
<div id="faq-question-eb7207db601e4f5db63add08e42c435f" class="rank-math-list-item">
<h3 class="rank-math-question ">What is the license difference between Dokploy and Coolify?</h3>
<div class="rank-math-answer ">

<p>Coolify is 100% open source under the Apache 2.0 license with every self-hosted feature included for free. Dokploy uses an open-core model: its core deployment platform is licensed under Apache 2.0, while specific enterprise features (such as SSO and advanced audit/role modules) fall under a commercial source-available license.</p>

</div>
</div>
<div id="faq-question-025ea795e2584febb2795be70a7d958c" class="rank-math-list-item">
<h3 class="rank-math-question ">How do Dokploy and Coolify handle multi-server deployments differently?</h3>
<div class="rank-math-answer ">

<p>Dokploy uses native Docker Swarm clustering: your main server acts as the Swarm manager, and worker nodes join the cluster to scale container replicas across machines using a shared registry. Coolify uses agentless SSH orchestration to manage standalone Docker engines on remote servers, allowing you to separate build servers, database servers, and app servers without Swarm.</p>

</div>
</div>
<div id="faq-question-472ba39245eb4c7fbe137f7400a6ffc8" class="rank-math-list-item">
<h3 class="rank-math-question ">What happens to my live apps if the Dokploy or Coolify dashboard crashes?</h3>
<div class="rank-math-answer ">

<p>In both platforms, your deployed applications and databases continue running normally even if the management dashboard container stops or restarts. Incoming user traffic flows directly through the Traefik or Caddy reverse proxy container to your application containers rather than passing through the PaaS web UI.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/dokploy-vs-coolify/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Host an MCP Server on a VPS with HTTPS and Authentication</title>
		<link>https://blog.aveshost.com/host-mcp-server-on-vps/</link>
					<comments>https://blog.aveshost.com/host-mcp-server-on-vps/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Sun, 08 Nov 2026 10:42:39 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[AI Insights]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AI agents]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[MCP]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[website security]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5835</guid>

					<description><![CDATA[Step-by-step guide to deploying a remote Model Context Protocol (MCP) server on a Linux VPS with Streamable HTTP transport, automatic Let's Encrypt HTTPS, and Bearer Token or OAuth 2.1 authentication.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Learning how to <strong>host an MCP server on a VPS</strong> with HTTPS and authentication is the key to turning local AI tools into a secure, always-on service that you and your team can reach from anywhere. When you run a <a href="https://blog.aveshost.com/what-is-model-context-protocol/">Model Context Protocol (MCP)</a> server over local <code>stdio</code>, your AI assistant can only call those tools while sitting on that exact laptop. Moving the server onto a Linux VPS unlocks shared access across desktop IDEs, cloud workflows, and mobile coding setups.</p>



<p class="wp-block-paragraph">However, exposing an MCP server to the public internet requires three critical safeguards: switching from local <code>stdio</code> to the <strong>Streamable HTTP</strong> transport bound to localhost (<code>127.0.0.1</code>), terminating <strong>TLS/HTTPS</strong> through a streaming-aware reverse proxy like Caddy or Nginx, and enforcing strict <strong>Bearer Token or OAuth 2.1 authentication</strong> before any tool can execute.</p>



<p class="wp-block-paragraph">In this step-by-step tutorial, we walk through the complete production setup on an Ubuntu VPS—from writing a Streamable HTTP MCP server and running it as a persistent service to configuring unbuffered HTTPS and locking down authentication.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#why-move-mcp-from-stdio-to-vps">Why Move an MCP Server from Local stdio to a Remote VPS?</a></div><div><a href="#remote-mcp-architecture-and-prerequisites">Remote MCP Server Architecture and VPS Prerequisites</a></div><div><a href="#step-1-build-streamable-http-mcp-server">Step 1: Build a Remote MCP Server with Streamable HTTP and Bearer Auth</a></div><div><a href="#step-2-run-mcp-with-systemd-or-docker">Step 2: Run the MCP Server as a Persistent Service</a></div><div><a href="#step-3-configure-https-reverse-proxy">Step 3: Configure HTTPS and Unbuffered Streaming in Caddy or Nginx</a></div><div><a href="#step-4-authentication-bearer-vs-oauth">Step 4: Choosing Between Static Bearer Tokens and OAuth 2.1</a></div><div><a href="#production-security-and-aveshost-vps">Production Hardening Checklist and Choosing a VPS</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="why-move-mcp-from-stdio-to-vps" class="wp-block-heading">Why Move an MCP Server from Local stdio to a Remote VPS?</h2>



<p class="wp-block-paragraph">Most developers start with local <code>stdio</code> MCP servers because the host application (such as Claude Desktop, Cursor, or Google Antigravity) simply spawns a local Node.js or Python script as a child process. While <code>stdio</code> is convenient for single-machine tools, it creates immediate bottlenecks as soon as you work across multiple devices or collaborate with a team.</p>



<p class="wp-block-paragraph">Hosting a remote MCP server on a Linux VPS solves three major problems: you only store sensitive database credentials and third-party API keys in one hardened server environment rather than scattering <code>.env</code> files across every developer laptop; your tools stay online 24/7 for background agents and <a href="https://blog.aveshost.com/antigravity-remote-mobile-setup/">remote mobile development workflows</a>; and your MCP server can sit on the same private network as your <a href="https://blog.aveshost.com/self-host-supabase-on-a-vps/">self-hosted Supabase</a> or PostgreSQL database for sub-millisecond queries.</p>



<p class="wp-block-paragraph">The table below compares the three MCP transport modes defined across the <a href="https://modelcontextprotocol.io/specification/2025-03-26/basic/transports" target="_blank" rel="noopener">official MCP specification</a>:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>MCP Transport Mode</th><th>Endpoint Structure</th><th>Network Scope</th><th>Authentication Standard</th><th>Recommended Use Case</th></tr></thead><tbody><tr><td>Local stdio</td><td>Standard input/output pipes (stdin/stdout)</td><td>Local machine only</td><td>OS user permissions</td><td>Local filesystem tools and single-device scripts</td></tr><tr><td>Legacy HTTP + SSE</td><td>Dual endpoints (/sse for stream, /messages for POST)</td><td>LAN or Internet</td><td>Custom headers (Deprecated)</td><td>Older MCP clients that have not upgraded to Streamable HTTP</td></tr><tr><td>Streamable HTTP (Current Standard)</td><td>Single unified endpoint (e.g., https://mcp.yourdomain.com/mcp)</td><td>Remote VPS / Cloud over HTTPS</td><td>Bearer Token or OAuth 2.1 + PKCE</td><td>Production remote MCP servers, shared team tools, and cloud agents</td></tr></tbody></table></figure>



<h2 id="remote-mcp-architecture-and-prerequisites" class="wp-block-heading">Remote MCP Server Architecture and VPS Prerequisites</h2>



<p class="wp-block-paragraph">Never expose a raw Python or Node.js MCP process directly on public port <code>8000</code> without encryption. Instead, a production-grade VPS deployment uses a four-layer defence-in-depth architecture:</p>



<p class="wp-block-paragraph"><strong>1. The AI Client Layer:</strong> Your IDE or agent connects to <code>https://mcp.yourdomain.com/mcp</code> over TLS 1.3 and attaches an <code>Authorization: Bearer &lt;token&gt;</code> header.</p>



<p class="wp-block-paragraph"><strong>2. The Reverse Proxy &amp; Auth Gate (Port 443):</strong> Caddy or Nginx terminates Let&#8217;s Encrypt HTTPS, rejects any request missing a valid Bearer token or trusted <code>Origin</code> header with <code>401 Unauthorized</code>, and disables proxy buffering so streamed JSON-RPC packets flush immediately.</p>



<p class="wp-block-paragraph"><strong>3. The Loopback MCP Process (<code>127.0.0.1:8000</code>):</strong> Your FastMCP (Python) or <code>@modelcontextprotocol/sdk</code> (TypeScript) server listens strictly on the local loopback interface, unreachable from the outside internet except through the reverse proxy.</p>



<p class="wp-block-paragraph"><strong>4. Internal Data &amp; APIs:</strong> Once authenticated, the MCP server executes scoped tools against your internal databases, WordPress REST APIs, or cloud services.</p>



<p class="wp-block-paragraph">Before starting, make sure you have an Ubuntu 22.04 or 24.04 LTS VPS with at least <strong>2 GB of RAM and 1–2 vCPU cores</strong>, root or <code>sudo</code> SSH access, and a subdomain (such as <code>mcp.yourdomain.com</code>) with an <code>A</code> record pointing to your VPS IP address.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1376" height="768" src="https://blog.aveshost.com/wp-content/uploads/2026/11/remote-mcp-server-vps-https-architecture.webp" alt="Remote MCP server architecture on a Linux VPS showing AI client, Caddy or Nginx HTTPS reverse proxy, loopback FastMCP server, and backend tools" class="wp-image-5837" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/remote-mcp-server-vps-https-architecture.webp 1376w, https://blog.aveshost.com/wp-content/uploads/2026/11/remote-mcp-server-vps-https-architecture-300x167.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/remote-mcp-server-vps-https-architecture-1024x572.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/remote-mcp-server-vps-https-architecture-768x429.webp 768w" sizes="(max-width: 1376px) 100vw, 1376px" /></figure>



<h2 id="step-1-build-streamable-http-mcp-server" class="wp-block-heading">Step 1: Build a Remote MCP Server with Streamable HTTP and Bearer Auth</h2>



<p class="wp-block-paragraph">Even if you validate tokens at the reverse proxy layer, your application code should also verify the <code>Authorization</code> header so defence is never reliant on a single configuration file. Let&#8217;s create a clean project directory on your Ubuntu VPS, generate a cryptographically random 256-bit Bearer token, and build a Streamable HTTP server using Python and <strong>FastMCP</strong>.</p>



<p class="wp-block-paragraph">First, SSH into your VPS, create <code>/opt/mcp-server</code>, and generate your secret token:</p>



<pre class="wp-block-code"><code>sudo mkdir -p /opt/mcp-server &amp;&amp; sudo chown $USER:$USER /opt/mcp-server
cd /opt/mcp-server

# Generate a 256-bit (64-hex-character) secret Bearer token
 echo "MCP_BEARER_TOKEN=$(openssl rand -hex 32)" &gt; .env
chmod 600 .env
cat .env</code></pre>



<p class="wp-block-paragraph">Copy the generated <code>MCP_BEARER_TOKEN</code> value—you will need it later for your MCP client configuration. Next, create a Python virtual environment, install <code>fastmcp</code> and <code>python-dotenv</code>, and create <code>server.py</code>:</p>



<pre class="wp-block-code"><code>import hmac
import os
from dotenv import load_dotenv
from fastmcp import FastMCP
from fastmcp.server.dependencies import get_http_headers
from fastmcp.exceptions import ToolError

load_dotenv("/opt/mcp-server/.env")
EXPECTED_TOKEN = os.environ.get("MCP_BEARER_TOKEN", "")

mcp = FastMCP("AveshostRemoteMCP")

def verify_bearer_token() -&gt; None:
    headers = get_http_headers()
    auth_header = headers.get("authorization", "")
    expected = f"Bearer {EXPECTED_TOKEN}"
    if not EXPECTED_TOKEN or not hmac.compare_digest(auth_header, expected):
        raise ToolError("401 Unauthorized: Invalid or missing Bearer token")

@mcp.tool()
def check_server_health(service_name: str) -&gt; dict:
    """Check the live status of an internal VPS service."""
    verify_bearer_token()
    return {"service": service_name, "status": "healthy", "transport": "streamable-http"}

if __name__ == "__main__":
    # Bind strictly to localhost; Nginx or Caddy handles public HTTPS
    mcp.run(transport="streamable-http", host="127.0.0.1", port=8000, path="/mcp")</code></pre>



<p class="wp-block-paragraph">Notice two security details in <code>server.py</code>: we use <code>hmac.compare_digest()</code> for constant-time token comparison (preventing timing attacks), and we bind the server to <code>127.0.0.1</code> on port <code>8000</code> so external scanners cannot bypass your HTTPS proxy.</p>



<h2 id="step-2-run-mcp-with-systemd-or-docker" class="wp-block-heading">Step 2: Run the MCP Server as a Persistent Service</h2>



<p class="wp-block-paragraph">To keep your MCP server running continuously in the background and automatically restart it if your VPS reboots, register it as a hardened <code>systemd</code> service (or run it inside Docker with <code>restart: unless-stopped</code>).</p>



<p class="wp-block-paragraph">Create <code>/etc/systemd/system/mcp-server.service</code> with the following configuration:</p>



<pre class="wp-block-code"><code>&#91;Unit]
Description=Remote Model Context Protocol (MCP) Server
After=network.target

&#91;Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/opt/mcp-server
EnvironmentFile=/opt/mcp-server/.env
ExecStart=/opt/mcp-server/venv/bin/python /opt/mcp-server/server.py
Restart=always
RestartSec=3
NoNewPrivileges=true
PrivateTmp=true

&#91;Install]
WantedBy=multi-user.target</code></pre>



<p class="wp-block-paragraph">Set ownership of <code>/opt/mcp-server</code> to <code>www-data</code>, reload <code>systemd</code>, and verify that your server is listening on <code>127.0.0.1:8000</code>:</p>



<pre class="wp-block-code"><code>sudo chown -R www-data:www-data /opt/mcp-server
sudo systemctl daemon-reload
sudo systemctl enable --now mcp-server
sudo systemctl status mcp-server</code></pre>



<h2 id="step-3-configure-https-reverse-proxy" class="wp-block-heading">Step 3: Configure HTTPS and Unbuffered Streaming in Caddy or Nginx</h2>



<p class="wp-block-paragraph">Because MCP&#8217;s <strong>Streamable HTTP</strong> transport uses chunked HTTP responses and Server-Sent Events (SSE) to stream incremental tool progress and server notifications, a default reverse proxy configuration will buffer responses in memory and cause your AI client to time out.</p>



<p class="wp-block-paragraph"><strong>Option A — Caddy (Simplest Automatic HTTPS):</strong> Caddy automatically provisions and renews Let&#8217;s Encrypt TLS certificates. Put the following block in <code>/etc/caddy/Caddyfile</code>, replacing <code>mcp.yourdomain.com</code> and <code>YOUR_SECRET_BEARER_TOKEN</code> with your real subdomain and token:</p>



<pre class="wp-block-code"><code>mcp.yourdomain.com {
    @unauthorized {
        not header Authorization "Bearer YOUR_SECRET_BEARER_TOKEN"
    }
    respond @unauthorized "Unauthorized" 401

    reverse_proxy 127.0.0.1:8000 {
        # Disable buffering so Streamable HTTP chunks flush immediately
        flush_interval -1
    }
}</code></pre>



<p class="wp-block-paragraph"><strong>Option B — Nginx + Certbot:</strong> If your VPS already runs Nginx, disable <code>proxy_buffering</code> and extend <code>proxy_read_timeout</code> inside <code>/etc/nginx/sites-available/mcp.conf</code> so long-running tool calls are never cut off mid-stream:</p>



<pre class="wp-block-code"><code>server {
    listen 443 ssl http2;
    server_name mcp.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/mcp.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mcp.yourdomain.com/privkey.pem;

    location /mcp {
        if ($http_authorization != "Bearer YOUR_SECRET_BEARER_TOKEN") {
            return 401;
        }

        proxy_pass http://127.0.0.1:8000/mcp;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Critical for MCP Streamable HTTP &amp; SSE
        proxy_buffering off;
        proxy_cache off;
        chunked_transfer_encoding on;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
    }
}</code></pre>



<h2 id="step-4-authentication-bearer-vs-oauth" class="wp-block-heading">Step 4: Choosing Between Static Bearer Tokens and OAuth 2.1</h2>



<p class="wp-block-paragraph">The <a href="https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization" target="_blank" rel="noopener">official MCP Authorization specification</a> supports two ways to authenticate remote HTTP connections. Choosing the right one depends on who will connect to your VPS:</p>



<p class="wp-block-paragraph">Use a <strong>Static 256-bit Bearer Token</strong> when you are the sole user, when your internal engineering team connects via shared secrets, or when an automated backend like <a href="https://blog.aveshost.com/build-an-ai-help-desk-with-openclaw/">OpenClaw</a> calls your MCP server machine-to-machine. Use <strong>OAuth 2.1 with PKCE</strong> when you are publishing a multi-tenant MCP server where external users sign in with their own accounts and grant scoped permissions (for example, <code>mcp:tools:read</code> vs <code>mcp:tools:write</code>).</p>



<p class="wp-block-paragraph">Once your HTTPS proxy and Bearer token are active, connect your MCP client (such as Google Antigravity, Cursor, or Claude) by adding the remote <code>serverUrl</code> (or <code>url</code>) and <code>Authorization</code> header to your MCP configuration file:</p>



<pre class="wp-block-code"><code>{
  "mcpServers": {
    "aveshost-vps-tools": {
      "serverUrl": "https://mcp.yourdomain.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_SECRET_BEARER_TOKEN"
      }
    }
  }
}</code></pre>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Feature</th><th>Static Bearer Token (API Secret)</th><th>OAuth 2.1 + PKCE Resource Server</th></tr></thead><tbody><tr><td>Best Audience</td><td>Solo developers, internal team tools, and CI/CD agents</td><td>Multi-user SaaS platforms and customer-facing MCP servers</td></tr><tr><td>Token Lifecycle</td><td>Long-lived 256-bit secret rotated manually in .env</td><td>Short-lived JWT access tokens + refresh tokens via Identity Provider</td></tr><tr><td>Discovery Flow</td><td>Configured directly in client mcpServers JSON headers</td><td>401 response + /.well-known/oauth-protected-resource metadata</td></tr><tr><td>Granular User Scopes</td><td>All-or-nothing per token (unless multiple tokens are mapped)</td><td>Per-user, per-tool scopes enforced via JWT claims</td></tr></tbody></table></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1376" height="768" src="https://blog.aveshost.com/wp-content/uploads/2026/11/mcp-authentication-methods-comparison.webp" alt="Comparison of static Bearer token authentication versus OAuth 2.1 with PKCE for remote MCP servers" class="wp-image-5838" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/mcp-authentication-methods-comparison.webp 1376w, https://blog.aveshost.com/wp-content/uploads/2026/11/mcp-authentication-methods-comparison-300x167.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/mcp-authentication-methods-comparison-1024x572.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/mcp-authentication-methods-comparison-768x429.webp 768w" sizes="(max-width: 1376px) 100vw, 1376px" /></figure>



<h2 id="production-security-and-aveshost-vps" class="wp-block-heading">Production Hardening Checklist and Choosing a VPS</h2>



<p class="wp-block-paragraph">Before connecting production databases or business APIs to your remote MCP server, complete four quick hardening steps on your Linux VPS:</p>



<p class="wp-block-paragraph"><strong>1. Lock Down the Firewall (UFW):</strong> Allow only SSH (<code>22/tcp</code>), HTTP (<code>80/tcp</code>), and HTTPS (<code>443/tcp</code>). Never open port <code>8000</code> in UFW—keeping port <code>8000</code> closed externally guarantees that nobody can bypass your Caddy or Nginx authentication check.</p>



<p class="wp-block-paragraph"><strong>2. Validate Origin Headers:</strong> If you use the TypeScript SDK (<code>StreamableHTTPServerTransport</code>) or FastMCP, keep <code>Origin</code> validation enabled to prevent cross-site request and DNS rebinding attacks.</p>



<p class="wp-block-paragraph"><strong>3. Scope Tool Permissions:</strong> Give your MCP server a read-only database role or narrowly scoped API credentials unless a tool explicitly requires write access, and log every tool invocation.</p>



<p class="wp-block-paragraph"><strong>4. Match Your VPS to Your Workload:</strong> A single lightweight Python or Node.js MCP server uses only 80 MB to 200 MB of RAM, making an entry-level <a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Self-Managed Linux VPS</a> (2 GB to 4 GB RAM with fast SSD storage and full root SSH access) more than fast enough. If your MCP server runs alongside a heavy local database or serves latency-sensitive West African traffic, deploy on an <a href="https://www.aveshost.com/vds-ghana" rel="noopener">Aveshost Ghana VDS</a> with dedicated Accra NVMe storage. Need a clean subdomain for your endpoint? You can also <a href="https://www.aveshost.com/domains" rel="noopener">register your domain with Aveshost</a> and point your DNS record in seconds.</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-054a4658c5334f9782606f1641c5be35" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I host a remote MCP server on shared cPanel hosting?</h3>
<div class="rank-math-answer ">

<p>Standard shared hosting is not designed for persistent, long-running Streamable HTTP daemons or custom unbuffered reverse proxy rules. A Linux VPS with root SSH access lets you run systemd services or Docker containers and disable proxy buffering in Caddy or Nginx.</p>

</div>
</div>
<div id="faq-question-18a3355769de4bba81ed26b859c9f139" class="rank-math-list-item">
<h3 class="rank-math-question ">Why does my remote MCP server connect but hang when calling tools?</h3>
<div class="rank-math-answer ">

<p>In almost every case, Nginx or a cloud load balancer is buffering the chunked HTTP response stream. Add proxy_buffering off; and proxy_cache off; in Nginx (or flush_interval -1 in Caddy) so JSON-RPC messages flush to the client immediately.</p>

</div>
</div>
<div id="faq-question-bd2cfe14b2b54840a804d464ee65cc40" class="rank-math-list-item">
<h3 class="rank-math-question ">Should I use HTTP+SSE or Streamable HTTP for a new VPS MCP server?</h3>
<div class="rank-math-answer ">

<p>Use Streamable HTTP. The Model Context Protocol specification replaced the older dual-endpoint HTTP+SSE transport with Streamable HTTP, which handles all requests and event streams over a single unified endpoint such as /mcp.</p>

</div>
</div>
<div id="faq-question-7c407aee881e47959bab02c79c201f9d" class="rank-math-list-item">
<h3 class="rank-math-question ">Is a static Bearer token secure enough for a production MCP server over HTTPS?</h3>
<div class="rank-math-answer ">

<p>Yes, for single-tenant, personal, or internal team deployments—provided the token is generated with at least 256 bits of entropy (openssl rand -hex 32), transmitted exclusively over TLS 1.3 (HTTPS), and compared in constant time. For multi-user SaaS products, use OAuth 2.1 with PKCE.</p>

</div>
</div>
<div id="faq-question-44549a1306c049a1a87e042d63635576" class="rank-math-list-item">
<h3 class="rank-math-question ">How much RAM and CPU does a remote MCP server need on a VPS?</h3>
<div class="rank-math-answer ">

<p>A standalone Node.js or Python (FastMCP) server consumes roughly 80 MB to 250 MB of RAM. A 2 GB RAM, 1–2 vCPU Linux VPS easily handles a standalone MCP server, while an 8 GB RAM VPS is ideal if you also host Supabase or PostgreSQL on the same machine.</p>

</div>
</div>
</div>
</div>]]></content:encoded>
					
					<wfw:commentRss>https://blog.aveshost.com/host-mcp-server-on-vps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Supabase VPS Requirements: How Much RAM, CPU and Storage Do You Need?</title>
		<link>https://blog.aveshost.com/supabase-vps-requirements/</link>
					<comments>https://blog.aveshost.com/supabase-vps-requirements/#respond</comments>
		
		<dc:creator><![CDATA[James Wilson]]></dc:creator>
		<pubDate>Sat, 07 Nov 2026 23:43:52 +0000</pubDate>
				<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[self-hosting]]></category>
		<category><![CDATA[Supabase]]></category>
		<category><![CDATA[vps]]></category>
		<guid isPermaLink="false">https://blog.aveshost.com/?p=5830</guid>

					<description><![CDATA[Learn the real RAM, CPU, and storage requirements for self-hosted Supabase on a Linux VPS—including per-container memory usage, Logflare overhead, pgvector sizing, and swap tuning.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Understanding the real <strong>Supabase VPS requirements</strong> before you provision a server is the easiest way to avoid silent Linux Out-Of-Memory (OOM) crashes, sluggish API responses, and unexpected disk exhaustion. Unlike a standalone PostgreSQL server that can comfortably idle on 1 GB of memory, self-hosted Supabase deploys an integrated microservices stack of roughly a dozen Docker containers.</p>



<p class="wp-block-paragraph">At a bare minimum, you need <strong>4 GB of RAM, 2 vCPU cores, and 40 GB of SSD storage</strong> to run a stable development, staging, or light MVP instance of self-hosted Supabase. For a production application—especially if you enable the built-in Logflare analytics engine, serve concurrent Realtime WebSockets, or run on-the-fly image transformations—we recommend starting with <strong>8 GB of RAM, 4 vCPU cores, and at least 80 GB of fast SSD or NVMe storage</strong>.</p>



<p class="wp-block-paragraph">In this guide, we break down what every container in the self-hosted Supabase Docker stack actually consumes, how to size your RAM, CPU, and disk space for different workloads (including AI embeddings with <code>pgvector</code>), and how to tune your Linux VPS so your backend stays fast under load.</p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><div><div><a href="#quick-sizing-summary">Quick Answer: Minimum vs Recommended Supabase VPS Specs</a></div><div><a href="#why-self-hosted-supabase-uses-so-much-ram">Why Self-Hosted Supabase Needs More RAM Than Plain PostgreSQL</a></div><div><a href="#how-much-ram-do-you-need">How Much RAM Do You Need for Self-Hosted Supabase?</a></div><div><a href="#how-many-cpu-cores-do-you-need">How Many vCPU Cores Does Supabase Require?</a></div><div><a href="#storage-and-disk-io-requirements">Storage and Disk I/O: Sizing for Database, Buckets, Logs, and Backups</a></div><div><a href="#linux-vps-tuning-tips">How to Optimise a Linux VPS for Self-Hosted Supabase</a></div><div><a href="#choosing-the-right-aveshost-vps">Choosing the Right Aveshost VPS or VDS Plan for Supabase</a></div><div><a href="#faq">Frequently asked questions</a></div></div></nav></div>



<h2 id="quick-sizing-summary" class="wp-block-heading">Quick Answer: Minimum vs Recommended Supabase VPS Specs</h2>



<p class="wp-block-paragraph">When you deploy <a href="https://blog.aveshost.com/self-host-supabase-on-a-vps/">self-hosted Supabase on a Linux VPS</a>, your baseline hardware footprint is determined by the Docker Compose services running in the background—even before your first user signs in. If you size your server as if it were only running PostgreSQL, the Linux kernel OOM killer will eventually terminate either your database container (<code>supabase-db</code>) or your API gateway (<code>supabase-kong</code>) during a traffic spike.</p>



<p class="wp-block-paragraph">Use the sizing matrix below to match your workload to the right VPS tier right from day one:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Workload Tier</th><th>RAM</th><th>CPU</th><th>Storage</th><th>Stack Configuration &amp; Best Use Case</th></tr></thead><tbody><tr><td>Minimum (Dev / Staging / MVP)</td><td>4 GB (+ 4 GB Swap)</td><td>2 vCPU Cores</td><td>40 GB SSD</td><td>Core stack only (Logflare disabled); internal tools, staging servers, and early MVPs</td></tr><tr><td>Recommended Production</td><td>8 GB</td><td>4 vCPU Cores</td><td>80 GB–120 GB SSD/NVMe</td><td>Full stack + Logflare enabled; production SaaS apps, mobile backends, and multi-tenant databases</td></tr><tr><td>High-Concurrency Production</td><td>16 GB</td><td>8 vCPU Cores</td><td>160 GB–250 GB NVMe</td><td>Heavy Realtime WebSockets, dynamic imgproxy image resizing, and high-throughput REST/Auth APIs</td></tr><tr><td>AI &amp; Vector Search (pgvector)</td><td>32 GB+</td><td>8–16 vCPU Cores</td><td>250 GB+ NVMe</td><td>Large HNSW vector indexes kept in RAM, RAG pipelines, and heavy analytical queries</td></tr></tbody></table></figure>



<h2 id="why-self-hosted-supabase-uses-so-much-ram" class="wp-block-heading">Why Self-Hosted Supabase Needs More RAM Than Plain PostgreSQL</h2>



<p class="wp-block-paragraph">Many developers are surprised when a fresh <code>docker compose up -d</code> consumes 1.8 GB to 3.2 GB of RAM with zero active users. That footprint makes sense once you inspect the <a href="https://supabase.com/docs/guides/self-hosting/docker" target="_blank" rel="noopener">official Supabase Docker architecture</a>: instead of a monolithic binary, Supabase coordinates separate containers written in C (PostgreSQL), Lua/Nginx (Kong), Go (GoTrue Auth), Haskell (PostgREST), Elixir/Erlang BEAM (Realtime, Supavisor, and Logflare), Rust (Vector), and TypeScript/Node/Deno (Studio and Edge Functions).</p>



<p class="wp-block-paragraph">Each runtime maintains its own memory heap, garbage collector, and connection pool. Here is what each container in the stack consumes at idle and under normal production load:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Docker Container</th><th>Role in the Stack</th><th>Idle RAM</th><th>Active Production RAM</th><th>Primary Resource Driver</th></tr></thead><tbody><tr><td>supabase-db</td><td>PostgreSQL 15/17 database + extensions</td><td>350 MB</td><td>1 GB – 8 GB+</td><td>shared_buffers, active connections, and index cache</td></tr><tr><td>supabase-kong</td><td>API Gateway &amp; request router</td><td>180 MB</td><td>300 MB – 900 MB</td><td>Worker processes and concurrent HTTP/WebSocket routing</td></tr><tr><td>supabase-realtime</td><td>Elixir Phoenix WebSocket server</td><td>150 MB</td><td>250 MB – 700 MB+</td><td>Concurrent open WebSocket channels and WAL broadcast rate</td></tr><tr><td>supabase-pooler</td><td>Supavisor connection pooler (Elixir)</td><td>130 MB</td><td>200 MB – 450 MB</td><td>Pooled client connections and transaction multiplexing</td></tr><tr><td>supabase-storage + imgproxy</td><td>Object storage API &amp; image resizer</td><td>140 MB</td><td>250 MB – 800 MB+</td><td>Concurrent file streams and on-the-fly image transformations</td></tr><tr><td>supabase-auth (GoTrue)</td><td>JWT authentication &amp; OAuth server</td><td>55 MB</td><td>90 MB – 180 MB</td><td>Concurrent login bursts (CPU-bound password hashing)</td></tr><tr><td>supabase-rest (PostgREST)</td><td>Auto-generated RESTful API layer</td><td>65 MB</td><td>100 MB – 250 MB</td><td>Schema cache size and JSON serialisation throughput</td></tr><tr><td>supabase-edge-functions</td><td>Deno serverless function runtime</td><td>85 MB</td><td>150 MB – 500 MB+</td><td>Number of isolated Deno workers and outbound API calls</td></tr><tr><td>supabase-studio + meta</td><td>Admin dashboard UI &amp; postgres-meta</td><td>160 MB</td><td>220 MB – 400 MB</td><td>Active admin browser sessions and schema introspection</td></tr><tr><td>supabase-analytics + vector</td><td>Logflare &amp; Vector log ingestion (Opt-in)</td><td>550 MB</td><td>900 MB – 1.8 GB</td><td>BEAM VM memory + high-volume log parsing and querying</td></tr></tbody></table></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1376" height="768" src="https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-docker-container-memory-breakdown.webp" alt="Self-hosted Supabase Docker container memory and CPU breakdown across database, core services, and Logflare analytics" class="wp-image-5832" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-docker-container-memory-breakdown.webp 1376w, https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-docker-container-memory-breakdown-300x167.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-docker-container-memory-breakdown-1024x572.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-docker-container-memory-breakdown-768x429.webp 768w" sizes="(max-width: 1376px) 100vw, 1376px" /></figure>



<h2 id="how-much-ram-do-you-need" class="wp-block-heading">How Much RAM Do You Need for Self-Hosted Supabase?</h2>



<p class="wp-block-paragraph">Memory is the single most critical resource in your Supabase VPS requirements calculation. While CPU bottlenecks merely slow down responses for a few hundred milliseconds, running out of RAM causes the Linux kernel to abruptly kill containers—most commonly <code>supabase-db</code>, <code>supabase-analytics</code>, or <code>supabase-kong</code>.</p>



<p class="wp-block-paragraph"><strong>Why 2 GB RAM is not enough:</strong> Even with every optional service stripped out, the core containers plus the Ubuntu operating system and Docker daemon require roughly 1.6 GB to 2.1 GB of memory at startup. The moment you open Supabase Studio or run a database migration, memory usage crosses 2 GB and triggers swap thrashing or an OOM crash.</p>



<p class="wp-block-paragraph"><strong>When 4 GB RAM works well:</strong> In recent releases, Supabase moved the memory-heavy logging stack (<code>supabase-analytics</code> / Logflare and <code>supabase-vector</code>) out of the default <code>docker-compose.yml</code> file into an opt-in overlay file (<code>docker-compose.logs.yml</code>). Because a standard <code>docker compose up -d</code> no longer launches Logflare by default, a <strong>4 GB RAM VPS</strong> with a 4 GB swap file can reliably run the core stack for development environments, staging servers, and low-traffic applications.</p>



<p class="wp-block-paragraph"><strong>Why 8 GB RAM is the production sweet spot:</strong> Once you move a live business application onto your server—or if you enable the Logs Explorer inside Supabase Studio via <code>docker-compose.logs.yml</code>—<strong>8 GB of RAM</strong> gives you the headroom required for stability. On an 8 GB VPS, you can allocate 2 GB to PostgreSQL <code>shared_buffers</code>, allow Logflare and Vector to use 1 GB without starving other containers, and still keep 2 GB to 3 GB free for the Linux page cache.</p>



<p class="wp-block-paragraph"><strong>Sizing RAM for AI and <code>pgvector</code>:</strong> If your application stores OpenAI, Gemini, or local embedding vectors using the <code>pgvector</code> extension, your memory requirements scale directly with the number and dimensionality of your vectors. High-speed HNSW (Hierarchical Navigable Small World) indexes perform best when the entire index graph fits inside RAM. For example, indexing 500,000 vectors with 1,536 dimensions (<code>halfvec</code> or <code>vector</code>) can easily require 4 GB to 6 GB of dedicated memory just for the index, making a <strong>16 GB or 32 GB RAM server</strong> essential.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1376" height="768" src="https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-vps-sizing-tiers-comparison.webp" alt="Recommended VPS sizing tiers for self-hosted Supabase comparing 4 GB MVP, 8 GB production, and 16-32 GB pgvector workloads" class="wp-image-5833" srcset="https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-vps-sizing-tiers-comparison.webp 1376w, https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-vps-sizing-tiers-comparison-300x167.webp 300w, https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-vps-sizing-tiers-comparison-1024x572.webp 1024w, https://blog.aveshost.com/wp-content/uploads/2026/11/supabase-vps-sizing-tiers-comparison-768x429.webp 768w" sizes="(max-width: 1376px) 100vw, 1376px" /></figure>



<h2 id="how-many-cpu-cores-do-you-need" class="wp-block-heading">How Many vCPU Cores Does Supabase Require?</h2>



<p class="wp-block-paragraph">At idle, a self-hosted Supabase stack barely touches the CPU, typically hovering between 2% and 5% utilisation across cores. However, under real production traffic, five distinct operations can saturate a 1-vCPU or 2-vCPU server simultaneously:</p>



<p class="wp-block-paragraph"><strong>Password Hashing in GoTrue (<code>supabase-auth</code>):</strong> Every user sign-up and password login computes a <code>bcrypt</code> or <code>argon2</code> hash, which is intentionally CPU-intensive. A burst of 30 concurrent logins can pin two CPU cores at 100% for several seconds.</p>



<p class="wp-block-paragraph"><strong>Dynamic Image Transformations (<code>supabase-imgproxy</code>):</strong> If you use Supabase Storage&#8217;s built-in image transformation parameters to resize user uploads into WebP or AVIF on the fly, <code>imgproxy</code> uses significant multi-threaded CPU power.</p>



<p class="wp-block-paragraph"><strong>Complex PostgreSQL Queries and RLS Evaluation:</strong> Row-Level Security (RLS) policies execute on every row matched by a PostgREST query. Unindexed foreign keys or complex JWT payload checks inside RLS policies directly increase PostgreSQL CPU usage.</p>



<p class="wp-block-paragraph"><strong>Elixir Realtime Broadcasts:</strong> When database changes are streamed over WebSockets via Logical Replication (<code>wal2json</code>), the Elixir BEAM runtime uses multiple threads to filter RLS permissions and fan messages out to connected clients.</p>



<p class="wp-block-paragraph"><strong>Nightly Database Compression:</strong> Running <a href="https://blog.aveshost.com/backup-and-restore-self-hosted-supabase/">automated Supabase database and storage backups</a> with <code>gzip</code> or <code>zstd</code> compression adds temporary CPU load alongside live traffic.</p>



<p class="wp-block-paragraph">For development and staging, <strong>2 vCPU cores</strong> are sufficient. For any production workload serving real users, provision at least <strong>4 vCPU cores</strong> so background tasks, image resizing, and authentication bursts never block database query execution.</p>



<h2 id="storage-and-disk-io-requirements" class="wp-block-heading">Storage and Disk I/O: Sizing for Database, Buckets, Logs, and Backups</h2>



<p class="wp-block-paragraph">When estimating disk space for self-hosted Supabase, remember that your PostgreSQL tables are only one of four storage consumers on the host filesystem:</p>



<p class="wp-block-paragraph"><strong>Docker Images &amp; Ubuntu OS (12 GB – 18 GB):</strong> The unpacked Docker images for Postgres, Kong, Studio, Elixir, Deno, and Vector—plus Ubuntu system packages—consume around 15 GB before you store a single row of application data.</p>



<p class="wp-block-paragraph"><strong>PostgreSQL Data &amp; WAL Segments (Variable):</strong> Stored inside <code>./volumes/db/data</code>. In addition to your table rows, indexes typically add 30% to 50% overhead, and Write-Ahead Log (WAL) files require several gigabytes of breathing room during heavy writes. Additionally, PostgreSQL requires at least 20% free disk space to run <code>VACUUM</code> and index rebuilds safely.</p>



<p class="wp-block-paragraph"><strong>Supabase Storage Buckets (Variable):</strong> Unlike Supabase Cloud (which stores files in AWS S3 by default), self-hosted Supabase writes uploaded files directly to your VPS disk under <code>./volumes/storage</code> unless you explicitly configure an external S3-compatible backend. If your users upload PDFs, high-resolution photos, or videos, your disk usage will grow rapidly.</p>



<p class="wp-block-paragraph"><strong>Local Backup Staging &amp; Container Logs (10 GB – 30 GB):</strong> Before your nightly backup script uploads archives to off-server object storage, it needs enough local free space to write the compressed <code>.sql.gz</code> and <code>.tar.gz</code> files.</p>



<p class="wp-block-paragraph">Equally important is <strong>disk I/O speed</strong>. Because PostgreSQL commits every transaction to the Write-Ahead Log on disk and PostgREST queries rely on fast random reads, always choose <strong>SSD or NVMe storage</strong> over spinning HDDs. Start with <strong>40 GB SSD</strong> for testing, and <strong>80 GB to 160 GB+ SSD/NVMe</strong> for production—or pair your VPS with external S3-compatible object storage if your app handles terabytes of media uploads.</p>



<h2 id="linux-vps-tuning-tips" class="wp-block-heading">How to Optimise a Linux VPS for Self-Hosted Supabase</h2>



<p class="wp-block-paragraph">Once you have provisioned your server (or after you <a href="https://blog.aveshost.com/migrate-supabase-cloud-to-self-hosted-vps/">migrate from Supabase Cloud to a self-hosted VPS</a>), three quick Linux and Docker configurations will dramatically improve stability and prevent resource exhaustion.</p>



<p class="wp-block-paragraph">First, always configure a <strong>4 GB Linux swap file</strong> with conservative swappiness (<code>vm.swappiness=10</code>). Swap is not a substitute for physical RAM, but it acts as a crucial safety valve during brief memory spikes (such as pulling updated Docker images or building a large PostgreSQL index) so the Linux OOM killer does not terminate your database:</p>



<pre class="wp-block-code"><code># Create and activate a 4 GB swap file on Ubuntu/Debian
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# Only use swap under genuine memory pressure
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf</code></pre>



<p class="wp-block-paragraph">Second, cap Docker container log growth so verbose API and database logs never fill up your SSD over time. Create or update <code>/etc/docker/daemon.json</code> to rotate container logs automatically at 50 MB:</p>



<pre class="wp-block-code"><code>{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "50m",
    "max-file": "3"
  }
}</code></pre>



<p class="wp-block-paragraph">Third, check your live per-container memory and CPU consumption at any time using <code>docker stats --no-stream</code>. On an 8 GB production VPS, you can also tune PostgreSQL inside your database configuration so <code>shared_buffers</code> uses roughly 25% of total system RAM (<code>2GB</code>) and <code>effective_cache_size</code> is set to 50%–70% (<code>5GB</code>), allowing frequent queries to be served directly from memory rather than disk.</p>



<h2 id="choosing-the-right-aveshost-vps" class="wp-block-heading">Choosing the Right Aveshost VPS or VDS Plan for Supabase</h2>



<p class="wp-block-paragraph">Because self-hosted Supabase runs a multi-container Docker stack with persistent PostgreSQL and storage volumes, it cannot run on standard shared cPanel or DirectAdmin web hosting. You need full root SSH access and isolated kernel resources on a Linux Virtual Private Server (VPS) or Virtual Dedicated Server (VDS).</p>



<p class="wp-block-paragraph">At Aveshost, you can match your Supabase deployment to two infrastructure options depending on your traffic and latency goals:</p>



<p class="wp-block-paragraph"><strong><a href="https://www.aveshost.com/self-managed-vps-hosting" rel="noopener">Aveshost Self-Managed VPS Hosting</a>:</strong> Built on fast SSD storage with full root access and Ubuntu LTS support. A 4 GB RAM / 2 vCPU plan is ideal for staging environments, internal tools, and early MVPs, while an 8 GB RAM / 4 vCPU plan gives you comfortable production headroom for the complete Supabase stack.</p>



<p class="wp-block-paragraph"><strong><a href="https://www.aveshost.com/vds-ghana" rel="noopener">Aveshost Ghana VDS (Accra NVMe)</a>:</strong> If your users are primarily in Ghana or West Africa and your application runs heavy database transactions, Realtime WebSockets, or <code>pgvector</code> queries, our Accra-based VDS plans deliver dedicated CPU cores, high-speed local NVMe storage, and ultra-low local network latency.</p>



<p class="wp-block-paragraph">Best of all, starting on a smaller tier never locks you in—as your user base grows, you can scale your VPS RAM, vCPU cores, and disk capacity vertically without rebuilding your Docker stack from scratch. Need help sizing a server for your specific database workload? <a href="https://www.aveshost.com/support" rel="noopener">Contact our technical team</a> and we will help you choose the right configuration.</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-916e9da621cc428cba3f069b2d0467bd" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I run self-hosted Supabase on a 1 GB or 2 GB RAM VPS?</h3>
<div class="rank-math-answer ">

<p>No. Even at idle with zero traffic, the ~11 core Docker containers in self-hosted Supabase require roughly 1.6 GB to 2.1 GB of memory. Running the stack on a 1 GB or 2 GB VPS leads to severe swap thrashing and frequent Linux Out-Of-Memory (OOM) kills. Use at least 4 GB of RAM for development and 8 GB of RAM for production.</p>

</div>
</div>
<div id="faq-question-b1ac42f68b0d43829f3b287509fb3cd8" class="rank-math-list-item">
<h3 class="rank-math-question ">Why is the supabase-analytics (Logflare) container using so much RAM?</h3>
<div class="rank-math-answer ">

<p>Logflare runs on the Erlang/Elixir BEAM virtual machine and ingests, parses, and indexes logs from every container in your stack via Vector. Together, Logflare and Vector can consume 500 MB to 1.8 GB of RAM. In recent Supabase Docker releases, Logflare is separated into an opt-in overlay (docker-compose.logs.yml) so 4 GB servers can run the core stack without Logflare enabled.</p>

</div>
</div>
<div id="faq-question-d6317780562741f883396259a3093561" class="rank-math-list-item">
<h3 class="rank-math-question ">Does Supabase Studio need to stay running in production?</h3>
<div class="rank-math-answer ">

<p>Supabase Studio (supabase-studio) and its companion metadata service (supabase-meta) only provide the browser-based admin dashboard—they are not in the request path of your live application&#8217;s REST, Auth, Realtime, or Storage APIs. If you are on a tight 4 GB RAM budget, you can stop supabase-studio when you are not actively managing the database to free up roughly 150 MB to 250 MB of RAM.</p>

</div>
</div>
<div id="faq-question-5a1158fb3ee0483fb2283c5ac11e3188" class="rank-math-list-item">
<h3 class="rank-math-question ">How much extra RAM do I need if I use pgvector for AI embeddings?</h3>
<div class="rank-math-answer ">

<p>For fast similarity searches, pgvector HNSW indexes should fit entirely in RAM alongside your standard PostgreSQL shared_buffers. As a rule of thumb, 100,000 vectors with 1,536 dimensions require roughly 800 MB to 1.2 GB of RAM for the HNSW index. If you store hundreds of thousands or millions of vectors, plan for a 16 GB or 32 GB RAM VPS.</p>

</div>
</div>
<div id="faq-question-c59c4153702f465792110a3a0f075a08" class="rank-math-list-item">
<h3 class="rank-math-question ">Can I upgrade my VPS RAM and CPU later without losing Supabase data?</h3>
<div class="rank-math-answer ">

<p>Yes. Because all stateful Supabase data lives in persistent Docker volumes (./volumes/db, ./volumes/storage, and ./volumes/functions), vertically scaling your VPS to a higher RAM and vCPU tier takes only a brief reboot and automatically gives your existing containers access to the upgraded hardware.</p>

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