debian server setup guide

Debian Server Setup Guide: Beginner's Tutorial

By David Anderson
AD

Setting up a Debian server can be a straightforward process with the right guidance. This guide will walk you through the essential steps, ensuring you have a robust, secure, and well-configured server ready for your needs. Whether you're a seasoned Linux user or just starting out, this step-by-step guide will help you master the Debian server setup.

Before we begin, make sure you have a decent internet connection, a blank USB drive for creating a bootable installation media, and a computer to install Debian onto. For this guide, we'll focus on the most recent stable version of Debian, which is 11 (Bullseye) at the time of writing.

Understanding Debian Server Editions

Debian offers several server editions, each tailored for specific use-cases. The most common are the standard and minimal installations.

AD
Setup a minimal Debian 10 "buster" server as a Linode VPS - PragmaticLinux
Setup a minimal Debian 10 "buster" server as a Linode VPS - PragmaticLinux
How to Install OpenNMS Horizon on Debian 12
How to Install OpenNMS Horizon on Debian 12
How to Setup iSCSI Server (Target) and Client (Initiator) on Debian 9
How to Setup iSCSI Server (Target) and Client (Initiator) on Debian 9

The standard installation includes a web server, SSH server, and other basic services. It's an excellent choice if you're unsure about your server's purpose. On the other hand, the minimal installation provides only the bare necessities, leaving more control in your hands for custom configuration.

Choosing the Right Edition for You

For a new server, the standard installation is recommended. It offers a balanced setup, providing essential services without overwhelming you with too many choices.

the server room setup guide is shown in this diagram, with instructions for how to use it
the server room setup guide is shown in this diagram, with instructions for how to use it
Debian Fundamentals 🚀 Der Linux-Admin Lernpfad für Einsteiger & zukünftige Sysadmins
Debian Fundamentals 🚀 Der Linux-Admin Lernpfad für Einsteiger & zukünftige Sysadmins
Debian 10 "buster" server installation in VirtualBox - PragmaticLinux
Debian 10 "buster" server installation in VirtualBox - PragmaticLinux

If you're an experienced administrator looking to build a custom environment, the minimal installation might be more suitable. It allows you to install only the software you need, improving security by minimizing the server's attack surface.

Debian versus Other Linux Distributions

Debian is known for its robustness, stability, and adherence to free software principles. It's a fantastic choice for servers due to its mature ecosystem, comprehensive software repository, and high standards for package quality.

AD

While other Linux distributions like Ubuntu offer user-friendly experiences and faster release cycles, Debian's commitment to stability, security, and thorough testing makes it an ideal choice for servers.

How to Install and Configure Multihomed ISC DHCP Server on Debian Linux
How to Install and Configure Multihomed ISC DHCP Server on Debian Linux
How to Set Up a Postfix Mail Server on Debian
How to Set Up a Postfix Mail Server on Debian
How to Install a DHCP Server in Ubuntu and Debian
How to Install a DHCP Server in Ubuntu and Debian
The Perfect Server - Debian Squeeze (Debian 6.0) [ISPConfig 2] - Page 2 - Page 2
The Perfect Server - Debian Squeeze (Debian 6.0) [ISPConfig 2] - Page 2 - Page 2
How to Install Debian 9 Linux Install Tutorial | (Linux Beginners Guide)
How to Install Debian 9 Linux Install Tutorial | (Linux Beginners Guide)
Easy Debian install
Easy Debian install

Downloading and Creating the Debian Installation Media

Visit the Debian Downloads page to download the latest stable release of Debian. You'll need an ISO file, either DVD or Netinstall, depending on your chosen installation method.

