How to Install Debian “the Hard Way” – Text-Based Method
debian Guide Installation LinuxHi all, and welcome to MusaBase! In this article, I'll guide you through installing Debian from the ground up, the true "hard way". In this guide, I'll teach you, how to:
- Create a Debian Bootable USB
- Disk Partitioning & Formatting for Debian
- Setting up the Live Debian Environment
- Base Debian Installation
- Install Desktop Environment
This guide will empower you with a deep understanding of your Debian system's internals, allowing for a truly customized and minimal insallation. Ready to master Debian? Let's dive in.
Jump To:
- Step 1: Acquire the Correct Debian ISO Image.
- Step 2: Create a Bootable USB Drive.
- Step 3: Boot into the Debian Live-USB Environment.
- Step 4: Prepare Debian Live Environment.
- Step 5: Configure the Hard Drive & Install the Base System.
- Step 6: Install a Desktop Environment & Additional Packages.
- Afterwards
Step 1: Accquire the Correct Debian Linux ISO Image
- Go to Debian.org and click on other downloads.
- Under Download an installation image click on complete installation image.
- Pick your download method, direct HTTP, download manager, or BitTorrent. All deliver the same ISO, so choose whichever you prefer.
- Select the ISO that matches your CPU architecture: amd64 for modern 64-bit or (x86_64) systems or i386 for older 32-bit machines.
- On the final page, scroll down to bottom and click on debian-12.11.0-amd62-netinst.iso.torrent.
When the downloading finishes, you'll have an ISO file such as:
Step 2: Create a Bootable USB Drive
2.1: Using Balena Etcher (GUI) if using Windows/Mac/Linux
2.2: Using dd (CLI) if using Linux
Note: Be careful while using dd and selecting your USB drive as dd will overwrite it.
- Plug your USB drive into your pc.
- Open terminal and run the following command to identify your USB:
lsblk
- Look for your USB (e.g., /dev/sdb or /dev/nvme0n1). Note the name for your USB drive.
- Unmount the USB (if mounted) by running this command:
sudo umount /dev/sdX
Note: Replace X with your USB device (e.g., sdb1).
- Next, write the ISO to USB by running this command:
sudo dd if=/mnt/sdc1/Downloads/debian.iso of=/dev/sda bs=4M status=progress oflag=sync
Note: Replace the /mnt/sdc1/Downloads/debian.iso and /dev/sda with your actual path where the debian.iso is located and to your USB.
- if=: Input file (ISO path).
- of=: Output device (USB, e.g., /dev/sdb).
- bs=4M: Block size for faster writing.
- status=progress: Shows progress.
- oflag=sync: Ensures data is written properly.
- After dd finishes writing ISO to USB, eject your USB by running this command:
sudo eject /dec/sdX
⚠️ Warning: Using dd incorrectly can overwrite your hard disl. Double-check if= and of= before executing.
Step 3: Boot into Linux Live ISO Environment
Now that you have downloaded the debian's iso image and have booted your USB with the image, lets install it.
3.1: Disable Secure Boot
- Reboot your PC.
- While your pc is restarting press F9, F10, F11 F12, Del or ESC key to go into your BIOS/UEFI.
- Look for Secure Boot and disable it under Security or Advanced Options depending on your motherboard's firmware.
- Save & Exit.
3.2: Boot from USB
- After saving the changes made to firmware and exiting will reboot your PC.
- Again press F9, F10, F11 F12, Del or ESC (depending on your BIOS/UEFI) key to boot from USB.
- Debian's GRUB menu will load and you would have this screen on your display:
Here we have a few options, such as:
- Graphic Install.
- Install
- Advanced Options
- Choose the second option Install and press Enter.
Step 4: Prepare Debian Live Environment
Before partitioning your hard drive and installing the Debian's base system, we need to configure language, locale, keyboard settings.
Navigating Debian's Text-Based Environment
- Press (Up ) & (Down ) arrow keys to navigate upward or downward.
- Press (Left ) & (Right ) arrow keys to navigate left & right.
- Press Tab Key TAB to select through different options (e.g., Continue, Back, etc).
- Press Spacebar SPACE to select/deselect in a list of options.
- Press Enter ENTER to confirm selected choices or to continue to next screen.
4.3: Select Keyboard Layout
- Choose your desired keyboard layout or keymap and press Enter.
- I've opted for American English.
4.4: Enter Hostname
- After setting the Keyboard layout you'll be prompted to enter a Hostname.
- Type a name for your system and press Enter.
Note: Next, you'll be asked for a domain Name and the root password. Leave both blank, we can configure them later once Debian is installed.
Set up users and passwords
- We will now create a regular user.
- Enter a username for your user and press Enter.
- On the next prompt it will ask you for Account Name of your user.
- You can type any name you want, but for simplicity i'm typing my user's name for my account name as well.
4.4.1: Set Password for User's Account
- Next, enter and re-enter password for your user's account.
Step 5: Configure the Hard Drive & Install the Base System
5.1: Partitioning & Formatting the Hard Drive
Debian offers two partitioning methods:
5.1.1: Auto Partitioning (Guided Partitioning)
In Guided Partition, we have two options:
- Use the largest continuous free space. Automatically finds free space on your drive(s) and creates partitions there.
This option will automatically reserve and use the Continuous free space in a hard drive or any hard drive (if multiple storage devices are connected) to create partitions and install the base linux system.
- Use entire disk. Erases the selected disk and dedicates it entirely to Debian.
This option will use a entire hard drive connected to your pc. It will erase any data on the selected hard drive and create partitions on the drive and install the base linux system.
- For simplicity, choose Use entire disk and press Enter.
- Select your target drive and press Enter.
- Choose All files in one partition (recommended for new users) and press Enter.
- Select Finish partitioning and write changes to disk and press Enter.
- Review the layout ESP (boot partition), SWAP (Swap partition), and EXT4 (Root partition).
- Press Tab to choose Yes and press Enter.
5.1.2: Manual Partitioning
Manual mode lets you customize each partition's size and type, useful if you want separate /home, /usr, etc.
- Choose Manual and press Enter.
- In the manual window box we can see our connected storage drives as sda and sdb.
- By default debian select the first phsyical connected hard drive and have already created a generic partition table.
- I am going to select my sda drive to delete all already made partitions to create new one.
- Choose your drive and press Enter.
- On the next prompt asking "Create a new empty partition on this device?", confirm by press Tab to choose Yes and press Enter.
- Now, as you can see in the following second image we have a completely free hard drive to work with.
Creating the Boot Partition
- Select FREE SPACE and press Enter.
- Choose Create a new partition and press Enter.
- Next, remove the already assigned space figure by pressing BACKSPACE.
- Allocate either 512MB or 1GB to boot partition.
- I am allocating 1GB for my boot partition.
- Note: Enter captial M for Megabytes (MB) and captial G for Gigabytes (GB) after allocating numeric digits in the prompt. (e.g., 1G, 512M) and press Enter.
- On the next prompt it will ask you for creating this partition at the Beginning or End.
- Select Beginning and press Enter.
- For simplicity choose Name and press Enter.
- Type Boot and press Enter.
- Choose Use as: and press Enter.
- Navigate down to EFI System Partition and press Enter.
- Select Done setting up the partition and press Enter.
Creating the Swap Partition
- Select FREE SPACE and press Enter.
- Press Enter on Create a new partition.
- I am allocating 4GB for my Swap partition.
- Allocate your desried amount of space for your Swap partition (e.g., 1G or 4G) and press Enter.
- Choose Beginning and press Enter.
- Next, name this partition by press Enter on Name:.
- Type Swap and press Enter.
- Next, select Use as: and press Enter.
- Navigate down to swap area and press Enter.
- Next, for finishing the Swap partition select Done setting up the partition and press Enter.
Creating the Root Partition
- Select FREE SPACE and press Enter.
- Press Enter on Create a new partition.
- Create a new partition using the remaining space.
- Press Enter on Name:.
- Type root and press Enter.
- We don't need to format this partition to any file system like we did for boot and swap, because by default linux creates partition in EXT4 format.
- Navigate down to Done setting up the partition and press Enter.
Write Changes to Disk
- When all partitions are defined, select Finish partitioning and write changes to disk and press Enter.
- Next on the confirmation prompt, select Yes and press Enter.
5.2: Base System Installation
- Once partitioning is complete, Debian will format your partitions and automatically install the base linux system.
Step 6: Install a Desktop Environment & Additional Packages
6.1: Configure the Package Manager
After the base system is installed, you will be prompted about installing other media if you are installing debian from a CD/DVD without any internet connection then choose Yes otherwise skip this step by choosing No.
- Select your preferred debian archive mirror country and press Enter. (I chose United States).
- Next, pick your closest mirror server and press Enter.
- I am selecting the default deb.debian.org.
- Next, for HTTP Proxy Information, i am leaving this blank. But if you want to set any proxy, here you can set it.
- After configuring package manager, debian will start installing additional necessary packages.
- When asked whether to Send Statistics to Developers, I opted No, but you can choose your preference.
6.2: Install Desktop Environment
- After debian finish configuring the package manager it will ask you about what Desktop Environment you want to install.
- I am selecting KDE Plasma, choose your preffered desktop environment by choosing with your keyboard arrow keys. (Down for downward & UP for upward).
- Press SPACE on your desired Desktop Environment and press Enter to continue.
- The installer will download and install the chosen desktop packages, this may take 10-15 minutes, depending on your connection.
6.3: Reboot
- Once the desktop installtion finishes, you'll see a prompt to reboot.
- Press Enter on Continue and your PC will reboot.
- Your PC will restart, and you'll be ready to log in to your new Debian system.
Step 7: Booting into Freshly Installed Debian System
- After rebooting your PC once the desktop environment is installed, you'll arive at the GRUB bootloader menu.
- Press ENTER on Debian GNU/Linux.
- After a few seconds you will be greeted by debian's display manager for logging into desktop environment installed on debian system.
7.1: Login into Debian's Desktop Environment
- At the login screen, enter the password you set during installation.
- After a few seconds you will be in your Debian system with your installed Desktop Environment.
Afterwards
Here you go now you have installed Debian Linux System the hard way with the freedom to partitioning your hard drive and in a most minimal way. Just don't forget to run the sudo apt update from time to time.
🎉 Congratulations! your Debian Linux system is now up and running!
If you hit any snags, drop a comment below, I'm here to help.
If this guide helped you, subscribe to our newsletter for more step-by-step tutorials.
1O1 out, I'll see you in the next one!