{"id":406,"date":"2026-07-19T16:00:50","date_gmt":"2026-07-19T16:00:50","guid":{"rendered":"https:\/\/networkyy.com\/how-to-set-up-linux-server-from-scratch\/"},"modified":"2026-08-26T08:20:00","modified_gmt":"2026-08-26T08:20:00","slug":"how-to-set-up-linux-server-from-scratch","status":"publish","type":"post","link":"https:\/\/networkyy.com\/fr\/how-to-set-up-linux-server-from-scratch\/","title":{"rendered":"How to Set Up a Linux Server from Scratch"},"content":{"rendered":"<figure><img decoding=\"async\" src=\"https:\/\/images.pexels.com\/photos\/2881232\/pexels-photo-2881232.jpeg?auto=compress&#038;cs=tinysrgb&#038;dpr=2&#038;h=650&#038;w=940\" alt=\"How to Set Up a Linux Server from Scratch\" style=\"width:100%;height:auto;border-radius:8px;margin-bottom:24px;\" \/><figcaption>Photo by Brett Sayles on Pexels<\/figcaption><\/figure>\n<h1>How to Set Up a Linux Server from Scratch<\/h1>\n<p>Setting up a Linux server from scratch might seem daunting, but with the right guidance, anyone can master this essential IT skill. Whether you&#8217;re deploying a web server, database server, or development environment, understanding the fundamentals of Linux server setup will empower you to build robust, secure infrastructure. This comprehensive guide walks you through every step of the process, from choosing your distribution to securing your server.<\/p>\n<h2>Table of Contents<\/h2>\n<ul>\n<li><a href=\"#choosing-distribution\">Choosing the Right Linux Distribution<\/a><\/li>\n<li><a href=\"#installation\">Installing Your Linux Server<\/a><\/li>\n<li><a href=\"#initial-configuration\">Initial Server Configuration<\/a><\/li>\n<li><a href=\"#user-management\">Setting Up User Accounts and Permissions<\/a><\/li>\n<li><a href=\"#network-configuration\">Network Configuration<\/a><\/li>\n<li><a href=\"#security-hardening\">Security Hardening Essentials<\/a><\/li>\n<li><a href=\"#firewall-setup\">Configuring the Firewall<\/a><\/li>\n<li><a href=\"#updates-maintenance\">Updates and Maintenance<\/a><\/li>\n<li><a href=\"#monitoring\">Basic Monitoring Setup<\/a><\/li>\n<\/ul>\n<h2 id=\"choosing-distribution\">Choosing the Right Linux Distribution<\/h2>\n<p>The first step to set up a Linux server is selecting the appropriate distribution. For server environments, stability and long-term support trump cutting-edge features. Ubuntu Server LTS (Long Term Support) and CentOS\/Rocky Linux are popular choices for beginners due to their extensive documentation and community support.<\/p>\n<p>Ubuntu Server offers five years of security updates and patches, making it ideal for production environments. Rocky Linux, the successor to CentOS, provides enterprise-grade stability. For learning purposes, platforms like <a href=\"https:\/\/datacamp.pxf.io\/YR9dQK\" target=\"_blank\" rel=\"nofollow sponsored noopener\">DataCamp<\/a> offer excellent courses on Linux fundamentals that can help you understand the differences between distributions.<\/p>\n<h3>Distribution Considerations<\/h3>\n<ul>\n<li><strong>Ubuntu Server:<\/strong> Beginner-friendly, extensive package repository, strong community<\/li>\n<li><strong>Rocky Linux:<\/strong> Enterprise stability, RHEL compatibility, ideal for corporate environments<\/li>\n<li><strong>Debian:<\/strong> Rock-solid stability, minimal resource usage, perfect for experienced administrators<\/li>\n<\/ul>\n<h2 id=\"installation\">Installing Your Linux Server<\/h2>\n<p>Once you&#8217;ve chosen your distribution, you&#8217;ll need hardware or a virtual private server (VPS). Cloud providers like <a href=\"https:\/\/kamatera.sjv.io\/engON1\" target=\"_blank\" rel=\"nofollow sponsored noopener\">Kamatera<\/a> offer flexible VPS solutions perfect for deploying Linux servers with customizable resources.<\/p>\n<h3>Installation Steps<\/h3>\n<p>Download the ISO image from your chosen distribution&#8217;s official website. Create a bootable USB drive using tools like Rufus (Windows) or dd command (Linux). Boot from the installation media and follow these general steps:<\/p>\n<ol>\n<li>Select your language and keyboard layout<\/li>\n<li>Configure network settings (can be done post-installation)<\/li>\n<li>Partition your disk (recommended: separate partitions for \/, \/home, and \/var)<\/li>\n<li>Set up your root password and create an administrative user<\/li>\n<li>Select minimal installation for servers to reduce attack surface<\/li>\n<li>Complete the installation and reboot<\/li>\n<\/ol>\n<h2 id=\"initial-configuration\">Initial Server Configuration<\/h2>\n<p>After installation, log in and perform these critical first steps:<\/p>\n<h3>Update System Packages<\/h3>\n<p>Always start with a fully updated system:<\/p>\n<pre><code># For Ubuntu\/Debian\nsudo apt update && sudo apt upgrade -y\n\n# For Rocky Linux\/CentOS\nsudo dnf update -y<\/code><\/pre>\n<h3>Set the Hostname<\/h3>\n<p>Configure a meaningful hostname for your server:<\/p>\n<pre><code>sudo hostnamectl set-hostname your-server-name<\/code><\/pre>\n<h3>Configure Timezone<\/h3>\n<p>Set the correct timezone for accurate logging:<\/p>\n<pre><code>sudo timedatectl set-timezone America\/New_York\n# List available timezones with: timedatectl list-timezones<\/code><\/pre>\n<h2 id=\"user-management\">Setting Up User Accounts and Permissions<\/h2>\n<p>Never use the root account for daily operations. Create a sudo-enabled user account:<\/p>\n<pre><code># Create new user\nsudo adduser username\n\n# Add user to sudo group (Ubuntu)\nsudo usermod -aG sudo username\n\n# Add user to wheel group (Rocky Linux)\nsudo usermod -aG wheel username<\/code><\/pre>\n<h3>SSH Key Authentication<\/h3>\n<p>Implement SSH key-based authentication for enhanced security:<\/p>\n<pre><code># On your local machine, generate SSH key pair\nssh-keygen -t ed25519 -C \"your_email@example.com\"\n\n# Copy public key to server\nssh-copy-id username@server_ip<\/code><\/pre>\n<h2 id=\"network-configuration\">Network Configuration<\/h2>\n<p>Modern Linux distributions use different network management tools. Ubuntu uses Netplan, while Rocky Linux uses NetworkManager.<\/p>\n<h3>Ubuntu Netplan Configuration<\/h3>\n<p>Edit the Netplan configuration file at <code>\/etc\/netplan\/00-installer-config.yaml<\/code>:<\/p>\n<pre><code>network:\n  version: 2\n  ethernets:\n    eth0:\n      dhcp4: no\n      addresses: [192.168.1.100\/24]\n      gateway4: 192.168.1.1\n      nameservers:\n        addresses: [8.8.8.8, 8.8.4.4]<\/code><\/pre>\n<p>Apply the configuration with:<\/p>\n<pre><code>sudo netplan apply<\/code><\/pre>\n<h2 id=\"security-hardening\">Security Hardening Essentials<\/h2>\n<p>Security should be your top priority when you set up a Linux server. Implement these hardening measures immediately:<\/p>\n<h3>Disable Root SSH Login<\/h3>\n<p>Edit <code>\/etc\/ssh\/sshd_config<\/code>:<\/p>\n<pre><code>PermitRootLogin no\nPasswordAuthentication no\nPubkeyAuthentication yes<\/code><\/pre>\n<p>Restart SSH service:<\/p>\n<pre><code>sudo systemctl restart sshd<\/code><\/pre>\n<h3>Install Fail2Ban<\/h3>\n<p>Protect against brute-force attacks:<\/p>\n<pre><code>sudo apt install fail2ban -y  # Ubuntu\nsudo dnf install fail2ban -y  # Rocky Linux\n\nsudo systemctl enable fail2ban\nsudo systemctl start fail2ban<\/code><\/pre>\n<h2 id=\"firewall-setup\">Configuring the Firewall<\/h2>\n<p>Ubuntu uses UFW (Uncomplicated Firewall), while Rocky Linux uses firewalld.<\/p>\n<h3>UFW Configuration (Ubuntu)<\/h3>\n<pre><code>sudo ufw default deny incoming\nsudo ufw default allow outgoing\nsudo ufw allow ssh\nsudo ufw allow 80\/tcp\nsudo ufw allow 443\/tcp\nsudo ufw enable<\/code><\/pre>\n<h3>Firewalld Configuration (Rocky Linux)<\/h3>\n<pre><code>sudo systemctl start firewalld\nsudo systemctl enable firewalld\nsudo firewall-cmd --permanent --add-service=ssh\nsudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --permanent --add-service=https\nsudo firewall-cmd --reload<\/code><\/pre>\n<h2 id=\"updates-maintenance\">Updates and Maintenance<\/h2>\n<p>Configure automatic security updates to keep your server protected:<\/p>\n<h3>Ubuntu Unattended Upgrades<\/h3>\n<pre><code>sudo apt install unattended-upgrades -y\nsudo dpkg-reconfigure --priority=low unattended-upgrades<\/code><\/pre>\n<h3>Rocky Linux Automatic Updates<\/h3>\n<pre><code>sudo dnf install dnf-automatic -y\nsudo systemctl enable --now dnf-automatic.timer<\/code><\/pre>\n<h2 id=\"monitoring\">Basic Monitoring Setup<\/h2>\n<p>Implement basic monitoring to track server health:<\/p>\n<h3>Install Essential Monitoring Tools<\/h3>\n<pre><code>sudo apt install htop iotop nethogs -y  # Ubuntu\nsudo dnf install htop iotop nethogs -y  # Rocky Linux<\/code><\/pre>\n<h3>Check System Resources<\/h3>\n<p>Monitor your server regularly with these commands:<\/p>\n<pre><code># CPU and memory usage\nhtop\n\n# Disk usage\ndf -h\n\n# Check running services\nsudo systemctl list-units --type=service --state=running\n\n# View recent logs\nsudo journalctl -xe<\/code><\/pre>\n<h2>Conclusion<\/h2>\n<p>Setting up a Linux server from scratch requires careful attention to detail, but following these steps ensures you build a secure, efficient foundation. Remember that server administration is an ongoing process\u2014regular updates, monitoring, and security audits are essential for maintaining a healthy server environment.<\/p>\n<p>Start with these fundamentals, and as you gain confidence, explore advanced topics like containerization, load balancing, and automated deployment pipelines. The skills you develop managing Linux servers will serve you throughout your IT career, whether you&#8217;re administering enterprise infrastructure or deploying personal projects.<\/p>\n<div style=\"background:#1a1a2e;color:#fff;padding:24px;border-radius:10px;margin-top:32px;border-left:4px solid #00ff88;\">\n<h3 style=\"color:#00ff88;margin-top:0;\">Follow Networkyy<\/h3>\n<p>Join 125,000+ IT professionals:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.instagram.com\/networkyy\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Instagram @networkyy<\/a><\/li>\n<li><a href=\"https:\/\/www.facebook.com\/ITnetworkyy\/\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Facebook Networkyy<\/a><\/li>\n<li><a href=\"https:\/\/www.threads.com\/@networkyy\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Threads @networkyy<\/a><\/li>\n<li><a href=\"https:\/\/medium.com\/@mattouchi6\" target=\"_blank\" style=\"color:#00ff88;\" rel=\"noopener\">Medium<\/a><\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Learn how to set up a Linux server from scratch with this comprehensive guide. Step-by-step instructions for installation, configuration, and security.<\/p>","protected":false},"author":2,"featured_media":405,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":"","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_focuskw":"","rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":""},"categories":[9],"tags":[],"class_list":["post-406","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-sysadmin"],"contentshake_article_id":"","brizy_media":[],"_links":{"self":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/comments?post=406"}],"version-history":[{"count":1,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":613,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/posts\/406\/revisions\/613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/media\/405"}],"wp:attachment":[{"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/media?parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/categories?post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/networkyy.com\/fr\/wp-json\/wp\/v2\/tags?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}