This guide will walk you through creating a VPS on Hetzner Cloud, installing Ubuntu Desktop, setting up NoMachine for GUI access, and configuring a firewall.
1. Create a VPS on Hetzner
- Go to Hetzner Cloud.
- Create a new project (if you donโt have one yet).
- Click Add Server.
- Choose the following options:
- Location: Closest to your users (e.g., Germany, Finland, US).
- Image: Ubuntu (latest LTS recommended).
- Architecture: x86 (Intel/AMD) โ better compatibility than ARM64.
- Type: CX21 or higher (2 vCPU / 4 GB RAM is a good start).
- Volume: At least 40 GB SSD.
- Add your SSH key or generate one if you donโt have it.
- Click Create & Buy Now.
๐ Video walkthrough: How to create a VPS on Hetzner
Once created, Hetzner will provide you with an IP address.
2. Connect to Your VPS via SSH
From your local terminal:
ssh root@<your-server-ip>
Replace <your-server-ip> with the IP shown in Hetznerโs dashboard.
here is an example
ssh root@123.456.789.123
3. Update & Install Ubuntu Desktop
Update packages and install a desktop environment:
sudo apt update -y
sudo apt install xfce4 xfce4-goodies -y
sudo apt-get install iptables -y
sudo apt install net-tools -y
4. Create a New User
Instead of using root, create a safe non-root user:
adduser jervi
adduser jervi sudo
usermod -aG sudo jervi
5. Install NoMachine (for GUI Access)
NoMachine lets you access your VPS with a desktop interface.
Step 1: Download package
wget https://download.nomachine.com/download/8.9/Linux/nomachine_8.9.1_1_amd64.deb
Step 2: Install dependencies
sudo apt install libpng16-16 libjack-jackd2-0 -y
Step 3: Install NoMachine
sudo dpkg -i nomachine_8.9.1_1_amd64.deb
Step 4: Start NoMachine service
/usr/NX/bin/nxserver --status
/usr/NX/bin/nxserver --start
/usr/NX/bin/nxserver --startup
Now you can connect from your computer using the NoMachine client and the VPS IP address.
6. Secure the Server with Firewall (UFW)
Enable UFW and allow essential ports:
sudo apt install ufw -y
sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 22
sudo ufw allow 4000/tcp
sudo ufw allow 80/tcp # Web
sudo ufw allow 443/tcp # HTTPS
sudo ufw allow 22/tcp # SSH (to be safe)
sudo ufw reload
Note that you are obliged to allow ssh and port 22 even if it is the same also if you have changed the ssh port, then allow it too
โ Your Hetzner VPS is Ready!
- Ubuntu Desktop is installed.
- A safe user (
jervi) is created. - NoMachine GUI access is available.
- Firewall is protecting your VPS.
๐ Next step: you can start installing your preferred software, development stack, or deploy apps.
How to connect to this new VPS user via SSH
ssh jervi@<your-server-ip>
๐ Your Ubuntu VPS on Hetzner is ready!
Read more
How to Enable the Classic Android Navigation Bar in BlueStacks 5 (Back / Home / Recents)
Enable the classic Android navigation bar (Back, Home, and Recent buttons) in BlueStacks 5 by editing a hidden configuration file. Step-by-step guide for developers and testers.
Set Up an Expo Build Local Environment on WSL2
Set up a full Expo and Android build environment on WSL2 Ubuntu 24.04. Install Android SDK, NDK, Java 17, Node 20, EAS CLI, and configure all environment variables.
Next.js App on a VPS (Hetzner) in traditional way
Clone your repo, install Node, build your Next.js app, run it on a custom port, and keep it alive with PM2.
