Skip to main content

Bare Metal: Install Ubuntu 24.04

Below is a comprehensive, step‐by‐step guide for performing a clean installation of Ubuntu 24.04 as a headless server. This guide covers everything from preparation to post-installation configuration without a desktop environment. Note: A clean installation will erase existing data on the target drive. Be sure to back up any important data before proceeding.


1. Pre-Installation Preparations

a. Verify System Requirements

  • Processor: 2 GHz dual-core or better
  • Memory (RAM): Minimum 4 GB (more recommended for server workloads)
  • Disk Space: Minimum 20 GB (adjust based on your intended server usage)
  • Network: Ethernet or Wi-Fi adapter (wired is preferred for servers)
  • Console Access: Either direct physical access or remote (via IPMI/KVM) since no GUI will be available

b. Backup Your Data

  • Warning: A clean installation will erase all data on the chosen drive. Back up important files and configurations.

2. Download the Ubuntu 24.04 Server ISO

  1. Visit the Official Ubuntu Website:
    Navigate to Ubuntu Server Downloads.

  2. Select Ubuntu 24.04 LTS:
    Click on the Ubuntu 24.04 LTS Server download button.

  3. Download the ISO:
    Save the ISO file to your computer.

  4. Verify the Download (Optional but Recommended):

    • On Linux/macOS:
      sha256sum path/to/ubuntu-24.04-live-server-amd64.iso
    • On Windows:
      Use a tool such as QuickHash to verify the checksum provided on the Ubuntu website.

3. Create a Bootable USB Drive

a. Using Rufus (Windows)

  1. Download and Install Rufus:
    Visit rufus.ie and download the latest version.

  2. Insert a USB Drive:
    Ensure it’s at least 2 GB (all data on the USB will be erased).

  3. Open Rufus and Configure:

    • Device: Select your USB drive.
    • Boot selection: Click “SELECT” and choose the Ubuntu 24.04 Server ISO.
    • Partition scheme:
      • Choose GPT for UEFI systems (most modern PCs).
      • Choose MBR if you need BIOS/Legacy support.
    • File System: Typically “FAT32” (default).
  4. Start the Process:
    Click “START” and confirm any warnings. Rufus will now create your bootable USB drive.

b. Using balenaEtcher (macOS/Linux/Windows)

  1. Download Etcher:
    Go to balenaEtcher and download the version for your OS.

  2. Install and Run Etcher:

    • Select the Ubuntu 24.04 Server ISO.
    • Choose your USB drive.
    • Click “Flash!” and wait for the process to finish.

c. Using the dd Command (Linux/macOS)

Warning: The dd command is powerful. Ensure you’ve selected the correct drive to avoid data loss.

  1. Identify the USB Drive:
    lsblk
  2. Write the ISO to the USB:
    Replace /dev/sdX with your USB device (do not include a partition number, e.g., use /dev/sdb instead of /dev/sdb1):
    sudo dd if=/path/to/ubuntu-24.04-live-server-amd64.iso of=/dev/sdX bs=4M status=progress conv=fdatasync

4. Booting from the USB Drive

  1. Insert the Bootable USB Drive into the server hardware.

  2. Restart Your Server.

  3. Enter BIOS/UEFI Settings:

    • Common keys: F2, F12, DEL, or ESC (refer to your hardware’s documentation).
    • Set the boot order to prioritize booting from the USB drive.
  4. Save and Exit:
    Your server should now boot from the USB drive.


5. Starting the Ubuntu Server Installation

  1. Boot Menu:
    After booting from the USB, you’ll see a text-based installer menu. Since this is a server installation, there is no graphical “Try” mode.
    • Action: Select “Install Ubuntu Server” (or similar option) using your keyboard’s arrow keys and press Enter.

6. Follow the Server Installation Wizard

The installation wizard is text-based and will guide you through the setup. Use the keyboard (arrow keys, Tab, and Enter) to navigate the menus.

a. Select Your Language

  • Screen: “Welcome to Ubuntu Server Installer”
  • Action: Choose your preferred language and press Enter.

b. Select Your Keyboard Layout

  • Screen: “Keyboard Configuration”
  • Action: Choose your layout (often “English (US)” or your regional setting) and press Enter.

