How to Self-Host RustDesk Remote Desktop Server on Contabo VPS (TeamViewer Alternative)
Contabo High-Performance Cloud VPS
Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.
The Problem with Commercial Remote Desktop Tools
Commercial remote desktop tools like TeamViewer and AnyDesk have become increasingly frustrating for IT administrators and developers, imposing aggressive "Commercial Use Detected" timeouts, rising subscription rates, and privacy concerns. RustDesk is an open-source, self-hosted remote desktop software written in Rust that delivers smooth 60 FPS desktop streaming with end-to-end encryption.
Step 1: Deploying RustDesk ID and Relay Servers with Docker
RustDesk consists of two core components: hbbs (ID/rendezvous server) and hbbr (relay server). Create a dedicated directory on your Contabo VPS:
mkdir -p ~/rustdesk && cd ~/rustdesk
nano docker-compose.yml
services:
hbbs:
image: rustdesk/rustdesk-server:latest
container_name: hbbs
command: hbbs -r YOUR_CONTABO_IP:21117 -k _
volumes:
- ./data:/root
network_mode: host
restart: always
hbbr:
image: rustdesk/rustdesk-server:latest
container_name: hbbr
command: hbbr -k _
volumes:
- ./data:/root
network_mode: host
restart: always
Launch the relay containers:
docker compose up -d
Step 2: Opening Required Firewall Ports in UFW
RustDesk requires specific TCP and UDP ports for NAT traversal and encrypted streaming:
sudo ufw allow 21115:21119/tcp comment "RustDesk TCP"
sudo ufw allow 21116/udp comment "RustDesk UDP"
sudo ufw reload
Step 3: Obtaining Your Server Public Encryption Key
RustDesk generates a cryptographic public key in ./data/id_ed25519.pub:
cat ~/rustdesk/data/id_ed25519.pub
Step 4: Configuring Desktop and Mobile Clients
Download the free RustDesk client on your Windows, macOS, Linux, or Android device. Navigate to Settings -> Network -> ID/Relay Server:
- ID Server:
YOUR_CONTABO_IP - Relay Server:
YOUR_CONTABO_IP:21117 - Key: Paste the contents of your
id_ed25519.pubkey.
Your client will immediately show a green status light: Ready. You can now establish high-speed, encrypted remote desktop connections globally with zero third-party intermediaries.
Editorial Verdict: Pros & Cons
What We Love (Pros)
- Replace expensive TeamViewer ($50+/mo) and AnyDesk subscriptions with your own private server
- End-to-end cryptographic encryption guarantees no third party can eavesdrop on desktop sessions
- Zero connection timeouts, commercial use warnings, or bandwidth throttling
- Contabo VPS provides low latency and unlimited monthly bandwidth across US and EU nodes
Drawbacks (Cons)
- Requires opening multiple custom TCP/UDP ports in your server firewall
Deploy Your Contabo Cloud Server
Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.
Written by Alex Vance
Cloud Infrastructure Architect
Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.
Recommended Next Reads
Hostinger vs Contabo VPS (2026): Real Benchmark Test & In-Depth Comparison
A comprehensive, benchmark-driven comparison between Hostinger and Contabo VPS. We tested Geekbench CPU scores, NVMe I/O, network latency, and hPanel vs CLI.
Hostinger Review (2026): Is It Truly the Best Web Hosting for the Price?
We stress-tested Hostinger's Premium and Cloud Startup plans across 180 days. Read our honest review covering uptime, LiteSpeed speed tests, and renewal fees.