Connect to Ubuntu VPS using RDP

Written By :

Category :

GNOME

,

RDP

,

Ubuntu

,

VPS

Posted On :

Share This :

  • If you have Ubuntu 22.04 setup on cloud server then first, you need to install desktop environment.
  • This command will allow you to install desktop environment.
sudo apt install ubuntu-gnome-desktop -y

  • You can also use taskel command to install Ubuntu desktop full GUI.
sudo apt install tasksel
sudo tasksel install ubuntu-desktop
sudo reboot

  • Now reboot your VPS
sudo reboot

  • Now install RDP client on your Ubuntu server
sudo apt install xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp

  • You also need to whitelist the RDP port, by default RDP uses 3389. Make sure to whitelist this port on your VPS service providers portal if they use firewall.
  • This command will allow anyone to connect to your VPS Port 3389
sudo ufw allow from any to any port 3389 proto tcp

  • Now add a user to access the Ubuntu server using RDP client.
  • You can add user name and password using the following command.
  • Once you add username next prompt will ask you to add password.
sudo adduser ADD-YOUR-USER-NAME-HERE

  • Now following command will allow your new user to access xrdp client on Ubuntu server and then reboot the server.
sudo usermod -G xrdp YOUR-USER-NAME
sudo reboot

  • Now you will be able to connect to your VPS server using the Windows RDP client and the Public IP address of you VPS.