How to install and configure Debian 12

Configurare noua (How To)

Situatie

Solutie

Before starting, make sure you have:

  • A computer or virtual machine

  • Stable internet connection (optional but recommended)

  • A USB stick (at least 4 GB) or DVD

  • Debian 12 ISO file (choose the appropriate architecture, e.g., amd64 for most systems)

  • A tool to write the ISO to USB/DVD:

    • Rufus (Windows)

    • balenaEtcher (Linux/macOS/Windows)

    • dd command (Linux/macOS)

Step 1: Create a Bootable Debian 12 USB/DVD

A. On Windows (Using Rufus)

  1. Download and open Rufus

  2. Insert your USB drive

  3. Under “Device”, select the USB

  4. Under “Boot selection”, click SELECT and choose the Debian ISO

  5. Leave other options at default (MBR/GPT based on your BIOS/UEFI)

  6. Click START.

B. On Linux/macOS (Using Terminal)

bash
sudo dd if=debian-12.x.x-amd64.iso of=/dev/sdX bs=4M status=progress && sync

Replace /dev/sdX with your actual USB device (not a partition like /dev/sdX1).

Step 2: Boot from the Installation Media

  1. Reboot the computer

  2. Enter BIOS/UEFI settings (usually F2, F10, DEL, or ESC)

  3. Change boot order to prioritize USB/DVD

  4. Save and exit. The Debian installer should start

Step 3: Install Debian 12

Choose Graphical install or Install (text-based).

A. Language, Location, and Keyboard

  • Select your language

  • Choose your location

  • Configure the keyboard layout.

B. Network Configuration

  • Set up via DHCP (auto) or enter IP manually (for static IP)

  • Choose hostname (e.g., debian-server) and domain name (optional)

C. User Setup

  • Set root password (or leave blank to disable root login)

  • Create a user account (your normal user)

  • Choose a secure password.

D. Partitioning

Choose one:

  1. Guided – use entire disk (for beginners):

    • Choose with or without LVM and encryption

    • Debian will auto-partition into root, swap, and home (optional)

  2. Manual (for advanced users):

    • Create partitions:

      • / (root): at least 10–20 GB

      • /home: rest of the space

      • swap: ~2 GB (or use a swap file later)

      • /boot: optional, ~512 MB

      • EFI System Partition if using UEFI

E. Package Manager Configuration

  • Choose a mirror country and a nearby Debian archive mirror

  • If behind proxy, enter proxy info

  • Opt-in to popularity-contest (optional).

F. Software Selection

Choose:

  • Standard system utilities

  • SSH server (for remote access)

  • Graphical desktop environment (GNOME, KDE, XFCE, etc.)

Use Space to select/deselect.

G. Install GRUB Bootloader

  • Install to the primary drive (/dev/sda or equivalent).

  • If dual-booting, ensure the bootloader doesn’t overwrite another OS’s boot entry.

Installation Complete

  • Remove installation media when prompted.

  • Reboot the system.

Step 4: Post-Installation Configuration

A. Log In

Use the user account you created.

Step 5: First-Time Setup

A. Update the System

bash
sudo apt update
sudo apt upgrade -y

B. Enable sudo (if not already set)

If you didn’t enable the root account and your user isn’t in the sudo group:

bash
su -
usermod -aG sudo yourusername

Log out and back in for changes to take effect.

Step 6: Desktop Environment Setup (Optional)

If you didn’t install a DE, you can add one now:

bash
# GNOME
sudo apt install gnome-core gdm3
# KDE
sudo apt install kde-plasma-desktop

# XFCE
sudo apt install xfce4 lightdm

# LXQt
sudo apt install lxqt sddm

Enable display manager if needed:

bash
sudo systemctl enable gdm3 # or lightdm/sddm
sudo systemctl start gdm3

Step 7: Security Configuration

A. Enable UFW (Uncomplicated Firewall)

bash
sudo apt install ufw
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh

B. Fail2Ban (SSH brute force protection)

bash
sudo apt install fail2ban
sudo systemctl enable fail2ban

Step 8: Install Useful Tools

bash
sudo apt install curl wget git htop neofetch unzip

Optional GUI tools:

bash
sudo apt install synaptic gparted gdebi

Step 9: Configure Network (Static IP, if needed)

Edit network interface:

bash
sudo nano /etc/network/interfaces

Example for static IP:

bash
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

Restart network:

bash
sudo systemctl restart networking

Step 10: Optional – Set Up SSH Access

bash
sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh

To access:

bash
ssh username@your-ip-address

Tip solutie

Permanent

Voteaza

(8 din 13 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?