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.
Important Notes
Please note these important points before setup
Root Access Required
Root access or sudo privileges are required for all configuration steps
Internet Connection Required
Active internet connection is needed for package updates and downloads
Create Backup
Create backups of your critical data before making any important changes
Time Required
Total time: approximately 30-45 minutes depending on system performance
Security Aspects
Consider all security aspects during server configuration
Document Changes
Document all changes made for future reference
Setup Steps
Generate UTF-8 locale
locale-gen C.UTF-8Update system locale
update-locale LANG=C.utf8 LC_ALL=C.utf8A restart may be required to fully apply the changes
Set timezone to Europe/Berlin
timedatectl set-timezone Europe/BerlinUse timedatectl list-timezones to see all available options
Update, upgrade and cleanup system
apt update && apt upgrade -y && apt autoremove -y && apt autoclean -yMore information can be found in the Debian Wiki on APT configuration
Edit cloud-init configuration (if present)
Set new hostname
sudo hostnamectl set-hostname server.chad.luRestart system for full application
rebootClear default MOTD file
sudo truncate -s 0 /etc/motdInstall hardware information tool
apt install inxi -yDisplay complete hardware information
inxi -FazDisplay CPU information
lscpuDisplay memory information
free -hDisplay disk information
df -hDisplay system version information
lsb_release -aDisplay kernel information
uname -aCheck systemd status
systemctl statusCheck available updates
apt list --upgradableAdditional 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.