Many people today are looking for a cheap VPS to use for learning, testing, hosting small projects, or running simple servers. Most low-cost VPS providers offer Linux-based operating systems such as Ubuntu, CentOS, Fedora, and other similar systems. These Linux VPS plans are usually cheaper than Windows VPS plans and are very powerful.
Recently, I found a new VPS provider offering prices between $2 to $5 per month. Because they were running a monthly promotion, I bought one VPS for only $2.5 for one month just to test it. This is a very good deal, especially for beginners who want to learn Linux without spending much money.
However, it had been a long time since I last used Linux as my main operating system. Because of this, I almost forgot how to install programs and properly set up a Linux server. At first, I even faced problems installing Linux on my VPS. It took me almost a full day to understand what was wrong. But after some patience and learning, I finally installed it successfully.
In this guide, I will show you step by step how to install and access an Ubuntu Linux desktop on a VPS using SSH and VNC.
Why Use Ubuntu on a Cheap VPS?
Ubuntu is one of the most popular Linux operating systems in the world. It is stable, secure, free, and has a very large community. This means you can easily find help online if you encounter problems.
Most cheap VPS providers support Ubuntu because it:
- Uses fewer system resources
- Runs well on low RAM servers
- Is perfect for web servers and testing
- Works great with SSH and VNC
Even if your VPS has limited memory, Ubuntu can still work well when configured correctly.
Step 1: Access Your VPS Using SSH
The first thing you need is a way to access your VPS console. Most VPS providers give you a web-based console inside their control panel. But another very popular and reliable option is using a free program called PuTTY.
PuTTY is an SSH client that allows you to connect to your VPS from your computer. You can download it for free from its official website.
After installing PuTTY, open it and enter the following details:
- Host Name: Your VPS IP address
- Connection Type: SSH
- Port: 22 (default)
Once everything is correct, click Open and log in using your VPS username and password.
Step 2: Update Your Ubuntu System
After logging in, the first thing you should always do is update your system. This ensures that all software lists are up to date.
sudo apt-get update
This command refreshes your package list and prepares your system for new installations.
Step 3: Install a Lightweight Desktop (GNOME Core)
By default, a VPS does not have a graphical interface. To access it visually, we need to install a desktop environment.
We will use GNOME Core instead of the full GNOME desktop because it uses less memory. This is important for cheap VPS servers.
sudo apt-get install gnome-core
During installation, you will be asked to select your keyboard layout. Just choose the layout you normally use and continue.
Step 4: Install VNC Server
Now we need a way to connect to the desktop remotely. For this, we will use VNC.
sudo apt-get install vnc4server
This installs the VNC server software on your VPS.
Step 5: Set Your VNC Password
Once VNC is installed, you need to create a password. This password will be used when connecting to your VPS desktop.
vncserver
After entering your password, Ubuntu is almost ready. However, we still need to make some important changes.
Step 6: Kill the VNC Session
Before making changes, we need to stop the current VNC session.
vncserver -kill :1
This command safely closes the session so we can edit configuration files.
Step 7: Edit the VNC Startup File
Now we need to tell VNC how to start the desktop environment. Open the startup file using this command:
vi ~/.vnc/xstartup
Delete all existing content inside the file and paste the following:
#!/bin/sh unset SESSION_MANAGER gnome-session --session=gnome-classic & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic &
Save the file and exit the editor.
Step 8: Reduce Memory Usage (Important for Cheap VPS)
GNOME can use a lot of memory. To fix this, we need to edit a configuration file.
sudo vi /etc/init/gdm.conf
Look for the following lines and comment them out by adding a # at the beginning:
#start on ((filesystem # and runlevel [!06] # and started dbus # and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 # or stopped udev-fallback-graphics)) # or runlevel PREVLEVEL=S)
This helps reduce unnecessary processes and saves memory.
Step 9: Create a New VNC Session
Now it is time to create your final VNC session.
vncserver -geometry 1024x600
This sets the screen size and starts your desktop session.
Step 10: Connect Using a VNC Client
To access your VPS desktop, install a VNC client on your computer. Popular options include:
- TightVNC
- RealVNC
Enter your VPS IP address followed by the display number (example: IP:1). Use the password you created earlier.
You should now see your Ubuntu desktop running on your VPS.
How to Create a Normal User in Ubuntu
Using the root user all the time is not recommended. It is safer to create a normal user.
Open PuTTY again and run the following command:
adduser normaluser
Replace normaluser with your preferred username.
Then give the user sudo rights:
sudo adduser normaluser sudo
Now your user can run admin commands safely.
Final Thoughts
Congratulations! You have successfully installed Ubuntu Linux on a cheap VPS with a working desktop environment. This method works not only for Ubuntu 12.04 but also for many other Ubuntu versions.
This setup is perfect for beginners who want to learn Linux, test software, or run small projects without spending much money. With patience and the right steps, anyone can do it.

No comments:
Post a Comment