π― Transform any bare Ubuntu 22.04 VPS into a secure, fully-featured remote desktop β in one command.
Production-grade Β· Open Source Β· Multi-Provider Β· ARM64 + amd64
β¨ Features β’ π Quick Start β’ π Requirements β’ π§ Customization β’ π Troubleshooting
VPS Master Setup v2.0 is a production-ready, single-script automation tool that converts a fresh Ubuntu 22.04 VPS into a secure remote desktop environment with zero manual configuration.
Whether you're a developer needing a persistent cloud workstation, a sysadmin managing remote infrastructure, or a power user running 24/7 automation β this script handles everything: desktop environment, RDP server, VPN, swap, firewall, browsers, and security hardening.
π₯ No GitHub required. Download once, run anywhere. Works on DigitalOcean, Linode, Vultr, Hetzner, OVH, Contabo, Oracle Cloud, AWS, GCP, Azure, and more.
- UFW Firewall with SSH-only public access
- Fail2Ban intrusion prevention (brute-force protection)
- Root SSH login completely disabled
- RDP port 3389 blocked from public internet (Tailscale VPN only)
- SSH drop-in hardening (
/etc/ssh/sshd_config.d/) β no config overwrite - Manual password prompt β no hardcoded credentials, ever
- ZRAM compressed RAM swap β dynamic size (2x RAM, 1β4GB range)
- Traditional swapfile fallback β also dynamically sized
- Kernel sysctl tuning (
swappiness,dirty_ratio,tcp_syncookies) vm.overcommit_memory=0β safe heuristic (no OOM surprises)- XRDP 24-bit color mode β 2x faster than 32-bit
- Full XFCE4 lightweight desktop environment
- XFCE4 Goodies β 40+ plugins pre-installed
- Thunar file manager, terminal, task manager, screenshot tool
- Black screen fix applied automatically
- Firefox from Mozilla's official APT repo (not Snap β no lag)
- Google Chrome stable (amd64) / Chromium (ARM64) β auto-detected
- GPU software rendering enabled for VPS compatibility
- amd64 + ARM64 architecture auto-detection
- Supports all major VPS providers β all mirror URLs normalized
- Ubuntu version check with graceful warnings
- Full setup log at
/var/log/vps-master-setup.log - Tailscale auth key support (
TS_AUTH_KEY) for fully unattended deploys
- Re-runnable without duplicates or breaking existing setup
- Drop-in config files β never overwrites original system configs
- Every step has error handling and fallbacks
| Component | Technology |
|---|---|
| OS | Ubuntu 22.04 LTS |
| Desktop | XFCE4 + XFCE4-Goodies |
| Remote Access | XRDP + Tailscale VPN |
| Firewall | UFW + Fail2Ban |
| Swap | ZRAM + Traditional Swapfile (dynamic) |
| Browsers | Firefox (Mozilla) + Chrome / Chromium |
| Script | Bash (POSIX-safe, set -euo pipefail) |
| Arch | amd64 (x86_64) + ARM64 |
| Component | Minimum | Recommended |
|---|---|---|
| OS | Ubuntu 22.04 LTS | Ubuntu 22.04 LTS (fresh) |
| CPU | 1 Core | 2+ Cores |
| RAM | 1 GB | 2β4 GB |
| Storage | 15 GB | 30+ GB |
| Architecture | amd64 or ARM64 | amd64 |
| Network | Any | 10+ Mbps |
DigitalOcean Β· Linode (Akamai) Β· Vultr Β· Hetzner Β· OVH Β· Contabo Β· Oracle Cloud Β· AWS EC2 Β· GCP Β· Azure
# Step 1 β Install tmux (keeps session alive if SSH drops)
apt install tmux -y && tmux new -s vps-setup
# Step 2 β Run the installer
curl -fsSL https://raw.githubusercontent.com/technicalboy2023/vps-master-setup/main/install.sh | sudo bashπ‘ Why tmux? If your SSH connection drops mid-install,
tmux attach -t vps-setupreconnects you to the running session.
# Download the script
wget https://raw.githubusercontent.com/technicalboy2023/vps-master-setup/main/install.sh
# Review it first (recommended)
cat install.sh
# Run it
sudo bash install.sh# Set your Tailscale auth key β no browser auth needed
export TS_AUTH_KEY="tskey-auth-xxxxxxxxxxxx"
curl -fsSL https://raw.githubusercontent.com/technicalboy2023/vps-master-setup/main/install.sh | sudo -E bashGet your auth key at: login.tailscale.com/admin/settings/keys
During setup, you'll be prompted to set a password for user aman:
[6/14] Creating admin user: aman
Enter password for user 'aman': ββββββββ (hidden input)
Confirm password: ββββββββ (hidden input)
[INFO] User 'aman' created.
[INFO] Password set successfully.
Password rules enforced:
- Minimum 8 characters
- Must be confirmed (re-typed)
- Empty password rejected
When the script reaches step 14, it prints a URL:
========================================================
ACTION REQUIRED: Authenticate Tailscale
Open the URL below in your browser:
========================================================
To authenticate, visit:
https://login.tailscale.com/a/xxxxxxxxxxxxxxx
========================================================
Open this URL on your phone or laptop to authorize the VPS on your Tailscale network.
tailscale ip -4Host : <tailscale-ip>:3389
Username : aman
Password : (what you entered during setup)
reboot
β οΈ A reboot is required to load the updated kernel and activate all swap/sysctl settings.
πͺ Windows β Remote Desktop Connection
- Press
Win + Rβ typemstscβ Enter - Enter:
<tailscale-ip>:3389 - Username:
aman - Password: (your setup password)
π macOS β Microsoft Remote Desktop
- Install Microsoft Remote Desktop from App Store
- Add PC β
<tailscale-ip>:3389 - Username:
aman, Password: (your setup password)
π§ Linux β Remmina or xfreerdp
# Install Remmina
sudo apt install remmina -y
# Or use xfreerdp directly
xfreerdp /v:<tailscale-ip> /u:aman /p:yourpassword /dynamic-resolutionπ± Mobile β iOS / Android
- Install Microsoft Remote Desktop from App Store / Play Store
- Add PC β Tailscale IP β Connect
π¦ Full Package List
Desktop Environment
xfce4β Core XFCE4 desktopxfce4-goodiesβ 40+ pluginsxfce4-sessionβ Session managerxfce4-terminalβ Terminal emulatorthunarβ File managermousepadβ Text editorxfce4-taskmanagerβ Task managerxfce4-screenshooterβ Screenshot tool
Remote Desktop
xrdpβ RDP serverssl-certβ SSL certificates
Browsers
firefoxβ Mozilla official APT repo (non-Snap)google-chrome-stableβ Latest Chrome (amd64)chromium-browserβ Fallback for ARM64
Security
ufwβ Uncomplicated Firewallfail2banβ Intrusion prevention- SSH hardening via drop-in config
VPN
tailscaleβ Zero-config VPN
Swap & Memory
- ZRAM β Compressed RAM swap (dynamic)
- Swapfile β Traditional disk swap (dynamic)
- Custom sysctl tuning
Utilities
curl,wget,git,nano,htoptmux,net-tools,opensslnetwork-manager-gnome
[1/14] Set timezone β Asia/Kolkata
[2/14] Fix APT mirrors β archive.ubuntu.com (all providers)
[3/14] System update β apt update + upgrade
[4/14] Install base packages
[5/14] Configure UFW firewall
[6/14] Create user 'aman' (manual password prompt)
[7/14] SSH hardening (drop-in config, no overwrite)
[8/14] Install XFCE4 desktop + black screen fix
[9/14] Install XRDP + block port 3389 publicly
[10/14] Configure ZRAM + swapfile (dynamic sizing)
[11/14] Apply kernel/sysctl optimizations
[12/14] Enable software rendering (/etc/environment)
[13/14] Install Firefox + Chrome/Chromium
[14/14] Install + authenticate Tailscale
Edit the script β replace all occurrences of aman with your preferred username:
sed -i 's/aman/yourname/g' install.sh
sudo bash install.sh# Edit line ~68 in install.sh
timedatectl set-timezone America/New_York
# Full list: timedatectl list-timezonesThe script auto-calculates swap as 2 Γ RAM (capped 1β4GB). To override:
# Edit install.sh β replace the auto-calc lines with:
SWAP_MB=4096 # 4GB fixed
SWAP_BYTES=$(( SWAP_MB * 1024 * 1024 ))# In install.sh, change the sed line:
sed -i 's/max_bpp=32/max_bpp=16/' /etc/xrdp/xrdp.ini # Fastest
sed -i 's/max_bpp=32/max_bpp=24/' /etc/xrdp/xrdp.ini # Balanced (default)# Full log
cat /var/log/vps-master-setup.log
# Page-by-page
less /var/log/vps-master-setup.log
# Only errors/warnings
grep -E "ERROR|WARN|FAIL" /var/log/vps-master-setup.log
# Only success messages
grep "INFO" /var/log/vps-master-setup.logβ Black screen after RDP login
# SSH into VPS and run:
sudo apt install xfce4-session -y
echo "startxfce4" > /home/aman/.xsession
chown aman:aman /home/aman/.xsession
sudo systemctl restart xrdpThen reconnect via RDP.
π Can't connect to RDP
# Check XRDP status
sudo systemctl status xrdp
# Restart XRDP
sudo systemctl restart xrdp
# Verify Tailscale is connected
tailscale status
tailscale ip -4
# Check firewall β 3389 must be DENY publicly
sudo ufw statusπΎ Low memory / OOM errors
# Check current swap usage
free -h
swapon --show
# Manually enable if needed
sudo swapon /swapfile
sudo swapon /dev/zram0π Tailscale authentication stuck
# Run tailscale up manually β you'll see the auth URL
sudo tailscale up
# Check status
tailscale status
tailscale ip -4π Forgot the aman user password
# Reset password as root
sudo passwd amanπ¦ Firefox not opening in RDP session
# Software rendering is already set, but verify:
grep LIBGL /etc/environment
# Should show: LIBGL_ALWAYS_SOFTWARE=1
# Re-login to RDP session after checking# 1. Set up SSH key authentication
ssh-copy-id aman@<tailscale-ip>
# 2. Disable password SSH (after keys are set up)
sudo nano /etc/ssh/sshd_config
# Add: PasswordAuthentication no
sudo systemctl restart ssh
# 3. Enable automatic security updates
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure -plow unattended-upgrades
# 4. Monitor Fail2Ban
sudo fail2ban-client status sshdTested on 2GB RAM / 1 vCPU (DigitalOcean Droplet $12/mo):
| Metric | Value |
|---|---|
| Idle RAM | ~380MB |
| With Firefox | ~650MB |
| With Chrome | ~820MB |
| ZRAM Swap | 3.9GB compressed |
| Disk Swap | 3.9GB traditional |
| SSH Login | < 1 second (UseDNS off) |
| RDP Response | < 100ms (LAN / Tailscale) |
| Setup Time | 12β18 minutes |
Can I run this on Debian / CentOS / other distros?
No. Currently Ubuntu 22.04 LTS only. Debian support is on the roadmap.
Does it work on ARM64 (Oracle Cloud free tier)?
Yes! The script auto-detects architecture. On ARM64, Chrome is replaced with Chromium automatically.
Can I access RDP without Tailscale?
Not by default β port 3389 is blocked for security. To allow public RDP (not recommended):
sudo ufw allow 3389/tcpIs it safe to run on a non-fresh VPS?
Yes β the script is idempotent. It won't duplicate users, swap, or configs. However, fresh VPS is always recommended.
How do I update to v2.0 from v1.0?
Just re-run the v2.0 script. It will skip existing user/swap creation and apply only missing configs.
Contributions are welcome! Here's how:
- π΄ Fork this repository
- πΏ Create a feature branch:
git checkout -b feature/your-feature - βοΈ Commit your changes:
git commit -m 'Add: your feature description' - π€ Push to branch:
git push origin feature/your-feature - π Open a Pull Request
- Ubuntu 24.04 LTS support
- GNOME / KDE desktop option flag
- Docker pre-installation flag
- VNC as alternative to XRDP
--minimalflag (no browsers, no GUI)- Debian 12 support
- β FIXED: Hardcoded password replaced with interactive secure prompt
- β
FIXED: Tailscale auth URL was hidden (
/dev/null) β now visible - β
FIXED: Systemd ZRAM service had multiple
ExecStart(broken) β now single combined command - β
FIXED:
/etc/environmenthad invalidexportkeyword removed - β FIXED: Mirror fix now covers all providers (not just Linode)
- β FIXED: Swap size is now dynamic (2Γ RAM) instead of hardcoded 2GB
- β
FIXED:
zram-configpackage conflict with manual ZRAM setup β removed - β
FIXED:
vm.overcommit_memoryset to safe0(was dangerous1) - β FIXED: Chrome hardcoded to amd64 β ARM64 now uses Chromium
- β NEW: Ubuntu version check with graceful warnings
- β
NEW: Full setup log at
/var/log/vps-master-setup.log - β
NEW:
TS_AUTH_KEYenv var for unattended Tailscale auth - β
NEW:
network-manager-gnomenow actually installed - β
NEW: Dedicated sysctl config in
/etc/sysctl.d/99-vps-tuning.conf - β
REMOVED: Deprecated SSH
Compression yessetting - β
REMOVED: Duplicate
htopinstall
- Ubuntu 22.04 + XFCE4 + XRDP + Tailscale + ZRAM
MIT License β Free to use, modify, and distribute with attribution.
See LICENSE for full text.
Aman β DevOps Engineer & Infrastructure Automation Enthusiast
- π GitHub: @technicalboy2023
- π Website: GyaniBaba
If VPS Master Setup saved you hours of manual configuration:
- β Star this repository
- π΄ Fork and customize for your workflow
- π Report issues β help make it better
- π‘ Suggest features via GitHub Issues
- π’ Share with your DevOps community
Give a β if this saved your time!
Built with β€οΈ for the DevOps & self-hosting community
Tested on Ubuntu 22.04 LTS Β· Deployed across DigitalOcean, Linode, Vultr, Hetzner, Oracle Cloud