<?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>Remote Desktop &#8211; Aveshost Blog</title>
	<atom:link href="https://blog.aveshost.com/tag/remote-desktop/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.aveshost.com</link>
	<description>Your Blueprint for Online Success</description>
	<lastBuildDate>Sat, 21 Nov 2026 18:49:46 +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>Remote Desktop &#8211; Aveshost Blog</title>
	<link>https://blog.aveshost.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 fetchpriority="high" 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 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>
	</channel>
</rss>
