Aller au contenu

Debian 12 - Configuration Initiale du Serveur

Un guide complet étape par étape pour la configuration initiale d'un serveur Debian 12 fraîchement installé avec les étapes de configuration les plus importantes.

Debian 12Server SetupLinuxSystem Administration

Étapes d'Installation

1

Configure Language and Locale

Configuration of system language and locale settings for correct character display.

Generate UTF-8 locale

locale-gen C.UTF-8

Update system locale

update-locale LANG=C.utf8 LC_ALL=C.utf8

A restart may be required to fully apply the changes

2

Set Timezone

Setting the correct timezone for accurate time and date information.

Set timezone to Europe/Berlin

timedatectl set-timezone Europe/Berlin

Use timedatectl list-timezones to see all available options

3

Update Package Sources

Updating APT package sources and the system to the latest state.

Update, upgrade and cleanup system

apt update && apt upgrade -y && apt autoremove -y && apt autoclean -y

More information can be found in the Debian Wiki on APT configuration

4

Configure Hostname

Setting a unique hostname for server identification in the network.

Edit cloud-init configuration (if present)

cloud.cfg
1
2
# This will cause the set+update hostname module to not operate (if true)preserve_hostname: true

Set new hostname

sudo hostnamectl set-hostname server.chad.lu

Restart system for full application

reboot
5

Clean MOTD

Removing the default welcome message for clean login.

Clear default MOTD file

sudo truncate -s 0 /etc/motd
6

Show Hardware Information

Checking and displaying available hardware resources of the server.

Install hardware information tool

apt install inxi -y

Display complete hardware information

inxi -Faz

Display CPU information

lscpu

Display memory information

free -h

Display disk information

df -h
7

System Verification

Final verification of all configurations and system status.

Display system version information

lsb_release -a

Display kernel information

uname -a

Check systemd status

systemctl status

Check available updates

apt list --upgradable

Conseils Supplémentaires

Commandes et conseils utiles pour une meilleure gestion

Security Measures

Install UFW firewall

apt install ufw -y

Enable firewall

ufw enable

Install Fail2Ban for enhanced security

apt install fail2ban -y

Essential Tools

Install important system tools

apt install sudo curl wget git nano htop tree -y

Install build tools for compilation

apt install build-essential -y

Automatic Updates

Install automatic updates

apt install unattended-upgrades -y

Configure automatic updates

dpkg-reconfigure unattended-upgrades