Linux

Installing Ubuntu and Understanding GRUB

2026-04-27

Introduction

Ubuntu is one of the most popular Linux distributions in the world. It is beginner-friendly, well-supported, and works great as both a desktop and server operating system. In this tutorial we will walk through installing Ubuntu from scratch, understanding how the GRUB bootloader works, and dual booting alongside Windows if needed.


What You Will Need

Before starting, gather the following.


- A USB drive with at least 8GB of storage

- A computer to install Ubuntu on

- A stable internet connection to download the ISO

- About 25GB of free disk space minimum (50GB or more recommended)


Step 1 — Download the Ubuntu ISO

Go to the official Ubuntu website at https://ubuntu.com/download and download the latest LTS (Long Term Support) release. The LTS version is recommended because it receives security updates for five years.


The downloaded file will be a large .iso file, typically around 5GB in size.


Step 2 — Create a Bootable USB Drive

You need to flash the ISO onto your USB drive to make it bootable. The recommended tool for this is Balena Etcher, available at https://etcher.balena.io for Windows, Mac, and Linux.


Open Balena Etcher and follow these steps.


Select the Ubuntu ISO file you downloaded. Select your USB drive as the target. Click Flash and wait for it to complete.


Warning: this will erase everything on the USB drive, so back up any files on it first.


On Windows you can also use Rufus from https://rufus.ie as an alternative to Etcher.


Step 3 — Boot from the USB Drive

Insert the USB drive into the computer you want to install Ubuntu on and restart it.


You need to enter the boot menu to select the USB drive as the boot device. The key to press varies by manufacturer but is usually one of the following.


F12 is used on most Dell and Lenovo computers. F9 is used on HP computers. F8 is used on some Asus computers. ESC or F2 may also work on various systems.


Press the appropriate key repeatedly as soon as your computer starts. A boot menu will appear allowing you to select your USB drive. Select it and press Enter.


Step 4 — Start the Ubuntu Installer

After booting from the USB you will see the GRUB bootloader menu for the Ubuntu live environment. Select Try or Install Ubuntu and press Enter.


Ubuntu will load a live desktop environment. You can explore Ubuntu from the USB without installing anything at this stage. When you are ready, click the Install Ubuntu icon on the desktop.


Step 5 — Choose Your Language and Keyboard

The installer will ask you to select your language and keyboard layout. Choose your preferences and click Continue.


Step 6 — Installation Type

The installer will ask what kind of installation you want.


Normal installation includes a web browser, utilities, office software, and media players. Minimal installation includes just a browser and basic utilities. This is faster to install and leaves more control to you.


Check Download updates while installing Ubuntu if you have an internet connection. This saves time after installation.


Step 7 — Partitioning Your Disk

This is one of the most important steps. The installer will ask how you want to use your disk storage.


Option A — Erase Disk and Install Ubuntu

This is the simplest option. It wipes the entire disk and installs Ubuntu. Choose this if you are dedicating the whole machine to Ubuntu or setting up a server.


Select Erase disk and install Ubuntu and click Install Now. Confirm the changes when prompted.


Option B — Dual Boot Alongside Windows

If you already have Windows installed and want to keep it, select Install Ubuntu alongside Windows. The installer will automatically resize your Windows partition to make room for Ubuntu.


You can drag the divider to adjust how much space each system gets. Give Ubuntu at least 30GB for a comfortable installation.


Option C — Manual Partitioning (Advanced)

Select Something else if you want full control over your partition layout. A typical manual setup for Ubuntu includes the following partitions.


A swap partition equal to your RAM size, with type set to swap area. A root partition using the remaining space, mounted at /, with format set to ext4.


An optional /home partition is useful if you want to keep your personal files separate from the system, making future reinstalls easier.


Step 8 — Select Your Timezone

The installer will show a map. Click your location or type your city to set the correct timezone. Click Continue.


Step 9 — Create Your User Account

Enter the following information.


Your full name. Your computer's hostname (the name other devices will see on the network). Your username for logging in. A strong password.


