DEV Community

Cover image for Install Ubuntu Desktop on Any Ubuntu Server
Fady Mondy
Fady Mondy

Posted on

Install Ubuntu Desktop on Any Ubuntu Server

some developers need to use a cloud server as a personal computer for fast development and remote use, and it's a very good idea but, how can install an Ubuntu desktop on it?

it's easy to do this by following some commands:

let's start by installing tasksel

 sudo apt install -y tasksel
Enter fullscreen mode Exit fullscreen mode

now you are ready to install ubuntu-desktop use this command

sudo apt install -y ubuntu-desktop
Enter fullscreen mode Exit fullscreen mode

cloud servers by default don't have a display so you need to set a graphical target to up the GUI

sudo systemctl set-default graphical.target
Enter fullscreen mode Exit fullscreen mode

and WOW, it's working now.

Install XRDP

if you like to get a Remote control using RDP you can follow these steps, let's start by installing xrdp

sudo apt install xrdp -y
Enter fullscreen mode Exit fullscreen mode

now we need to add SSL to xrdp using this command

usermod -a -G ssl-cert xrdp
Enter fullscreen mode Exit fullscreen mode

now we need to add some commands to make xrdp auto-start

echo 'Unset DBUS_SESSION_ADDRESS' >> /etc/xrdp/startwm.sh
echo 'Unset XDG_RUNTIME_DIR' >> /etc/xrdp/startwm.sh
Enter fullscreen mode Exit fullscreen mode

now xrdp is ready to connect we have just 1 step, we need to allow port 3389 to access xrdp

ufw allow from 192.168.1.0/24 to any port 3389
ufw reload
Enter fullscreen mode Exit fullscreen mode

now you can connect with any RDP client to your remote server.

Top comments (0)