기본 콘텐츠로 건너뛰기

Self-Hosted RustDesk Server Setup: Docker & Proxmox VE LXC (+ Client Config Guide)

RustDesk Self-hosted Guide

Self-host a RustDesk Server: Two Ways — Linux Docker and Proxmox VE LXC

A private remote-control setup that uses fast P2P direct connections at home and your own server as a relay gateway when you're away.

Linux Docker Proxmox VE LXC hbbs / hbbr macOS / Windows / Linux Client
What this post covers
  1. Why bother self-hosting RustDesk
  2. What a self-hosted RustDesk server does
  3. Option A: Install on a Linux server with Docker Compose
  4. Option B: Install on Proxmox VE as an LXC
  5. Common port forwarding and the security key
  6. Client setup for Windows, macOS, and Linux
  7. Connection test and shortcut tips

1. Why bother self-hosting RustDesk

My main reason for running RustDesk as a self-hosted server is simple. In an environment that mixes Mac, Windows, and Linux, every existing remote-control option felt a little awkward in its own way.

The limits of Mac VNC

Apple VNC is quite fast between Apple devices thanks to its own codec. But the moment you go from a Mac to Windows or Linux, you need a separate VNC client and the perceived speed drops considerably.

The hassle of Windows ↔ Linux

Connecting Windows and Linux means setting up an RDP-style config separately. RDP under Wayland in particular is tricky to deal with, and Remmina has a clunky UI with settings that feel complicated.

Services like TeamViewer or Chrome Remote Desktop are convenient, but their relay servers live outside your network. So speed depends on the state of an external server and the network path, and there's a lingering security concern about entrusting your personal machines to them indefinitely.

A self-hosted RustDesk server is a choice to reduce that friction. At home you connect as directly as possible at LAN speed, and when you're away you use the server you built as the relay point. In other words, it unifies cross-OS remote control into a single client experience while bringing the relay point onto your side.

2. What a self-hosted RustDesk server does

If you just use RustDesk as-is, it locates device IDs and attempts connections through the default public server. Setting up your own server brings that role into your home or your own server. Instead of relying on an external company's relay, your server takes on the roles of ID server and relay server.

A RustDesk server is split into two main services. hbbs is the ID server that finds where a device is, and hbbr is the relay server that forwards screen and input data on your behalf when a direct P2P connection fails.

When two devices at home are on the same LAN, they connect directly via P2P whenever possible; when a direct connection is hard because of an external network or NAT, they are relayed through your RustDesk server.

3. Option A: Install with Linux Docker Compose

For a regular Ubuntu, Debian, mini PC, or NAS-style Linux server, Docker Compose is the easiest to manage. Server data stays in a separate folder, and you can bring just the containers up and down easily.

2-1. Create a working folder

mkdir -p ~/rustdesk-server/data
cd ~/rustdesk-server

2-2. Write compose.yml

In the example below, change 192.168.0.15 to your actual Linux server's internal IP or DDNS address. As in the original docs, adding the -k _ option requires clients to enter the public key before they can use the server.

services:
  hbbs:
    container_name: rustdesk-hbbs
    image: rustdesk/rustdesk-server:latest
    command: hbbs -r 192.168.0.15:21117 -k _
    volumes:
      - ./data:/root
    ports:
      - "21115:21115"
      - "21116:21116"
      - "21116:21116/udp"
      - "21118:21118"
    depends_on:
      - hbbr
    restart: unless-stopped

  hbbr:
    container_name: rustdesk-hbbr
    image: rustdesk/rustdesk-server:latest
    command: hbbr -k _
    volumes:
      - ./data:/root
    ports:
      - "21117:21117"
      - "21119:21119"
    restart: unless-stopped
The official RustDesk docs also recommend the network_mode: "host" approach on Linux Docker. If port mapping gets confusing, host networking is simpler; if you want to clearly separate ports as on a shared server or NAS, run it with the port-mapping approach above.

2-3. Run the containers

docker compose up -d
docker compose ps

2-4. Check the public key

This value goes into every client's settings. Copy the entire long string that's printed.

cat data/id_ed25519.pub

4. Option B: Install on Proxmox VE as an LXC

