How to Install TightVNC Server on Ubuntu
A remote desktop lets you control your computer from wherever you are, which is super handy for working or fixing issues. For users of Ubuntu, TightVNC Server is one such stand-alone option to opt for. This software uses VNC to remotely view and control your computer's screen.
And if you’re looking for a reliable, high-performance, and budget-friendly solution for your workflows, Hostman has you covered with Linux VPS Hosting options, including Debian VPS, Ubuntu VPS, and VPS CentOS.
This tutorial covers the TightVNC Server installation on Ubuntu. We'll guide you through installation and show you how to secure your connection.
What is TightVNC Copy link
TightVNC is a remote desktop application built on the VNC protocol. With this tool, you can control and view your Linux computer on a different machine, whether it is a laptop or a mobile. This software also compresses data and optimizes bandwidth, so it is extremely beneficial for low latency, low-speed internet. This software is used quite frequently by developers and administrators to access servers from far away and to debug everything.
Why Use TightVNC Server Copy link
TightVNC possesses some great benefits to Ubuntu users:
-
Resource-Efficient: Since it does not require a lot in terms of resources, it is appropriate for low-power PCs and works well on old computers.
-
Multi-Platform Compatibility: It is compatible with other operating systems thus you can use your setup from various devices, e.g., tablets, windows computers, and even Macs.
-
Customizable Configurations: You can customize the tool to your needs. You can utilize your own ports, use secure tunnels for the sake of security, or use less technical desktop environments so that all the things remain light and fast.
-
Cost-Free Solution: It's an open-source project, so the software is completely free for both business and personal use.
Prerequisites Copy link
Ensure you have:
- Ubuntu OS: This tutorial applies to Ubuntu 20.04 and newer versions.
- Desktop Environment: A GDE like LXDE should be installed.
- Superuser Access: Administrative privileges are must for installation.
- Internet Access: Stable connectivity for downloading packages.
Step 1: Update System Copy link
Initially, upgrade your system so that all processes work perfectly and there are no issues during the installation. Run:
sudo apt update && sudo apt upgrade -yThe command updates outdated programs and also puts the list of software on your computer in a refreshable state.
Step 2: Install TightVNC Server Copy link
Now, install the TightVNC server package using the following command to enable the remote desktop functionality.
sudo apt install tightvncserver -yThis installs the core software. The -y flag automatically confirms the installation prompt, ensuring the process is uninterrupted.

Once completed, the application will be ready for further configuration.
Step 3: Install a Graphical Desktop Environment (GDE) Copy link
TightVNC requires a GDE and LXDE is recommended due to its lightweight nature:
sudo apt install lxde -yBy restricting the utilization of resources, LXDE provides your system with more space for your real work. It is particularly useful if your server is low in RAM and CPU.
Step 4: Configure TightVNC Copy link
Configuration is crucial in installing the tool to your specifications. To ensure proper operation, do the following:
- Initialize Session
Run TightVNC server to create your initial session:
tightvncserverIt will ask you to create a remote access password during initialization. This password guarantees only approved users may connect.

- Stop the Server for Configuration
To modify default settings, first stop the server:
tightvncserver -kill :1Stopping session :1 allows you to edit the startup file without interruption.
- Edit Startup Script
Create or modify the startup file:
nano ~/.vnc/xstartupAdd the below-provided configuration:
xrdb $HOME/ .Xresources
xsetroot -solid grey
export XXL_XMODMAP_DISABLE=1
/etc/X11/Xsession
/usr/bin/startlxdeThese commands start an X11 session with a graphical desktop. They start user configuration, set the background color, disable custom keyboard mappings, initalize the session, and start the LXDE environment.
Then assign the correct permissions to ensure it executes properly:
sudo chmod 755 ~/.vnc/xstartupStep 5: Start the Server Copy link
Restart the server to ensure correct configurations are applied:
tightvncserverThe session number (e.g., :1) displayed in the output allows for remote connection.
Step 6: Connect to the System Remotely Copy link
Now it’s time to connect to your server using the TightVNC Viewer or any compatible VNC client.
First, get your server’s IP address using:
hostname -IThen use the below instructions:
- Start the VNC client on your local device.
- Input the server address in the form of ip_address:session_number. For example:
192.168.X.X:590X. - Type in the VNC password that you have set earlier.
Once connected, the graphical interface is remotely manageable.

