How To Setup A Linux Server

How To Setup A Linux Server

Reading time1 min
#Linux#Servers#Tech#LinuxServerSetup#Minimalism#SysAdmin

Mastering Minimalism: Setting Up a Linux Server with Only Essential Packages

Forget bloated installations. Discover why stripping down to essentials is your smartest move for security and efficiency when setting up a Linux server.


In today’s rapidly evolving IT landscape, a lean Linux server isn’t just a preference — it’s a necessity. From reducing attack surfaces to boosting performance and simplifying maintenance, minimalism in server setup offers tangible benefits that scale from personal projects to enterprise-grade infrastructure. This post walks you through setting up a Linux server with only the essential packages, ensuring your system stays light, secure, and efficient.

Why Minimalism Matters in Linux Server Setup

Most default Linux distributions come loaded with software packages out of the box. While this might be convenient for desktop users, servers thrive on minimalism. Every unnecessary package:

  • Increases security risks by enlarging the attack surface.
  • Consumes system resources, impacting performance.
  • Adds maintenance overhead, complicating updates and troubleshooting.

By starting with a bare minimum, you take control of exactly what runs on your server — aligning with best practices for sustainable infrastructure.


Step 1: Choose the Right Distribution and Installation Type

Not all Linux distributions are created equal for minimalism. Some popular minimal-friendly distros include:

  • Debian Netinst — A minimal network install that lets you pick exactly what you want.
  • Ubuntu Server (Minimal installation option) — Streamlined installer without GUI or extra applications.
  • CentOS Stream Minimal or AlmaLinux Minimal — Enterprise-quality base systems without bloat.
  • Arch Linux — For advanced users who want control from day one.

For this tutorial, we’ll use Debian Netinst as it provides an easy balance of stability and minimalism.

Example: Download the Debian “netinst” ISO from debian.org. At installation time, uncheck all predefined software collections except for “standard system utilities.”


Step 2: Basic Installation—Install Only What You Need

During installation:

  1. When prompted about software collections (desktop environment, web server, print server), deselect all except:

    • Standard system utilities (This brings just the essential tooling).
  2. Finish installing and reboot into your new minimal setup.

At this point, your system has only core command-line utilities without any GUI or additional services running.


Step 3: Update the System

After logging in to your fresh minimal install via SSH or directly:

sudo apt update && sudo apt upgrade -y

Keeping only essential packages updated ensures stability without unnecessary package bulk.


Step 4: Install Only Essential Packages

Depending on your server’s role, add only what’s truly needed. Here are common essentials regardless of purpose:

  • SSH server (if not installed):

    sudo apt install --no-install-recommends openssh-server
    

    The --no-install-recommends flag avoids pulling in extra dependencies you don’t need.

  • Firewall:

    sudo apt install ufw
    sudo ufw allow ssh
    sudo ufw enable
    
  • Tools like curl, vim or nano for basic manipulation:

    sudo apt install curl vim
    

Note: Always avoid metapackages that drag in many dependencies unless absolutely needed.


Step 5: Disable Unnecessary Services

Check running services:

sudo systemctl list-unit-files --state=enabled

Identify and disable anything that does not fit your target use case:

sudo systemctl disable bluetooth.service avahi-daemon.service cups.service

These services might come enabled by default but often aren’t needed on servers focused on headless operation.


Step 6: Monitor Disk Usage and Remove Orphans

Keep an eye on installed packages size using:

dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n

For cleaning orphaned dependencies:

sudo apt autoremove --purge

This helps ensure your installation remains slim over time as package needs evolve.


Optional: Building Server Roles from Scratch

If you want, say, a web server, don’t install full “LAMP” stacks blindly. Instead install components individually:

sudo apt install apache2 --no-install-recommends
sudo apt install mysql-server --no-install-recommends   # If DB needed
sudo apt install php libapache2-mod-php --no-install-recommends # For PHP support only if needed

Then configure each manually according to your requirements rather than relying on default configurations that might include surplus modules.


Summary Checklist for Minimal Linux Server Setup

StepAction
Choose distroDebian Netinst / Ubuntu Minimal / Arch
Unselect default bloatExclude desktop environments & extras
Update systemapt update && apt upgrade
Install essentials onlySSH, firewall (openssh-server, ufw)
Remove/disable unused srvcsSystemctl disable unnecessary daemons
Regular cleanupsapt autoremove --purge

Final Thoughts

Mastering minimalism when setting up a Linux server is about choosing discipline over convenience — it pays dividends in security and smooth operation. Start minimal; add only when necessary; audit frequently. Whether you're spinning up a personal project or maintaining dozens of servers at scale, this approach keeps infrastructure manageable and resilient.

Minimal yet mighty — that should be your mantra when crafting Linux servers!


Have questions? Comments? Drop them below! And if you found this guide helpful, share it with fellow sysadmins aiming to optimize their toolkits.