You can also choose to log in automatically or require a password on startup. For security, requiring a password is recommended.


Click Continue and the installation will begin. This typically takes 10 to 20 minutes depending on your hardware and internet speed.


Step 10 — Restart Into Your New System

When installation completes, the installer will ask you to restart. Remove the USB drive when prompted and press Enter.


Your computer will reboot and you will be greeted by the GRUB bootloader.


Understanding GRUB

GRUB stands for GRand Unified Bootloader. It is the software that runs before the operating system and lets you choose which system to start.


The GRUB Menu

When your computer starts you will see the GRUB menu with options such as the following.


Ubuntu is the default entry to boot into your Ubuntu installation. Advanced options for Ubuntu lets you choose older kernel versions or recovery mode. If you dual booted, Windows Boot Manager will also appear here.


Use the arrow keys to navigate and Enter to select. If you do nothing, GRUB will automatically boot the default option after a countdown.


GRUB Configuration File

GRUB's main configuration is stored at the following location.


/boot/grub/grub.cfg


You should not edit this file directly. Instead, edit the settings file and regenerate the configuration.


sudo nano /etc/default/grub


The most commonly changed settings are the following.


GRUB_DEFAULT=0 sets which menu entry boots by default. 0 means the first entry. GRUB_TIMEOUT=10 sets how many seconds GRUB waits before auto-booting. GRUB_CMDLINE_LINUX_DEFAULT contains extra options passed to the kernel at boot.


After making changes, always regenerate the GRUB configuration with the following command.


sudo update-grub


GRUB Recovery Mode

If Ubuntu fails to boot, restart and hold Shift during startup to force the GRUB menu to appear. Select Advanced options for Ubuntu and then the recovery mode entry. This gives you access to a root shell, filesystem repair tools, and network configuration for troubleshooting.


Reinstalling GRUB

If GRUB gets overwritten (for example by a Windows update), you can reinstall it by booting from your Ubuntu USB drive and running the following commands. Replace /dev/sda with your actual disk name, which you can find using lsblk.


sudo mount /dev/sda2 /mnt

sudo grub-install --boot-directory=/mnt/boot /dev/sda

sudo update-grub


Step 11 — Update Your System

After booting into Ubuntu for the first time, open a terminal and run the following to install all available updates.


sudo apt update && sudo apt upgrade -y


Then restart if prompted.


sudo reboot


Step 12 — Install Essential Tools

A few packages are useful to have right away.


sudo apt install build-essential curl git vim -y


build-essential provides compilers and build tools needed for many software packages. curl is used for downloading files and testing APIs. git is for version control. vim is a powerful terminal text editor.


Dual Boot Tips

If you are dual booting with Windows, keep the following in mind.


Windows updates can occasionally overwrite GRUB. If this happens, boot from your Ubuntu USB and reinstall GRUB as described above. Always shut down Windows fully rather than using fast startup or hibernate, as this can cause disk corruption when accessed from Linux. You can disable Windows fast startup in Control Panel under Power Options by turning off Turn on fast startup.


Time display issues can occur in dual boot setups because Windows stores the hardware clock in local time while Linux uses UTC. Fix this in Ubuntu by running the following command.


timedatectl set-local-rtc 1 --adjust-system-clock


Troubleshooting


Black screen after installation

This is often caused by a graphics driver issue. Restart and in the GRUB menu press E to edit the boot entry. Find the line starting with linux and add nomodeset before the word quiet. Press Ctrl+X to boot. Once inside Ubuntu install the appropriate drivers from Software and Updates under the Additional Drivers tab.


Ubuntu not appearing in GRUB after dual boot setup

Boot into Windows and open a Command Prompt as administrator. Run the following command to disable its bootloader taking priority.


bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi


No sound after installation

Open a terminal and run the following.


sudo alsa force-reload


Conclusion

You now have a fully working Ubuntu installation with GRUB managing your boot process. Whether you installed Ubuntu as your only operating system or alongside Windows, you have a stable and powerful Linux environment ready to use. From here you can explore the terminal, install software, and start building projects directly on your machine.