Install a Minimal Headless Debian Server
This guide outlines the complete process for deploying a lightweight, headless Debian server without a graphical user interface. You will learn how to obtain the minimal installation media, navigate the essential installation prompts, exclude unnecessary desktop packages, and configure remote SSH access so the machine can operate independently without a monitor, keyboard, or mouse.
1. Download the Minimal Media
Download the Debian "Netinst" (Network Installer) ISO from the
official Debian website. This minimal image contains only the core
installer; all required packages will be downloaded during setup,
ensuring a clean and up-to-date base system. Flash the ISO to a USB
drive using a tool such as Rufus, BalenaEtcher, or the dd
command.
2. Boot the Installer
- Insert the installation media into the target machine and boot from it via the BIOS/UEFI boot menu.
- Select Install (text mode) or Graphical Install. The standard text-based installer uses fewer resources and works identically for a server setup.
3. Configure Localization and Network
- Select your preferred Language, Country, and Keyboard layout.
- Enter a Hostname (the name identifying the server
on your local network, e.g.,
debian-server). - Enter a Domain name (leave blank if you do not use a local domain).
4. Set Up User Accounts
- Root Password: Enter and confirm a strong password
for the root administrative user. (If left blank, Debian disables the
root account and grants full administrative privileges to the primary
user via
sudo.) - User Account: Enter the real name, username, and password for a standard non-root user.
5. Partition the Storage Drive
- Select Guided - use entire disk for a standard server setup. (Alternatively, select LVM if you plan to resize partitions later.)
- Choose the target hard drive or SSD.
- Select All files in one partition (recommended for
new users) or separate partitions for
/var,/tmp, and/homedepending on your requirements. - Select Finish partitioning and write changes to disk, then confirm with Yes.
6. Configure the Package Manager
- Select a mirror country close to your physical location.
- Choose an official Debian archive mirror (e.g.,
deb.debian.org). - Leave the HTTP proxy field blank unless your network requires a proxy to access the internet.
- Choose whether to participate in the package usage survey (Popularity Contest).
7. Software Selection (Crucial Step for Headless)
When the Software selection screen appears:
- Uncheck "Debian desktop environment" and any specific desktop environments (GNOME, XFCE, etc.).
- Check "SSH server" to enable remote command-line access.
- Check "standard system utilities" for basic terminal tools.
- Press Continue to install only the base packages.
8. Install the GRUB Bootloader
- When prompted to install the GRUB bootloader to the primary drive, select Yes.
- Choose the drive where Debian was installed (e.g.,
/dev/sdaor/dev/nvme0n1).
9. First Boot and Headless Configuration
Finish the installation, remove the USB drive, and allow the server to reboot.
Log in at the local terminal with the user account created during setup.
Identify the server's IP address:
ip aVerify the SSH service is active:
sudo systemctl status sshLog out, disconnect the monitor and keyboard, and connect to the server remotely from your local computer:
ssh username@server_ip_address