How to Install RustDesk Remote Desktop Server on Ubuntu 26.04
RustDesk is an open-source remote desktop tool that enables secure and private connections. Below is a complete guide to set it up on Ubuntu 26.04 using Docker, Docker Compose, Nginx, and SSL.
Prerequisites
- Ubuntu 26.04 server
- A subdomain (e.g., rust.example.com) pointing to your server's IP
- Docker and Docker Compose
- Non-root sudo user with SSH access
Install Docker & Docker Compose
sudo apt update
sudo apt install -y docker.io
sudo systemctl enable --now docker
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Set Up RustDesk Server Using Docker Compose
sudo mkdir -p /opt/rustdesk
cd /opt/rustdesk
sudo nano rustdesk.yml
Paste the following into rustdesk.yml:
version: '3'
networks:
rustdesk-net:
external: false
services:
hbbs:
container_name: hbbs
ports:
- 21115:21115
- 21116:21116
- 21116:21116/udp
- 21118:21118
image: rustdesk/rustdesk-server:latest
command: hbbs -r 127.0.0.1:21117 -k _
volumes:
- ./hbbs:/root
networks:
- rustdesk-net
depends_on:
- hbbr
restart: unless-stopped
hbbr:
container_name: hbbr
ports:
- 21117:21117
- 21119:21119
image: rustdesk/rustdesk-server:latest
command: hbbr -k _
volumes:
- ./hbbr:/root
networks:
- rustdesk-net
restart: unless-stopped
Save the file and run:
sudo docker-compose -f rustdesk.yml up -d
sudo docker ps
Install and Configure Nginx
sudo apt install -y nginx
sudo ufw allow 80/tcp
sudo ufw enable
sudo ufw reload
Create Nginx configuration:
sudo nano /etc/nginx/conf.d/rust.example.com.conf
Add the following (replace domain):
server {
listen 80;
listen [::]:80;
server_name rust.example.com;
location / {
proxy_pass http://127.0.0.1:21117;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Test and restart Nginx:
sudo nginx -t
sudo systemctl restart nginx
Secure with SSL (Certbot)
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d rust.example.com
Reload Nginx:
sudo nginx -t
sudo systemctl reload nginx
Get Public Key for Client Configuration
cat /opt/rustdesk/hbbs/id_ed25519.pub
Copy the output key.
Configure the RustDesk Client
- Download the client from https://rustdesk.com/
- Open client → Settings → ID/Relay Server
- Enter:
- ID Server: rust.example.com
- Key: Paste the copied key
- Save and connect
Test the Setup
- Install RustDesk client on another device
- Use the remote ID of target system
- Connect via your private server
🎉 You now have a fully working RustDesk server with Docker, Nginx, and SSL on Ubuntu 26.04!
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS