Debian 9 Installation Guide

Debian 9 Installation Guide_Choose Graphical Install

This Debian 9 Installation Guide will help you to install one of the most stable distros of Linux.

Users showed great ardor for Debian because of its stability. As a result, Debian is popular both for desktop users and server administrators. Most noteworthy, it’s key values include stability and freedom through the use of open source software lead to Debian more attractive for developers.

What’s new:

Debian 9 Stable edition with codename ‘Stretch’ comes with the following advancements:

  • Kernel 4.9
  • Default MySQL is now MariaDB 10.1
  • LibreOffice 5.26
  • GNOME Desktop Environment 3.2
  • KDE Plasma 5.8
  • Xfce 4.12
  • PHP 7
  • A new version of GIMP 2.8.18
  • Firefox 45.9
  • Python 3

If you are thinking about installing Debian stable, this Debian 9 Installation Guide will help you to perform and understand the installation. However, if you prefer more recent software, you can proceed with installing Debian Testing.

Debian 9 Installation process

For the experienced user, the installation process for Debian does not pose any difficulty. To the novice, there are things confusing and frightening. For example, there is an assortment of installation images and finding a right download link may not be easy. The installer is also little more advanced than some the installer popular Ubuntu or Linux Mint. But don’t worry, I will show and explain you everything.

Download an installation image

First, go to the official Debian downloads page and click on “Getting Debian”.

Debian 9 Installation Guide_Getting Debian 9 Stretch
Debian 9 Installation Guide: Getting Debian 9 Stretch

Next, you have options to download Debian.

For example, the “Live” flavor of the Debian installation image is good for testing hardware, but it is not meant for installation.

You need to download the actual Debian installation images.

Debian 9 Installation Guide_installation images option
Debian 9 Installation Guide: Installation Images Option

As shown above, you can choose between the installation images:

  • a small network installation image
  • a complete installation image.

If your internet speed is reasonable, I advise you to proceed with the network installation image. Otherwise, download the complete installation image.

On this download page, you are also given a choice between i386 and amd64 architectures. Unless you intend to install Debian 9 on an old machine, you should download the 64-bit ISO.

Debian 9 Installation Guide_installation images
Debian 9 Installation Guide: Installation Images

No Wi-Fi, video, or sound during installation

If you only have access to the Wi-Fi connection and your wireless does not work in the standard Debian ISO, you probably need to use Debian non-free installation image, which includes the proprietary drivers for your Wi-Fi card. The standard Debian ISO does not include non-free software because Debian has a very strict policy against proprietary software. With this in mind, it is not that easy to find these images on the Debian website.

You download the Debian non-free ISO by clicking on the link below, or you can find it by searching for the term “Debian non-free ISO” in Google.

https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/

Furthermore, you can use the non-free Debian ISO, if you experience any problem with your graphics card when you boot from the standard Debian ISO.

Debian 9 Installation Guide_non_free image
Debian 9 Installation Guide: Non-Free Image

Boot from the CD/DVD or the USB device

Once the image file is downloaded then burn it either into USB Drive. I also recommend making a backup of all the necessary files and directories before starting the installation.

In addition, you have to configure the system to boot from USB or DVD. In case, if your computer does not boot automatically, You need to access the “Boot menu” or modify the “Boot order” in the BIOS during the start-up.

Usually, some of the FXX (e.g. F12), DEL, ESC keys give you access to the boot options. The key to access BIOS or boot menu should be shown during the start-up.

After booting DVD, Choose “Graphic Install” to begin the Debian Installation in graphical mode.

Debian 9 Installation Guide_Choose Graphical Install
Debian 9 Installation Guide: Choose Graphical Install

Choose Language, Location, and keymap

Choose your language for the installation process, and select your location. This will be used to set your local time, currency etc.

Debian 9 Installation Guide_Choose language & location
Debian 9 Installation Guide: Choose Language & Location

At this instant, configure the system locales (language and country combination) and click Continue.

Debian 9 Installation Guide_Choose locale & key-map
Debian 9 Installation Guide: Choose Locale & Keymap

Next, the installer will now load components from the CD as shown below.

Debian 9 Installation Guide_loading components from CD
Debian 9 Installation Guide: Loading Components from CD

Configure the network

In the hostname, you assign the name to your computer. Moreover, here you can also assign a Domain Name as per your needs and requirement. I usually keep it empty. After you entered your computer name, click on Continue.

On the next screen, you can enable a root password. However, you can also leave it empty and this way, the user account will have administrative privileges with the command sudo. I recommend to keep it empty for new users. So, just leave it empty and configure your user password in the next screen (see below).

Debian 9 Installation Guide_host-name_domain_password-min
Debian 9 Installation Guide: Host Name Domain and Password

Create a new user