If you already run Proxmox VE, it's cleaner to isolate the RustDesk server in an LXC container. The original docs' example sets the LXC internal IP to 192.168.0.15 and accesses the web admin dashboard at http://192.168.0.15:21114.

3-1. Create the LXC from the Proxmox VE Shell

If you use a community Helper Script, you can run the RustDesk Server LXC script from the Proxmox VE Shell to create the container. It's a good idea to review the script's contents once before running it.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/rustdeskserver.sh)"

3-2. Check the LXC IP and dashboard

Example LXC internal IP

192.168.0.15

Web admin dashboard

http://192.168.0.15:21114

3-3. Check the public key from the LXC console

In the Proxmox web GUI, select the RustDesk LXC, go to the Console tab, and run the command below.

cat /var/lib/rustdesk-server/id_ed25519.pub

The long string that's printed is the public key for the client's Key field. Enter the same value in every client — macOS, Windows, and Linux.

3-4. Reset the admin password

If you can't log into the web dashboard or don't know the initial password, set a new admin password from the LXC console.

cd /var/lib/rustdesk-api
rustdesk-api reset-admin-pwd your-desired-password

Then open http://192.168.0.15:21114 in a browser and log in with the username admin and the password you just set.

5. Port forwarding

To connect from outside your home, your router must forward ports to the RustDesk server's IP. If you'll only use it internally, you can skip router port forwarding — but if you want external access, check the ports below.

PortProtocolRoleNotes
21114TCPWeb admin dashboard / APIOpen carefully, only if you view the dashboard externally
21115TCPNAT type test and auth handlingRequired
21116TCP / UDPID registration, heartbeat, hole punchingMost important. UDP is needed too
21117TCPRelay server hbbrRelays when P2P fails
21118TCPWebSocket for the web clientOptional if you don't use the web client
21119TCPRelay WebSocketOptional if you don't use the web client
For an external address, a DDNS hostname is more convenient than a public IP. For example, if you set myhome.duckdns.org as the ID and relay server address, you can keep using the same settings from outside your home.

6. Client setup: common to Windows, macOS, and Linux

Whether you built the server with Docker or a PVE LXC, the client setup is almost the same. Launch RustDesk on every device, then go to Network or ID/Relay Server settings from the menu next to your ID.

  1. ID Server: Enter the RustDesk server's IP or DDNS address. e.g. 192.168.0.15 or myhome.duckdns.org
  2. Relay Server: Enter the same address. It's sometimes inferred if left blank, but in a homelab it's less confusing to specify it.
  3. API Server: For an OSS server, usually leave it blank. Enter it only when using Pro or web-console account features.
  4. Key: Paste the entire id_ed25519.pub string you got from the server.
  5. Press Apply and confirm the bottom of the main screen shows Ready.

Example client input

If you test on the LAN first, put the RustDesk server's internal IP into both the ID server and Relay server as shown below. The example uses 192.168.0.15 and leaves the API server blank. In the last Key field, paste the entire id_ed25519.pub public key copied from the server.

RustDesk client network settings example screen
RustDesk Settings → Network → ID/Relay server input example. For internal testing, enter the server's internal IP; for external access, switch to a DDNS address.

Required permissions when macOS is the remote target

When using a Mac as the controlled host, you must grant macOS security permissions. In System Settings → Privacy & Security, find RustDesk and allow the following.

  • Screen Recording
  • Accessibility
  • Input Monitoring: grant this too when you need complex shortcuts or input control

After changing permissions, you must fully quit and relaunch RustDesk for them to take effect.

Installing the Linux viewer

When Linux acts only as the viewer that watches the remote screen, it runs into fewer screen-capture permission issues. On Ubuntu/Debian, install the official release .deb package, or use Flatpak/AppImage regardless of distribution.

sudo apt update
sudo apt install ./rustdesk-*.deb
flatpak install flathub com.rustdesk.RustDesk

7. Connection test and shortcut tips

Check the 9-digit ID shown on the RustDesk screen of the computer to be controlled, then enter that ID in the remote-desktop field on the controlling computer and connect. Enter the password or approve it on the other side's screen, and the session opens.

For a device you connect to all the time, set a Permanent Password on the remote target so you don't have to check the ever-changing temporary password each time.

