Technical Deep Dive: Converting Ubuntu Desktop to Server Edition with Service Stack Implementation


1 views

Ubuntu Desktop and Server share the same Linux kernel and package management system (APT/dpkg). The fundamental differences lie in:

  • Default installation packages (Desktop includes GUI/Xorg)
  • Init systems (both use systemd)
  • Performance tuning (Server edition has different kernel parameters)

To transform a Desktop installation into a functional server:

# Install LAMP stack
sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php

# Verify services
sudo systemctl status apache2
sudo systemctl status mysql

For a pure server environment:

# Remove GNOME/GDM
sudo apt purge ubuntu-desktop
sudo apt autoremove

# Switch to multi-user target
sudo systemctl set-default multi-user.target

The same principle applies to RHEL-based systems:

# Fedora server conversion
sudo dnf groupinstall "Server with GUI"
sudo dnf install httpd mariadb-server php

After conversion, consider:

  • Setting noop scheduler for SSD storage: echo noop | sudo tee /sys/block/sda/queue/scheduler
  • Adjusting swappiness: echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf

Ubuntu Desktop and Ubuntu Server share the same foundational Linux kernel and package repositories. The primary distinction lies in the default installed packages and initialization systems. While Desktop includes a graphical environment (X11/Wayland) and user-facing applications, Server omits these in favor of headless-oriented services.

To transform a Desktop installation into a functional server, you'll need to install specific server packages:

sudo apt update
sudo apt install apache2 mysql-server isc-dhcp-server

This mirrors the Server edition's default package selection. However, you'll retain the GUI unless explicitly removed.

Running a server on Desktop edition with GUI introduces overhead. For production environments, consider:

sudo systemctl set-default multi-user.target
sudo apt purge ubuntu-desktop

The same principle applies to Fedora and most Linux distributions. The conversion process involves:

sudo dnf groupinstall "Server with GUI"
sudo dnf remove gnome-*

Here's how to configure Apache with PHP on a converted Desktop system:

sudo apt install php libapache2-mod-php
sudo systemctl restart apache2
echo "" | sudo tee /var/www/html/info.php

Server conversions require proper service management. Example for MySQL:

sudo systemctl enable mysql
sudo mysql_secure_installation