> ## Documentation Index
> Fetch the complete documentation index at: https://docs.preprod.world/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-docs/x_smiUQB7zVmfvrq/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image2.png?fit=max&auto=format&n=x_smiUQB7zVmfvrq&q=85&s=e0b2fa616644d1f3a3ee041c93dba648" 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-docs/UO91dgboXVd5Jiga/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image8.png?fit=max&auto=format&n=UO91dgboXVd5Jiga&q=85&s=21ac2af8d04b78fcb96e9f595c3189f5" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image12.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=b2e48343ba70b4f73ab299edc798fd65" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/4411242128145.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=2cff13f1ec50c161ed666ae03627783b" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image20.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=53f27926762ae8a665f7a7d2f0ca6465" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image24.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=fada555f11832fa4142ca6f8ad83ddc4" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image16.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=c86a85bfde0890b6bb1ed63d86b1861b" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image27.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=bd620aca70875913b1859f07cc91c189" 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-docs/x_smiUQB7zVmfvrq/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image11.png?fit=max&auto=format&n=x_smiUQB7zVmfvrq&q=85&s=89ad0cea0a241295d80a200b68e84ed6" 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-docs/x_smiUQB7zVmfvrq/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image2.png?fit=max&auto=format&n=x_smiUQB7zVmfvrq&q=85&s=e0b2fa616644d1f3a3ee041c93dba648" 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-docs/x_smiUQB7zVmfvrq/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image33.png?fit=max&auto=format&n=x_smiUQB7zVmfvrq&q=85&s=3479ae1b4071c8efa06e9667e44fdd0c" 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-docs/x_smiUQB7zVmfvrq/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image7.png?fit=max&auto=format&n=x_smiUQB7zVmfvrq&q=85&s=e8616910ffd69921b85167f54f7c80b9" 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-docs/gyFawy0sc2o9kx5w/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image19.png?fit=max&auto=format&n=gyFawy0sc2o9kx5w&q=85&s=38b09c7f0e5077e9cb0fc04e52b909ff" 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-docs/UO91dgboXVd5Jiga/images/docs/hosting/virtual-servers/manage/install-gui-desktop-environment-on-ubuntu-centos-and-debian/image29.png?fit=max&auto=format&n=UO91dgboXVd5Jiga&q=85&s=056cf873fcd4bd19e27c111537df2560" 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`.