Step 7: Secure TightVNC Server Copy link
Remote access involves potential security risks, so it’s important to secure your server connection.
- Use SSH Tunneling
To encrypt your connection, create an SSH tunnel:
ssh -L 5901:localhost:5901 user@your_server_ipReplace user and your_server_ip with your server details. Access the VNC session via localhost:5901 in the VNC Viewer.
- Restrict Port Access
Use the system firewall to allow connections only from trusted IPs:
sudo ufw allow from your_trusted_ip to any port 5901Replace your_trusted_ip with the IP of your local machine.
Step 8: Stop and Manage the Server Copy link
You can stop a session to save resources when it’s not needed:
tightvncserver -kill :1This disables the active connection without uninstalling the server.
Troubleshooting Common Issues Copy link
If you encounter problems during setup or remote access, these solutions may help:
Blank Screen After Connection Copy link
If TightVNC only shows a blank or gray screen, try these solutions:
-
Kill all VNC sessions: Conflicting sessions can cause display issues.
tightvncserver -kill :session_numberOnce done, run the server again:
tightvncserver-
Restart the System: A simple reboot can resolve graphical glitches and session conflicts:
sudo reboot-
Specify the Display Screen: Ensure the correct display screen is used by setting the DISPLAY variable:
export DISPLAY=:1This will allow remote access to the login screen via Xorg. Also, don’t forget to include startxfce4 in the xstartup file.
-
Remove Lock Files: Leftover lock files can interfere with graphical sessions:
sudo rm -rf /tmp/.X*-lock /tmp/.X11-unix/X*Unable to Connect Copy link
Confirm the port (e.g., 5901) is open:
sudo ufw statusOpen the port if necessary:
sudo ufw allow 5901/tcpSession Won’t Start Copy link
Check for logs in the .vnc directory:
cat ~/.vnc/*.logClient Rejected from Localhost Copy link
Some VNC servers might only listen on localhost by default. To fix the issue, run:
vncserver -localhost noIntegrating TightVNC with Cloud Platforms Copy link
You can expand the application usability by integrating it with cloud services for remote accessibility. Apply the following instructions:
-
Open ports required for TightVNC through the cloud platform’s security group settings (e.g., port 5901 for VNC sessions).
-
Use SSH tunneling to secure access:
ssh -i your-key.pem -L 5901:localhost:5901 user@cloud_server_ipCustomizing TightVNC Viewer Settings Copy link
Overlooked client settings can really boost usability and security.
Add a View-Only Mode for Specific Users Copy link
In case someone needs to monitor activity without interacting with the desktop:
-
Set a view-only password:
tightvncpasswd -viewonly-
Provide the user with the view-only password while keeping control of the main session.
Integrating TightVNC with Scripts Copy link
Automation can streamline workflows for repetitive tasks or multi-session setups.
Batch Start Multiple Sessions
Write a script to launch multiple VNC instances simultaneously:
nano ~/start-vnc-sessions.shAdd:
#!/bin/bash
tightvncserver :1
tightvncserver :2
tightvncserver :3Make the script executable:
chmod +x ~/start-vnc-sessions.shRun the script:
./start-vnc-sessions.shConclusion Copy link
TightVNC Server installation on Ubuntu allows secure remote desktop access with maximum accessibility and productivity. This tutorial has given you an optimized and secured environment through which you can remotely access your system. For remote access for troubleshooting purposes, server management, and so on, TightVNC offers simple management with maximum resource utilization.