How to Install VNC Server on CentOS: A Step-by-Step Guide

If you’ve been looking for a straightforward, step-by-step guide to installing a VNC server on CentOS, you’ve come to the right place. Let’s get started.

Updated: 03 Feb, 25 by jean lou 4 Min

List of content you will read in this article:

Virtual Network Computing (VNC) is a powerful tool that allows you to access and control your server's desktop environment remotely. With a VNC server installed on CentOS, you can manage your server from anywhere, using a device equipped with a VNC client. This is especially useful for users who prefer a graphical interface over the command line for server management tasks.

CentOS is a popular choice for running servers because of its stability and reliable performance. By adding a VNC server, you unlock the ability to manage your system through a graphical user interface (GUI), making administrative tasks more intuitive and efficient.

In this guide, we’ll show you how to install and configure a VNC server on CentOS. Whether you’re setting it up for personal use or managing multiple servers, these steps will help you establish a secure and convenient remote access solution. Let’s dive in!

Step 1: Install the VNC Server Package on CentOS

To begin installing the VNC server on CentOS, you need root privileges. Use the YUM package manager to install the necessary VNC server package. Open a terminal and run the following command:

sudo yum install tigervnc-server

Step 2: Set Up a VNC User (Optional)

Creating a dedicated user account for VNC access enhances security. To create a new user, run the following command, replacing <username> with your preferred username:

sudo adduser <username>

Next, set a password for the new user by running:

passwd <username>

Step 3: Configure VNC Password

Now, switch to the newly created user account to configure the VNC password. Run the following command:

vncserver

You will be prompted to enter and confirm a password for VNC access. This password is required to connect to the VNC server later.

Step 4: Set the VNC Server to Start at Boot (Optional)

While this step is optional, configuring the VNC server to start automatically at system boot can save time. Run the following command to enable the VNC server service at startup:

sudo systemctl enable vncserver@:1.service

Step 5: Start the VNC Server

Start the VNC server for the newly created user. The number after the colon (e.g., 1) represents the unique display port for the user. Run the following command:

sudo systemctl start vncserver@:1.service

Step 6: Connect to the VNC Server on CentOS

Now that the VNC server is running, you can connect to it using any VNC client, such as Remmina or Vinagre (on GNOME). Simply install your chosen client, enter the IP address of your CentOS server along with the VNC display port (e.g., 192.168.1.100:1), and use the password you set earlier to gain remote access.

  1. Remote Management: VNC provides a convenient way to manage your CentOS server remotely, making it ideal for managing servers hosted in data centers or cloud environments.
  2. Graphical Interface: For users who prefer GUI tools over the command line, VNC bridges the gap by offering access to a graphical desktop environment.
  3. Multi-User Support: VNC allows multiple users to connect to different sessions on the same server, increasing productivity in collaborative environments.
  4. Cross-Platform Accessibility: VNC clients are available for various platforms, including Windows, macOS, Linux, and even mobile devices.

Conclusion

By following these six simple steps, you can easily install and configure a VNC server on CentOS, unlocking the full potential of remote server management. Whether a seasoned system administrator or a novice exploring CentOS, a VNC server can simplify your workflow and enhance productivity.

With VNC, you can seamlessly connect to your server’s graphical desktop from any device, ensuring you’re never out of touch with your critical systems. Plus, the optional configurations like auto-start at boot add convenience and flexibility to your setup.

Now that your VNC server is running, you can explore advanced configurations, such as securing SSH tunneling for encrypted connections or optimizing performance for high-latency networks. Empower your server management tasks with this reliable and robust solution, and enjoy the convenience of remote desktop access.

VNC Server allows you to remotely access and control your CentOS server's graphical desktop environment from another device, making server management easier.

Yes, root privileges are required to install VNC server packages on CentOS.

Yes, creating a dedicated user account for VNC access is recommended for security purposes, but it is optional.

To enable the VNC server to start automatically at boot, use the command: sudo systemctl enable vncserver@:1.service

Install a VNC client, such as Remmina or Vinagre, on your local computer. Enter the IP address of your CentOS server along with the display port (e.g., 192.168.1.100:1) to connect.

VNC Server can be installed on CentOS 7 and CentOS 8 using the tigervnc-server package. Make sure your system is up to date before installing.