To create a bootable USB drive, you can use tools like Balena Etcher (https://www.balena.io/etcher/). Download the tool, select the downloaded ISO file, and choose your USB drive as the target. Once complete, safely remove the USB drive and proceed to the next section.

AD

Using DDR (Debian Disk Utilities) for Automatic Partitioning

DDR is a user-friendly tool for partitioning and preparing your drive for the Debian installation. It's available as a standalone ISO or can be added to your Debian installation media.

Home Server Starter Guide: 25 Things You Can Self-Host on Old Hardware
Home Server Starter Guide: 25 Things You Can Self-Host on Old Hardware
Home Server Self-Hosting List: 25 Things to Run on Old Hardware
Home Server Self-Hosting List: 25 Things to Run on Old Hardware
i3wm Debian
i3wm Debian
the diagram shows how to build a data storage server at home and where it is located
the diagram shows how to build a data storage server at home and where it is located
How to Run Debian Linux in a VM on Windows Server
How to Run Debian Linux in a VM on Windows Server
a penguin sitting in front of a computer screen with the text, updated upgrades on ubuntu and debian
a penguin sitting in front of a computer screen with the text, updated upgrades on ubuntu and debian
a flat screen tv sitting on top of a white table next to a lamp and chair
a flat screen tv sitting on top of a white table next to a lamp and chair
Hosting A Minecraft Server On Debian: The Ultimate Guide
Hosting A Minecraft Server On Debian: The Ultimate Guide
12 Reasons Why You Should Choose Debian Linux
12 Reasons Why You Should Choose Debian Linux
Aesthetic Discord Server Template Ideas Free Copy Paste
Aesthetic Discord Server Template Ideas Free Copy Paste
Debian vs. Ubuntu: How to pick the right Linux for your workflow
Debian vs. Ubuntu: How to pick the right Linux for your workflow

DDR provides a graphical interface for creating partitions, allowing you to easily adjust settings like partition sizes, file systems, and mount points. It simplifies the partitioning process, making it a convenient choice for both beginners and experienced users.

Manually Partitioning with fdisk

For manual control over your partition scheme, you can use `fdisk`. It's a command-line tool that offers fine-grained control over disk partitioning.

AD

To access `fdisk`, boot from your Debian installation media, select the "Expert" or "Go/Advanced options" menu, and choose the "console" option. Once in the console mode, you can proceed to partition your drive using `fdisk`. Keep in mind that manually partitioning requires a good understanding of file systems and partition types.

Installing Debian Server

With your partitioning complete, proceed with the Debian installation. If you've used DDR, select the "Install" option in the menu. If you've manually partitioned, choose the "Guided - use entire disk and set up LVM" or "Manual" option, depending on your preference.

The installer will lead you through the following steps:

  1. Detect keyboard layout: Choose your keyboard layout to ensure accurate input during the installation process.
  2. Detect hardware: The installer will scan your system to detect hardware components and set up the necessary drivers.
  3. Configure the network: Set up your network connection, including the hostname, domain name, and network mirrors (if necessary).
  4. Choose a mirror: Select a Debian mirror to download packages from. Choosing a nearby mirror can improve download speeds.
  5. Participate in popularity-contest: Participating in the popularity-contest helps Debian developers better understand user needs and preferences. You can choose to participate or opt out.
  6. Configure locale: Set the default locale (language and regional settings) for your server.
  7. Configure the_clock: Set the time zone and configure the clock based on your geographical location.
  8. Set up users and groups: Create a root password and add regular users to your system.
  9. Package selection: Choose the software packages to install. For a standard installation, accept the default selection.
  10. Configure the network - configure incrementing interface names: If you've chosen the Netinstall ISO, you'll be prompted to configure your network incrementing interface names. Accept the default to keep the numbering consistent across reboots.
  11. Configure the network - configure static IP address: Set a static IP address, netmask, and gateway for your server, or choose to use DHCP.
  12. Configure GRUB bootloader: Set the default boot options and configure the GRUB bootloader for your system.
  13. Create an initial RAM disk: An initial RAM disk (initrd) is required for systems with a kernel lacking built-in support for necessary devices. For most setups, you can accept the default choice.
  14. Write changes to disk: After reviewing your settings, confirm to write changes to the disk and finalize the installation.

Post-Installation Configuration

Once the installation is complete, you'll be prompted to reboot your system. After rebooting, log in as the user you created during the installation process. Your server is now ready for further configuration and software setup.

To update your package list and upgrade installed packages, run the following commands:

sudo apt update
sudo apt upgrade

Hardening Your Debian Server

Securing your Debian server is essential to protect it from unauthorized access and potential threats. Enable a firewall, change default SSH port, limit SSH access, and keep your software up-to-date to ensure the best security.

Regularly monitor and review the logs, and keep an eye on system performance to quickly identify and address any potential issues. You may also consider installing a intrusion detection system (IDS) to enhance your server's security.

Now that your Debian server is set up and secured, you're ready to install and configure the services and applications you need. From web servers to databases, multimedia codecs, or development tools, Debian's vast software repository has you covered. Happy administrating!

AD