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
-
Visit the Official Ubuntu Website:
Navigate to Ubuntu Server Downloads. -
Select Ubuntu 24.04 LTS:
Click on the Ubuntu 24.04 LTS Server download button. -
Download the ISO:
Save the ISO file to your computer. -
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.
- On Linux/macOS:
3. Create a Bootable USB Drive
a. Using Rufus (Windows)
-
Download and Install Rufus:
Visit rufus.ie and download the latest version. -
Insert a USB Drive:
Ensure it’s at least 2 GB (all data on the USB will be erased). -
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).
-
Start the Process:
Click “START” and confirm any warnings. Rufus will now create your bootable USB drive.
b. Using balenaEtcher (macOS/Linux/Windows)
-
Download Etcher:
Go to balenaEtcher and download the version for your OS. -
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.
- Identify the USB Drive:
lsblk
- 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
-
Insert the Bootable USB Drive into the server hardware.
-
Restart Your Server.
-
Enter BIOS/UEFI Settings:
- Common keys:
F2
,F12
,DEL
, orESC
(refer to your hardware’s documentation). - Set the boot order to prioritize booting from the USB drive.
- Common keys:
-
Save and Exit:
Your server should now boot from the USB drive.
5. Starting the Ubuntu Server Installation
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
-
Installation Complete:
Once the process is finished, you’ll be prompted to remove the installation media. -
Restart Your Server:
- Remove the USB drive.
- Press Enter to reboot.
-
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
- Log In via Console or SSH:
If you enabled the SSH server, you can now connect remotely. - Update Package Lists and Upgrade Packages:
sudo apt update sudo apt upgrade -y
- 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
- Edit
- Firewall Setup with UFW:
- Enable UFW:
sudo ufw allow ssh sudo ufw enable
- Check Firewall Status:
sudo ufw status verbose
- Enable UFW:
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
orifconfig
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
orborgbackup
) 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
, orprometheus
) 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!