This Bash script automates the setup of a lightweight Ubuntu desktop environment with XRDP remote access, browsers, productivity tools, and firewall rules on Ubuntu 22.04.
- Installs the XFCE desktop environment (lightweight and fast)
- Sets up XRDP for Remote Desktop access
- Installs:
- Firefox and Chromium web browsers
- LibreOffice suite
- Visual Studio Code
- Creates a new sudo user for RDP access
- Configures firewall (UFW) for SSH and RDP
- Cleans up unnecessary desktop packages
- Ubuntu 22.04 (fresh installation recommended)
- Internet connection
- Run as a user with
sudo
privileges
git clone https://github.com/kogulan/ubuntu-xrdp-setup.git
cd ubuntu-xrdp-setup
Or simply download and run the script:
wget https://yourdomain.com/setup-xrdp-xfce.sh
chmod +x setup-xrdp-xfce.sh
Run the script with sudo
privileges:
sudo ./setup-xrdp-xfce.sh
The script will prompt you to:
- Enter a username for the new RDP user (or press Enter to use the default
kogulan
). - Confirm that you want to proceed with the installation.
- Set a password for the new user.
The script will then automate the entire setup process, including cleaning old packages, installing the desktop and applications, and configuring the firewall.
Use any RDP client (like Remote Desktop Connection on Windows or Remmina on Linux/macOS):
- Host/IP: (shown at the end of the script)
- Port:
3389
- Username:
kogulan
(or your custom value) - Password:
StrongPass123
(or your custom value)
Example:
Username: kogulan
Password: StrongPass123
RDP Address: 203.0.113.15:3389
Do not use weak passwords for remote access. It’s strongly recommended to:
- Use SSH key-based login instead of passwords (for SSH)
- Change the password after logging in
- Use fail2ban or other brute-force protection if exposed to the internet
To remove all installed components:
sudo apt purge -y xfce4 xfce4-goodies xrdp firefox chromium libreoffice code
sudo apt autoremove -y
[*] Cleaning up previously installed desktop environments...
[*] Updating system...
[*] Installing XFCE Desktop Environment...
[*] Installing XRDP...
[*] Creating user 'kogulan'...
[*] Installing Firefox and Chromium browsers...
[*] Installing LibreOffice office suite...
[*] Installing Visual Studio Code...
[*] Setting up UFW firewall rules...
✅ XRDP with XFCE, LibreOffice, and VS Code is ready on Ubuntu 22.04!
🌐 Browsers: Firefox, Chromium
📝 Office: LibreOffice
💻 Editor: Visual Studio Code
🔐 RDP Login: kogulan / StrongPass123
🌍 Connect: 203.0.113.15:3389
- ✅ Ubuntu 22.04 LTS (64-bit)
Feel free to open an issue or submit a pull request to improve the script or add support for additional configurations!
Kogulan
Feel free to customize and use in your own deployment workflows.