At this stage, enter your name and username. The user password entered here will be subsequently used for administrative privileges (you will need to use sudo).

Debian 9 Installation Guide: User Account and Username Password

Partition your Disk

By all means, be very careful here because if you do this step wrong, it will be very difficult (but possible, see this guide) to change it later. Also, if you have any data on the computer where you intend to install Debian, back up it!

For this Debian installation, I will show you three ways I do disk partitioning.

1. Automatic partitioning

To the novice, it is recommended to proceed with Guided partition. Guided partition method automates operations including formatting.

2. Install with existing home partition

For expert users, if you already have a Linux distro installed, you can reuse its home partition. You just need to skip the formatting step for /home and only reinstall the system in the system partition. To do that, you need to proceed with manual partitioning.

So, select Manual and click Continue.

Debian 9 Installation Guide_host_Manual partition-min
Debian 9 Installation Guide: Manual Partition
System Partition

I assume here that your first partition is the system partition. So, select it, assign root mounting point (/) to it, and choose the file system (ext4 is a popular one). Next, click to format it

Debian 9 Installation Guide_select _system partition _file system
Debian 9 Installation Guide: Select Partition File System

Optionally, you can also name this partition as a system partition.

Debian 9 Installation Guide_select _system partition _mounting point
Debian 9 Installation Guide: Select System Partition and Mounting Point

In the end, set the bootable flag on, check if everything is configured correctly and click on Done.

Debian 9 Installation Guide_check partition
Debian 9 Installation Guide: Check Partition

Next, proceed with the home partition.

Home Partition

Select your home partition. This is the partition where all your data resize and you do not want to format it.

You need to select the same file system you had before on this partition. If you do not know what file system you had on it, it is probably the ext4. You can check the file system with lsblk -f command.

Debian 9 Installation Guide_home partition_file system
Debian 9 Installation Guide: Home Partition File System

At this point, do NOT select format, the point is that you want to keep this partition intact with all the data on it. Again, I remind you to make a backup of this partition before you do anything because you may make a mistake and all your data will be gone.

Next, assign the mounting point to home.

Debian 9 Installation Guide_home partition_mounting point _done
Debian 9 Installation Guide: Home Partition Mounting Point Done

Now, check the summary of your partition configuration and make sure that your home partition has none in the Format the partition option. It is also good to check all other settings and then apply the changes by selecting Finish partitioning and write changes to disk.

Debian 9 Installation Guide: Home Partition Finish

I usually do not create a swap partition because I use a swap file instead. You can also create a swap file after the installation, or add a swap partition before you write changes to the disk.

Debian 9 Installation Guide_home_partition_swap partition_write changes
Debian 9 Installation Guide: Home Partition Swap Partition & Write Changes

Confirm the partitioning as shown in the images above and you are done.

3. New manual partitioning

You need to follow this scenario if you either have a brand new hard drive or you want to wipe all data from your hard drive and create a new partition table.

Click on the hard drive and select to create a new partition table. Then proceed in a similar way as described above in scenario 2, except that here you format both home and root partitions.

Debian 9 Installation Guide _create new partition
Debian 9 Installation Guide: Create a New Partition

Configure the Package Manager

You have only one installation image when you are asked about inserting another CD, select No.

Next, select your location and any mirror from your country. Usually, the top one works fine.

Debian 9 Installation Guide_Package manager configuration
Debian 9 Installation Guide: Package Manager Configuration

If you access to the internet through the proxy, configure it here, otherwise keep these field blank.

Debian 9 Installation Guide_proxy
Debian 9 Installation Guide: Proxy

Enable Popularity Contest

It is up to you if you agree to participate in the usage survey, but I encourage you to agree because it will help the Debian project to make future versions of Debian better.

Debian 9 Installation Guide_popularity contest
Debian 9 Installation Guide: Popularity Contest

Desktop selection

Now, select the preferred desktop environment to install. By default, Debian will install GNOME desktop. Personally, I prefer the XFCE desktop in Debian because it is very a lightweight, yet still visually appealing desktop experience.

Debian 9 Installation Guide_desktop environment
Debian 9 Installation Guide: Desktop Environment

Install Bootloader

Once the desktop is installed, the next window will offer you to install a bootloader.

In case you install Debian as a secondary system and you are going to boot it with a bootloader from another Linux system, you can skip this step. However, the majority of users will not do that, so you most likely need to install a bootloader.

So, select Yes and install it on the same hard drive where your system is going to be installed.

Debian 9 Installation Guide_Grub boot loader
Debian 9 Installation Guide: Grub Bootloader

Finish the System Installation

Wait some time until the installation finishes and then remove your installation media and proceed with the reboot.

Debian 9 Installation Guide_finish installation
Debian 9 Installation Guide: Finish Installation

Hopefully, you will see the Debian Xfce desktop or whatever you chose.