c. Configure the Network

  • Screen: “Network Connections”
  • Action:
    • The installer will attempt to configure networking via DHCP.
    • If using a static IP or additional network interfaces, follow the prompts to set up manually.
    • Tip: Ensure your network connection is active so that installation can download updates and packages if needed.

d. Configure the Proxy (If Applicable)

  • Screen: “HTTP Proxy”
  • Action: Enter your proxy settings if required, or leave blank if not using one.

e. Choose a Mirror for Package Updates

  • Screen: “Ubuntu Archive Mirror”
  • Action: Select the appropriate mirror (usually detected automatically) and press Enter.

f. Storage Configuration

  • Screen: “Partition Disks”
  • Options:
    • Guided – use entire disk: For a fully automatic partitioning scheme (this will erase all data).
    • Manual: For custom partitioning (for example, creating separate partitions for /, /var, or swap).
  • Action: Choose your preferred option, confirm any warnings, and proceed.
    • For UEFI systems, ensure an EFI System Partition (≈300–500 MB, FAT32) is created if not already present.
    • Set up the root partition (/) (at least 10–20 GB recommended).
    • Optionally configure a swap area (or use a swap file post-installation).

g. Profile Setup

  • Screen: “Who Are You?”
  • Action:
    • Enter your full name, a username, and a secure password.
    • Configure whether to enable SSH access during installation (highly recommended for headless servers).
    • Tip: Many server installers offer to install and enable the OpenSSH server automatically—confirm this to allow remote management.

h. Feature Selection (Optional)

  • Screen: “Featured Server Snaps” or “Additional Software”
  • Action:
    • You might have options to install services like LXD, Docker, or other server applications.
    • Select the ones you need, or skip if you plan to install them later.

i. Finalize the Installation

  • Screen: “Summary”
  • Action: Review your configuration and confirm to begin installation.
  • The installer will now copy files and configure your system. This process may take several minutes.

7. Finishing Up

  1. Installation Complete:
    Once the process is finished, you’ll be prompted to remove the installation media.

  2. Restart Your Server:

    • Remove the USB drive.
    • Press Enter to reboot.
  3. First Boot:

    • Your server will boot into a command-line login prompt.
    • Log in using the username and password you created during installation.

8. Post-Installation Configuration

a. Update the System

  1. Log In via Console or SSH:
    If you enabled the SSH server, you can now connect remotely.
  2. Update Package Lists and Upgrade Packages:
    sudo apt update
    sudo apt upgrade -y
  3. Clean Up Unused Packages:
    sudo apt autoremove -y

b. Secure Remote Access

  • SSH Configuration:
    The server installer should have set up SSH, but you can further harden it:
    • Edit /etc/ssh/sshd_config to disable root login and consider changing the default SSH port.
    • Restart SSH:
      sudo systemctl restart ssh
  • Firewall Setup with UFW:
    1. Enable UFW:
      sudo ufw allow ssh
      sudo ufw enable
    2. Check Firewall Status:
      sudo ufw status verbose

c. Install Essential Server Packages

  • Install utilities and tools that are commonly used:
    sudo apt install build-essential curl git vim htop -y
  • Note: Since this is a headless server, you won’t install any desktop environments.

d. Configure Networking (If Needed)

  • Use commands like ip a or ifconfig to check your network settings.
  • For advanced networking, edit configuration files in /etc/netplan/ (Ubuntu’s default on recent releases) and apply changes using:
    sudo netplan apply

e. Set Up Automated Backups

  • Consider installing and configuring backup tools (e.g., rsnapshot or borgbackup) to safeguard your server data.
  • Configure a regular backup schedule via cron jobs.

9. Final Thoughts

  • Documentation: Familiarize yourself with Ubuntu Server documentation for advanced configuration and troubleshooting.
  • Community: Ubuntu Forums and Ask Ubuntu are excellent resources for support and tips.
  • Monitoring: Set up system monitoring tools (e.g., netdata, nagios, or prometheus) to keep an eye on server health.

Congratulations! Your Ubuntu 24.04 headless server is now installed, updated, and configured for remote management and further customization. Enjoy your new server environment!