Install a XFCE Desktop and NoMachine on a Linux VPS

3 min
VPS/VDS Hosting

Some tools only exist as graphical applications. On a VPS Linux Infrawire you can add a light XFCE desktop and use NoMachine to get a fast remote screen, much smoother than VNC over a slow link. This guide targets Ubuntu 24.04 and Debian 12.

📋 Prerequisites

  • A KVM VPS running Ubuntu 24.04 or Debian 12, with at least 2 GB of RAM for a comfortable desktop.
  • The VPS IP and root password, available in your customer area.
  • A regular user with sudo rights (we create one below).
  • NoMachine client installed on your own computer (Windows, macOS or Linux).

1. Update the system and create a user

Log in over SSH as root, update the packages and create a non-root user. Remote desktops should never run as root.

Bash
ssh root@VPS_IP apt update && apt upgrade -y adduser USER usermod -aG sudo USER

2. Install the XFCE desktop

XFCE is light on memory and CPU, which suits a VPS. dbus-x11 is needed so the session can start without a physical screen.

Bash
apt install -y xfce4 xfce4-goodies dbus-x11 xorg

The install pulls a few hundred packages. You do not need a display manager: NoMachine starts the session itself.

3. Download and install NoMachine

Get the current .deb link for your architecture (amd64 for most VPS) from the Linux download page on nomachine.com, then download it on the server. The version in the example is a placeholder, replace it with the real file name.

Bash
cd /tmp wget "https://DOWNLOAD_URL_FROM_NOMACHINE_COM/nomachine_VERSION_amd64.deb" apt install -y ./nomachine_VERSION_amd64.deb

Using apt install ./file.deb resolves dependencies for you. Check that the server is running:

Bash
/etc/NX/nxserver --status ss -tlnp | grep 4000

NoMachine listens on port 4000 (NX protocol, TCP and UDP).

4. Tell NoMachine to start XFCE

On a server without a screen, NoMachine creates a virtual desktop when you connect. Make sure it launches XFCE by setting the default desktop command.

Bash
grep -n "DefaultDesktopCommand" /usr/NX/etc/node.cfg sed -i 's|^#\?DefaultDesktopCommand.*|DefaultDesktopCommand "/usr/bin/startxfce4"|' /usr/NX/etc/node.cfg /etc/NX/nxserver --restart

The sed line edits the configuration file in place. If grep shows no match, append the line instead with echo 'DefaultDesktopCommand "/usr/bin/startxfce4"' >> /usr/NX/etc/node.cfg.

5. Open the firewall

With UFW, allow SSH first so you do not lock yourself out, then port 4000. Restricting the source to your own IP is strongly recommended.

Bash
ufw allow OpenSSH ufw allow from YOUR_HOME_IP to any port 4000 ufw enable ufw status

If your IP changes often, use ufw allow 4000 instead, and rely on strong passwords or on an SSH tunnel (see the security notes below).

6. Connect with the NoMachine client

  1. Open NoMachine on your computer and click Add.
  2. Name: anything you like. Host: VPS_IP. Port: 4000. Protocol: NX.
  3. Double-click the connection, enter the login and password of USER, and accept the host key.
  4. Choose to create a new virtual desktop if asked. The XFCE desktop appears.

Security and performance tips

  • Do not log in as root; keep a normal user and strong password.
  • To avoid exposing port 4000, close it in the firewall and tunnel instead: ssh -L 4000:localhost:4000 USER@VPS_IP, then connect the client to localhost.
  • Keep NoMachine updated by installing the newer .deb over the old one.
  • Inside the session, disable the XFCE compositor (Settings > Window Manager Tweaks > Compositor) and avoid animated wallpapers.
  • In the NoMachine panel, lower the display quality or resolution on slow connections and disable audio you do not need.

Verification

Bash
/etc/NX/nxserver --status ss -tulnp | grep 4000 ufw status | grep 4000

The status must report that the server is running, and port 4000 must be listening. After login you should see the XFCE panel and be able to open a terminal.

Troubleshooting

  • Connection refused or timeout: the service is stopped or the firewall blocks the port. Run /etc/NX/nxserver --restart and check ufw status and any firewall in front of the VPS.
  • Black screen or the session closes immediately: the desktop command is wrong or XFCE is missing. Check DefaultDesktopCommand in /usr/NX/etc/node.cfg and test which startxfce4.
  • Authentication failed: use the system user and password, not the NoMachine website account. Check that the user exists with id USER.
  • Wrong package architecture: on an ARM VPS, download the arm64 .deb; check with dpkg --print-architecture.

🎉 Your Linux VPS now has a light remote desktop, ready for graphical tools.

Stay up to date with the latest offers, discounts and special promotions.

View promotions

We use cookies

We use analytics cookies to improve your experience on our site. No data is sold to third parties. Learn more in our privacy policy.