Skip to content

Debian 12 - Initial Server Setup

A comprehensive step-by-step guide for the initial setup of a fresh Debian 12 server with the most important configuration steps.

Debian 12Server SetupLinuxSystem Administration

Setup Steps

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

Set timezone to Europe/Berlin

timedatectl set-timezone Europe/Berlin

Use timedatectl list-timezones to see all available options

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

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

Clear default MOTD file

sudo truncate -s 0 /etc/motd

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

Display system version information

lsb_release -a

Display kernel information

uname -a

Check systemd status

systemctl status

Check available updates

apt list --upgradable

Additional Tips

Useful commands and tips for better management

Setup Complete!

Your Debian 12 server is now basically configured and ready to use. Don't forget to make further security-relevant configurations according to your requirements.