Installing Linux OS with SSH on a Headless Computer: A Step-by-Step Guide

Abstract: Enables remote SSH access to a headless computer during Linux installation by configuring network settings and automating package deployment.

Created: 2026-08-31 by

Installing a Linux operating system on a headless computer requires preparing an installation medium with SSH enabled before the first boot. By modifying the installer image to include OpenSSH server packages and configuring network settings, you can access the machine via terminal once it connects to your local network. This method eliminates the need for physical peripherals during the initial setup phase.

Preparing the Installation Medium

The core challenge in headless installation is ensuring that the remote shell service starts automatically after the graphical or text-based installer finishes. Standard Ubuntu Server images often require manual intervention to enable SSH if the network configuration changes during installation. To streamline this process, you should use a modified ISO or create a custom bootable drive. First, download the standard Ubuntu Server ISO file from the official repository. You do not need the desktop environment; the server variant is lighter and defaults to a command-line interface, which is ideal for headless setups. Once downloaded, verify the checksum to ensure the integrity of the file. Next, prepare a USB drive or write the ISO to a CD/DVD. If using a USB drive, tools like dd on Linux or Rufus on Windows are effective. The critical step here is not just burning the image, but potentially injecting the necessary SSH configurations into the initramfs or the installer environment. For most modern Ubuntu releases, simply enabling the SSH service during the user creation phase of the installer is sufficient, provided you have network connectivity. If you wish to automate this further, consider using preseed files. A preseed file allows you to answer all installer questions in advance, including setting up the root password and installing the openssh-server package automatically. This removes human interaction entirely from the installation process.

Network Configuration Before Boot

Before inserting the installation media, ensure your target machine has a stable network connection. Since you lack a monitor, you cannot easily configure Wi-Fi or complex static IP addresses through a GUI. Ethernet is strongly recommended for its reliability and simplicity. Connect the headless computer directly to your router or switch using an Ethernet cable. Verify that the DHCP server on your network is active and assigning IP addresses correctly. You will need to identify the MAC address of the network interface card (NIC) on the target machine. This can often be found on a sticker on the chassis or by checking the BIOS/UEFI settings if you have brief physical access. Once you know the MAC address, reserve a static IP address in your router’s DHCP settings. This ensures that every time the machine boots, it receives the same IP address, making it easier to locate via SSH later. Without this step, you might spend considerable time scanning your network for a new device with a changing IP.

Locating the Machine on the Network

After powering on the machine with the installation media inserted, wait for the installation to complete. The duration depends on the hardware speed and the size of the installation. During this time, the machine will reboot and attempt to establish a network connection. Use a network scanning tool on your primary computer to find the new device. Tools like nmap or fing can scan your subnet for devices with open port 22, which indicates an SSH server is running. Alternatively, check your router’s connected devices list for a host with the reserved IP address or the expected hostname. If the machine does not appear, verify the BIOS settings. Ensure that "Boot from LAN" or PXE boot is disabled if you are using a USB stick, and that the USB drive is set as the primary boot device. Some motherboards may default to attempting a network boot instead of the local media.

Establishing the First SSH Connection

Once you have identified the IP address of the newly installed system, initiate an SSH connection from your main computer. Use the username and password you defined during the installation process. If you used a preseed file, these credentials were set automatically. Run the following command in your terminal:
ssh username@ip_address
Replace username with your chosen account name and ip_address with the reserved IP. You will be prompted to accept the host key fingerprint and then enter the password. Upon successful authentication, you will see a command prompt, confirming that the headless installation was successful. From this point forward, you can manage the system entirely remotely. It is advisable to update the system immediately after logging in to ensure all security patches are applied. Run sudo apt update && sudo apt upgrade to fetch and install the latest packages. For enhanced security and convenience, consider setting up passwordless SSH keys. This allows you to connect without typing a password each time, which is particularly useful for scripting and automated tasks. You can generate a key pair on your local machine and copy the public key to the headless server using ssh-copy-id.

Troubleshooting Common Issues

Headless installations can occasionally fail due to network timeouts or incorrect bootloader configurations. If the machine fails to boot from the installation media, check the BIOS date and time settings. An incorrect system clock can sometimes cause certificate validation errors during the installation process. If you cannot ping the machine but suspect it is powered on, try connecting a monitor temporarily to view the console output. This will reveal any error messages related to disk partitioning or network driver failures. Once resolved, you can remove the monitor and continue managing the system via SSH. Another common issue is the firewall blocking incoming connections. While the Ubuntu installer typically configures UFW (Uncomplicated Firewall) to allow SSH, verify that the rule is active. You can check the status with sudo ufw status and ensure that port 22 is listed as allowed. For more detailed guidance on connecting to your system, refer to our guide on Connecting to Ubuntu using ssh over Ethernet. Additionally, if you encounter issues with duplicate credentials or connection hangs, consult our articles on SSH Credentials Added Twice and Troubleshooting SSH Hangs.

Frequently Asked Questions

Can I install Linux on a headless computer without a static IP?

Yes, but it is highly discouraged. Without a static IP, the machine may receive a different address after each reboot, making it difficult to locate via SSH. Using your router’s DHCP reservation feature based on MAC address is the simplest solution.

What if I forget the SSH password during installation?

If you did not set a password in a preseed file, you may need to boot into recovery mode. Insert the installation media again, select the recovery option, and reset the root password. This requires brief physical access to the machine.

Is it safe to leave SSH enabled on a headless server?

It is safe if you follow best practices, such as disabling root login via SSH and using strong passwords or key-based authentication. Regularly updating the system and monitoring logs helps maintain security against unauthorized access attempts.

How do I access the BIOS on a headless machine?

You generally need a monitor to configure BIOS settings. However, some enterprise motherboards support remote BIOS configuration via IPMI or iDRAC interfaces. If available, use these management tools to adjust boot order and network settings without a display.

Can I use Wi-Fi for headless Linux installation?

While possible, it is significantly more complex. Most server installers do not provide a straightforward way to configure Wi-Fi networks during the initial setup. Wired Ethernet is the standard recommendation for reliable headless deployments.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More