When controlling a Mac from a Linux or Windows keyboard, the Win/Super key usually acts like macOS's Command key. For example, Win + C in the Linux viewer is delivered as Cmd + C (copy) on the Mac host.

If it doesn't feel right, adjust the Ctrl-to-Command mapping in the keyboard options on the top toolbar during a RustDesk session.

Final checklist

  • Confirm both hbbs and hbbr are running on the server
  • Confirm the client's ID Server, Relay Server, and Key all point to the same server
  • If external access fails, first check whether 21116 UDP port forwarding is missing
  • If the Mac screen isn't visible, check Screen Recording permission; if mouse/keyboard don't work, check Accessibility permission
  • If you regenerate the public key or change the data folder, update the Key on every client again

댓글

이 블로그의 인기 게시물

스노우쿨링 장소로 유명한 마우이 카팔루아 비치 (Kapalua Beach)

마우이 북쪽에 카팔루아 비치라고 유명한 스노우 쿨링 장소가 있습니다. 주차장은 카팔루아 비치를 따라 트레일 코스가 있는데 비치 이용자 및 트레일러를 위한 무료 주차장이 있습니다.  아침 9시 이전에 가면 주차장이 널널 합니다. 주차장은 점심 시간대쯤 되니 만차가 되네요. 주차장을 통해 화장실쪽으로 걸어들어오면 해변을 만날 수 있습니다. 화장실 앞에 짠물을 헹궈내는 샤워기가 있고 해변 앞에도 있습니다. 해변쪽 보다 화장실 앞에 있는게 수압이 더 쎄더군요 숙소가 이 근처라서 아침일찍 산책길에 들렸더니 너무 이른 아침이라서 그런지 사람이 별로 없네요. 시간이 지나면 사람들이 갑자기 많아집니다. 파도가 약간 있습니다. 저 파도치는데는 물고기가 없습니다. 깊숙히 들어가야 합니다. 아침 밥을 먹고 아이들을 데리고 이곳에 다시 왔습니다. 숙소에서 비치타월을 들고 10여분 정도 걸어 왔습니다. 물고기가 별로 없어서 아 여기가 왜 마우이 최고의 스노우 쿨링 장소 일까 하고 후회 하고 있는데 저 돌 가까이 가봅니다. 우와 물고기가 돌사이에 제법 많네요 그러나 약간 파도가 있어서 돌에 너무 가까이 가면 부딪힐 위험이 있습니다. 스노우 쿨링 좋은 장비를 마련하지 못해서 특히 구명쪼기가 없어서 깊숙히 못 들어가봤는데 저는 약간의 수영실력으로 구명조끼 없이 물안경 하나로 깊숙히 헤염쳐서 사람들이 몰려있는 바다 깊숙히 들어가 봅니다. 물고기가 제법 많습니다. 특히 뼈만 있는 투명한 물고기는 인상적이네요. 아이들을 데리고 그나마 발이 조금 닿는 돌 옆 가까이 가서 겨우 물고기를 보여줍니다. 구명 조끼도 없이 아이들 발이 닿지 않아 불안 불안 하면서 옆에서 계속 아이가 관찰 할 수 있도록 보호 해줍니다. 구명조끼등 스노우 쿨링 장비가 있었으면 훨씬 좋았을텐데 조금 아쉬웠습니다. 해변을 따라 트레일 코스에 대한 안내입니다. 이곳엔 고급 리조트들도 많으니 구경 삼아 트레일 하는것도 좋을 것 같습...

샌프란시스코 길로이 아울렛 Gilroy Outlet

