> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install GUI (desktop environment) on Ubuntu, CentOS and Debian

Linux servers are provisioned without a graphical interface. Install XFCE to get a desktop environment for administration or troubleshooting tasks that are easier to perform in a visual workspace. XFCE is lightweight and runs well even on low-resource servers.

<Frame>
  <img src="https://mintcdn.com/gcore/494jjlOXZiI1ohtY/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image2.png?fit=max&auto=format&n=494jjlOXZiI1ohtY&q=85&s=f68fef740327196fb010d693894ccb15" alt="XFCE desktop environment" width="1282" height="878" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image2.png" />
</Frame>

Connect to the server via [SSH](/hosting/virtual-servers/manage/connect/linux-server/connect-to-linux-server-via-ssh) or [VNC](/hosting/virtual-servers/manage/connect/connect-to-a-virtual-server-via-vnc) before starting. The login credentials are available on the **Instructions** tab in the [Gcore Hosting Portal](https://hosting.gcore.com/billmgr).

## Install XFCE

Select the tab that matches the server OS.

<Tabs>
  <Tab title="Ubuntu">
    1\. Update the package list:

    ```sh theme={null}
    sudo apt-get update
    ```

    2\. Install the XFCE environment and additional components (panel, file manager, and various plugins):

    ```sh theme={null}
    sudo apt-get install xfce4-session xfce4-goodies
    ```

    The system warns that the installation requires several hundred megabytes of disk space.

    <Frame>
      <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image8.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=1a9a987fd475e575e86200ccf432ad0b" alt="Disk space warning" width="658" height="38" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image8.png" />
    </Frame>

    Confirm with: `y`

    <Frame>
      <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image12.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=ba89798d709302af507025b10995f27c" alt="Confirmation prompt" width="686" height="43" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image12.png" />
    </Frame>

    3\. Install a display manager to launch XFCE. What happens next depends on the Ubuntu version:

    <Accordion title="A dialog appeared — select a display manager">
      The installer prompts to choose between **gdm3** and **lightdm**. Select **lightdm** and press **Enter**.

      <Frame>
        <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/4411242128145.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=8417d00cbec631c44e1a0164a5590982" alt="Display manager selection: lightdm selected" width="1279" height="487" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/4411242128145.png" />
      </Frame>
    </Accordion>

    <Accordion title="No dialog appeared — install xinit manually">
      ```sh theme={null}
      sudo apt install xinit
      ```

      The system warns that the installation requires several megabytes of disk space.

      <Frame>
        <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image20.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=6d7b0d10d94b2fd7483e59e45ee7d2e0" alt="xinit disk space warning" width="700" height="40" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image20.png" />
      </Frame>

      Confirm with: `y`

      <Frame>
        <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image24.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=4677372a10611235914b35006d6cccb8" alt="Confirmation prompt" width="708" height="42" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image24.png" />
      </Frame>
    </Accordion>

    4\. Start the desktop environment.

    If `lightdm` was installed in step 3, reboot the server — the graphical interface starts automatically:

    ```sh theme={null}
    shutdown -r now
    ```

    If `xinit` was installed in step 3, start the graphical interface directly:

    ```sh theme={null}
    startx
    ```
  </Tab>

  <Tab title="CentOS">
    <Note>
      CentOS 8 reached End of Life on December 31, 2021. The official CentOS 8 package repositories are no longer maintained, so installation commands will fail on a stock CentOS 8 system. For new servers, use AlmaLinux or Rocky Linux as supported alternatives. The instructions below apply to CentOS 7.
    </Note>

    1\. Install EPEL (Extra Packages for Enterprise Linux) — an open repository that contains the XFCE desktop environment packages:

    ```sh theme={null}
    yum -y install epel-release
    ```

    2\. Install the X Window System — the foundation for graphical interfaces on Linux.

    For CentOS 7:

    ```sh theme={null}
    yum -y groupinstall x11
    ```

    For CentOS 8:

    ```sh theme={null}
    yum -y groupinstall base-x
    ```

    3\. Install the XFCE desktop environment from the EPEL repository:

    ```sh theme={null}
    yum --enablerepo=epel -y groups install "Xfce"
    ```

    4\. Create a startup script for xinit that tells it which desktop environment to launch:

    ```sh theme={null}
    echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
    ```

    5\. Start the desktop environment:

    ```sh theme={null}
    startx
    ```

    <Note>
      If `startx` returns an error, re-run step 4 and then run `startx` again.
    </Note>
  </Tab>

  <Tab title="Debian">
    1\. Install the XFCE desktop environment:

    ```sh theme={null}
    apt-get install xfce4
    ```

    The system warns that the installation requires several hundred megabytes of disk space.

    <Frame>
      <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image16.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=27da5d9be9dfb342f02d9d9de2ebede8" alt="Disk space warning" width="767" height="40" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image16.png" />
    </Frame>

    Confirm with: `y`

    2\. Install the optional XFCE components (panel, file manager, and plugins):

    ```sh theme={null}
    apt-get install xfce4-goodies
    ```

    The system warns that the installation requires several megabytes of disk space.

    <Frame>
      <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image27.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=5b2cf18d845c52b6dc8d24dc14b1ff05" alt="xfce4-goodies disk space warning" width="779" height="41" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image27.png" />
    </Frame>

    Confirm with: `y`

    3\. Start the desktop environment:

    ```sh theme={null}
    startx
    ```
  </Tab>
</Tabs>

## First start

On first start, XFCE prompts to select a panel configuration. Select **Use default config** to get the taskbar, clock, and pre-configured Applications menu. The empty panel option requires manual configuration.

<Frame>
  <img src="https://mintcdn.com/gcore/494jjlOXZiI1ohtY/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image11.png?fit=max&auto=format&n=494jjlOXZiI1ohtY&q=85&s=21c509f10a3e99d7976f2947aeb3a088" alt="XFCE first-start panel configuration dialog" width="1283" height="915" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image11.png" />
</Frame>

The desktop with the default configuration looks as follows (minor details may vary by OS):

<Frame>
  <img src="https://mintcdn.com/gcore/494jjlOXZiI1ohtY/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image2.png?fit=max&auto=format&n=494jjlOXZiI1ohtY&q=85&s=f68fef740327196fb010d693894ccb15" alt="XFCE desktop with default configuration" width="1282" height="878" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image2.png" />
</Frame>

If only folders and widgets are visible and the panel with the **Applications** button is missing, the panel is hidden at the top — move the slider up to reveal it.

<Frame>
  <img src="https://mintcdn.com/gcore/494jjlOXZiI1ohtY/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image33.png?fit=max&auto=format&n=494jjlOXZiI1ohtY&q=85&s=3e6c40a61ec3c2bab8af357351269d99" alt="Slide up to reveal the hidden panel" width="1585" height="918" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image33.png" />
</Frame>

On Ubuntu with `lightdm`, the desktop starts automatically on each server boot. On CentOS and Debian (and Ubuntu with `xinit`), the terminal opens after a reboot — run `startx` to start XFCE again.

To open a terminal inside XFCE, click **Applications** in the upper-left corner and select **Terminal Emulator**.

<Frame>
  <img src="https://mintcdn.com/gcore/494jjlOXZiI1ohtY/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image7.png?fit=max&auto=format&n=494jjlOXZiI1ohtY&q=85&s=da04a182948724ec04703f37fa67dfa3" alt="XFCE Applications menu with Terminal Emulator selected" width="1280" height="881" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image7.png" />
</Frame>

## Log out

Logging out of XFCE returns the session to the terminal.

**On Ubuntu with lightdm:** press **Ctrl+Alt+F1** — the session returns to the terminal immediately. The desktop restarts automatically on the next server boot.

**On CentOS, Debian, and Ubuntu with xinit:**

1\. Click **Applications** in the upper-left corner and select **Log Out** from the menu.

<Frame>
  <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image19.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=662dbbec6ef9cb21451491baf92db266" alt="XFCE Applications menu with Log Out selected" width="1282" height="882" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image19.png" />
</Frame>

2\. Select **Log Out** in the confirmation window.

<Frame>
  <img src="https://mintcdn.com/gcore/AVlk5NJu0Epwz6C_/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image29.png?fit=max&auto=format&n=AVlk5NJu0Epwz6C_&q=85&s=0b4900cc527eb0e779af80b302202ad7" alt="Log Out confirmation window" width="1279" height="881" data-path="images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image29.png" />
</Frame>

The session returns to the terminal. To start XFCE again, run `startx`.