Debian 9 Installation Guide: Default Look

Things to do after the installation

For most intents and purposes, you can start using Debian as it is, but I recommend to do a few things after the installation.

Adding contrib and non-free to Debian 9

Debian 9 Stretch default repositories are usually enough. But you can extend the list of packages you can install by adding contrib and non-free repositories. The package repository information is stored on the /etc/apt/sources.list file. Further, you may edit this file to add a new package repository.

Open /etc/apt/sources.list using Nano text editor.

sudo nano /etc/apt/sources.list

When you open it, you will see the content with default repositories configured:

Debian 9 Installation Guide: Default repositories
Debian 9 Installation Guide: Default repositories

To have the contrib and non-free components, add contrib non-free after main as shown below:

Debian 9 Installation Guide_contrib
Debian 9 Installation Guide: Contrib

Once you are done, press Ctrl+O to save and Ctrl+X to exit.

After you have made changes to the sources.list file, we need to update:

sudo apt update
Debian 9 Installation Guide_Refresh the repositories
Debian 9 Installation Guide: Refresh the Repositories

After these simple steps, you should be able to install some non-free programs such as Microsoft fonts, for example.

<span style="color: #666666; font-family: Consolas, Monaco, 'Lucida Console', monospace; font-size: 0.857143rem;">sudo apt install ttf-mscorefonts-installer</span>
Debian 9 Installation Guide_MS fonts
Debian 9 Installation Guide: install MS fonts

Enable the latest security updates

Debian 9 is secure and stable already, but you can improve it even further to get the latest security updates as soon as they are released without waiting for the next point release (e.g. Debian 9.1).

For this purpose, you can add this security repository to your /etc/apt/sources.list:

# latest security updates

deb http://security.debian.org/ stretch/updates main contrib non-free
Debian 9 Installation Guide_security updates
Debian 9 Installation Guide: Security Updates

Receive the bug fixes as quickly as possible.

Similarly, you can also extend your repository list to receive bug fixes as quickly as possible, i.e. without waiting for the point release. Add this line to your /etc/apt/sources.list:

# proposed additions

deb http://ftp.us.debian.org/debian stretch-proposed-updates main contrib non-free
Debian 9 Installation Guide_proposed addition
Debian 9 Installation Guide: Proposed Addition

Again, every time you add new repositories, update the system.

Debian 9 InstallationGuide_update repositories
Debian 9 Installation Guide: Update Repositories

Proprietary drivers

At the time of creating this tutorial, I don’t have a dedicated graphics card or a WiFi card. So, I cannot demonstrate how to install proprietary drivers. However, for your convenience I want to provide you links to Debian wiki pages on how to install nVidia, AMD Graphic card, and WiFi drivers.

Graphics Card

https://wiki.debian.org/GraphicsCard

Nvidia

https://wiki.debian.org/NvidiaGraphicsDrivers

ATI

https://wiki.debian.org/AtiHowTo  https://wiki.debian.org/ATIProprietary

https://www.reddit.com/r/debian/comments/4a8nyq/fglrx_for_debian_9_will_it_get_back/

WiFi driver

https://wiki.debian.org/WiFi

https://www.youtube.com/watch?v=eUnfVG7Zst0

Conclusion

Following Debian 9 install guide, you should now have a fully functional Debian 9 Stretch. Debian is not well configured by default, so I usually also do a number of things after the installation to improve it. If you installed Debian with XFCE desktop, you can also configure it to look more modern and beautiful.

If you find Debian Stable too outdated, you can also consider installing Debian Testing and receive more up-to-date software.

Please share your feedback in the comments section below.

Average Linux User
Average Linux User I am the founder of the Average Linux User project, which is a hobby I work on at night. During the day I am a scientist who uses computers to analyze genetic data.

Comments


itaavo

Thank you for the instructions. As a beginner Linux user it teaches a lot about installing options and what is recommended an what not. I have one question though. If I want to keep running my Debian as stable version, can I use then “stable” instead of “testing” as a version in sources list?


Ben Jones

I specifically need to install 8.6 as it's for a Caldera machine and for some reason I can not get Caldera to work with version 10 of Debian.

Is there any way of tricking it into installing the GRUB?

Sorry I'm completley new to all of this!!

Ben Jones

An installation setp has failed. You can try to run the failing item again from the menu, or skip it and choose something else. The failing step is: Install the GRUB boot loader on a hard disk”

Average Linux User

Average Linux User

I don't think it's SSD problem. It's rather EFI. I cannot say for sure that it cannot be installed. You need to research this topic. I only can say that both Debian 8 and 9 failed to install in the EFI mode on my computers. Debian 10 installed fine.



Learn how to write in Markdown with this Quick Reference.
Notify me of new comments on this post.
* E-mail is used to display Gravatar.