Menu
User

DropVPS Team

Writer: Cooper Reagan

How to start VNC server from command line?

How to start VNC server from command line?

Publication Date

05/18/2025

Category

Articles

Reading Time

1 Min

Table of Contents

To start a VNC server from the command line on a Linux system (like Ubuntu), you can follow these steps. I’ll use TigerVNC as the example since it’s one of the most commonly used VNC servers.

Step-by-step: Start VNC Server from Terminal

  1. Install the VNC server (if not already installed):

    sudo apt update
    sudo apt install tigervnc-standalone-server
  2. Set the VNC password (first-time setup):
    vncpasswd
  3. Start the VNC server manually:
    vncserver

    By default, this will start a VNC session on display :1 (port 5901).

  4. (Optional) Stop the VNC server:
    vncserver -kill :1

Customize VNC Server Startup (e.g. Desktop Environment)

If you want to use a desktop environment like GNOME, XFCE, or LXDE with your VNC session, edit or create this file:

nano ~/.vnc/xstartup

For XFCE:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

Make the file executable:

chmod +x ~/.vnc/xstartup

Then start again:

vncserver :1
Linux VPS
U
Loading...

Related Posts