샌프란시스코 여행때 길로이 아울렛을 한국 분들은 참 많이 들리시죠. 미국 브랜드 옷을 싸게 살수 있는것 같습니다. 그러고 보면 이런 현상이 벌어지는 이유가 한국 백화점에서 미국 브랜드 옷을 2배나 가까이 비싸게 팔고 있다는 점입니다. 심한경우 3배나 비싸죠... 반성 해야 합니다. 길로이 아울렛은 샌프란시스코에서 101번 고속도로를 타고 한참 내려가야 합니다. 2시간쯤 내려가야 할껍니다. 고속도로 근처에 있어서 찾기는 쉬울꺼예요. 샌프란시스코는 약간 가을날씨 같은데 길로이까지 내려오면 낮에 오면 햇볕이 뜨거워 완전 여름입니다. 길로이 아울렛은 아래 제가 블로그에 썼듯이 하와이 와이켈레 아울렛과 같은 운영회사 인가 봅니다. http://comhack.blogspot.kr/2018/02/blog-post_18.html http://www.premiumoutlets.com  여기서 회원을 가입하고 쿠폰북을 출력하시거나 회원을 증빙하는 바우처 같은거 출력해가서 Information Center 로 가셔서 쿠폰북을 교환하는 것이 할인율이 좋죠 하와이 와이켈레와 마찬가지로 가성비는 코치가 좋습니다. 그리고 크록스도 좋습니다. 제가 갔을땐 Buy one, get one free 행사를 했습니다. (예전 블로그에서도 썼듯이 1+1 은 콩글리쉬 입니다. 1+1 = 2 입니다. ㅠㅠ) 크록스에서 아이들 슬리퍼 한켤레 샀는데 하나 더 가져오라고 합니다. 그런데 두개 신발중 비싼 신발 가격으로 계산이 되니 아울렛에서 Buy one, get one free 행사에서 가장 좋은 팁은 비슷한 가격대 신발이나 옷을 골라오는게 좋습니다. (직원이 계산시 설명해줘요 친절하게~ 비슷한 가격으로 가지고 오시는게 좋다고 ^^) 크록스 사이즈는 미국 단위로 암호같아서 우리나라 센치 단위로는 잘 모를꺼예요 미리 알고 가면 좋아요  https://www.crocs.co.kr/size-charts/fit-guide.html 저는 미리 정보를 좀 알고가...

하와이 로컬 슈퍼마켓 푸드랜드 팜스 (Foodland Farms) 연구

빅아일랜드 코나 지역에서 힐튼 와이콜리아 빌리지 호텔에 묵었지만 호텔에 딸려있는 레스토랑은 줄도 길고 너무 비싸고 맛도 없다는것을 금방 알게 됩니다. 특히 팁 세금 까지 합하면 아이들과 도니 &토니스 피자에서 피자 한판 먹는데 7만원이 넘어요. 저는 비용 때문에 호텔에 있는 고급 레스토랑을 자주 가진 않았는데 몇군데 가본결과 가성비는 별루 였던것 같습니다. 맛도 없는데 다른 블로그에서 왜 자랑질 하는지 모르겠어요 ㅠㅠ 뷰는 분위기 있고 좋았던것 같습니다. 코나지방이면 코나 공항 근처까지 가서 코스트코 피자가 10달라 선이니 코스트코 피자사오는게 이게 더 맛있고 양도 풍부합니다. (코스트코 피자 정도는 코스트코 회원 안들어도 살수 있어요. ) 연구도중 하와이 로컬 슈퍼마켓 Foodland Farms 를 알게 됩니다. 코나 힐튼에서 차로 15분거리입니다. 미국에서 슈퍼마켓이 15분 거리에 있다는것은 행운이죠... 빅 아일랜드는 뭐든 엄청 멀어요 Foodland Farms 가 좋은 점은 한국 입맛에 맞는 도시락을 팝니다. 가격도 괜찮습니다. 가끔 멀리 호텔을 나와서 점심 피크닉할때 도시락가져가면 피크닉테이블에서 맛있게 먹을수 있습니다. 팁도 필요 없어요 ^^ 미국은 회원제 슈퍼마켓이 많습니다. 대표적으로 코스트코죠 그런데 연회비를 받네요 코스트코 연회비는 한국이 제일 쌉니다. 푸드랜드도 회원제이긴한데 회원을 들지 않아도 구매 가능합니다. 회비도 없어요 자주 가실꺼면 회원을 들고 maikai card를 만드는게 할인율 측면에서 좋을것 같습니다. https://www.foodland.com/maikai-card 아래와 같이 생겼고 카운터나 사무실가서 만들어 달라고 하면 바로 만들어 줍니다. 바로 사용 가능합니다. 앱도 있어서 앱의 바코드를 제시하면 되는데 한국 앱스토에서는 다운로드가 안되네요. Maikai 카드를 만들면 기본적인 여러가지 품목에 회원 할인을 해주고 (아마도 푸드랜드 도시락이나 여기서 만드는 음식들은 ...