Menu

Ubuntu Server 24.04

📅28 January, 2025, 13 minutes
» Ubuntu

Ubuntu Server 24.04: Installation, Configuration, and Use Cases

Introduction

Ubuntu Server, a widely-used Linux distribution developed by Canonical, has become a cornerstone for deploying servers across various use cases. With the release of Ubuntu Server 24.04, the Long-Term Support (LTS) version offers a stable, secure, and versatile platform for professionals. This guide provides an extensive overview of Ubuntu Server 24.04, detailing its installation, configuration, features, and use cases in a professional yet easy-to-follow manner.


1. Why Choose Ubuntu Server 24.04?

1.1 Key Features

  • Long-Term Support (LTS): Supported for five years, ensuring stability and security.
  • Minimal Footprint: Optimized for server environments with minimal resource usage.
  • Advanced Security: Features like AppArmor, SELinux compatibility, and automated updates.
  • Cloud-Ready: Integrated support for OpenStack, Kubernetes, and other cloud platforms.
  • Broad Hardware Support: Runs on x86, ARM, and even Raspberry Pi.

1.2 Ideal Use Cases

  • Web hosting (e.g., LAMP/LEMP stacks).
  • File servers, email servers, and database servers.
  • Cloud infrastructure.
  • IoT and edge computing.
  • Development and testing environments.

2. Preparing for Installation

2.1 System Requirements

  • Minimal Requirements:

    • 1 GHz processor.
    • 512 MB RAM.
    • 2.5 GB disk space.
  • Recommended Requirements:

    • 2 GHz dual-core processor.
    • 2 GB RAM or higher.
    • 20 GB disk space or more.

2.2 Downloading Ubuntu Server 24.04

  1. Visit the official Ubuntu downloads page.
  2. Select "Ubuntu Server 24.04 LTS."
  3. Download the ISO file or a pre-built image for your specific hardware (e.g., Raspberry Pi).

2.3 Creating Bootable Media

  • Use tools like:
    • Rufus (Windows).
    • Etcher (Linux/Mac).

2.4 Configuring BIOS/UEFI

  1. Enter BIOS/UEFI by pressing a designated key during boot (e.g., F2, F12, DEL, or ESC).
  2. Set the boot order to prioritize your USB or CD/DVD drive.
  3. Save changes and reboot.

3. Installing Ubuntu Server 24.04

3.1 Installation Steps

  1. Boot from the USB or CD/DVD drive.
  2. Select "Install Ubuntu Server."
  3. Choose your preferred language and keyboard layout.
  4. Configure network settings:
    • DHCP (default) or manual static IP.
    • Set hostname.
  5. Partition the disk:
    • Use guided options (e.g., "Use entire disk") or manual partitioning.
    • Recommended partitions:
      • / (root): 20 GB or more.
      • swap: Equal to or twice the RAM size.
      • /home: Separate partition for user data.
  6. Select additional packages (e.g., OpenSSH Server for remote management).
  7. Set up a user account and password.
  8. Complete the installation and reboot.

3.2 Post-Installation Updates

  1. Update the package lists:
    sudo apt update
    
  2. Upgrade installed packages:
    sudo apt upgrade -y
    

4. Initial Configuration

4.1 Setting Up Networking

  • Static IP Configuration: Edit /etc/netplan/01-netcfg.yaml:
    network:
      version: 2
      ethernets:
        enp0s3:
          addresses:
            - 192.168.1.100/24
          gateway4: 192.168.1.1
          nameservers:
            addresses:
              - 8.8.8.8
              - 8.8.4.4
    
    Apply changes:
    sudo netplan apply
    

4.2 Enabling SSH Access

  1. Install OpenSSH Server (if not installed during setup):
    sudo apt install openssh-server
    
  2. Verify SSH service:
    sudo systemctl status ssh
    
  3. Allow SSH through the firewall:
    sudo ufw allow ssh
    

4.3 Setting Up a Firewall

  1. Enable UFW (Uncomplicated Firewall):
    sudo ufw enable
    
  2. Allow essential services:
    sudo ufw allow http
    sudo ufw allow https
    sudo ufw allow 22
    
  3. Check firewall status:
    sudo ufw status
    

5. Installing and Configuring Essential Server Software

5.1 LAMP Stack (Linux, Apache, MySQL, PHP)

  1. Install Apache:
    sudo apt install apache2
    
  2. Install MySQL:
    sudo apt install mysql-server
    sudo mysql_secure_installation
    
  3. Install PHP:
    sudo apt install php libapache2-mod-php php-mysql
    
  4. Verify by creating a PHP file in /var/www/html:
    echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
    

5.2 Secure FTP Server

  1. Install vsftpd:
    sudo apt install vsftpd
    
  2. Configure /etc/vsftpd.conf:
    write_enable=YES
    local_umask=022
    
  3. Restart the service:
    sudo systemctl restart vsftpd
    

5.3 Docker

  1. Install Docker:
    sudo apt install docker.io
    
  2. Add your user to the Docker group:
    sudo usermod -aG docker $USER
    

5.4 Kubernetes (Optional)

  1. Install microk8s:
    sudo snap install microk8s --classic
    
  2. Add user permissions:
    sudo usermod -aG microk8s $USER
    

6. Advanced Server Management

6.1 Monitoring Tools

  • htop: Real-time process monitoring.
    sudo apt install htop
    
  • Netdata: Web-based server monitoring.
    sudo bash <(curl -Ss https://my-netdata.io/kickstart.sh)
    

6.2 Backups

  • Use rsync for local and remote backups:
    rsync -avz /source /destination
    
  • Install Timeshift for desktop-like backups:
    sudo apt install timeshift
    

6.3 Automation with Ansible

  1. Install Ansible:
    sudo apt install ansible
    
  2. Write a playbook for automating configurations:
    - hosts: servers
      tasks:
        - name: Update and upgrade apt packages
          apt:
            update_cache: yes
            upgrade: dist
    

7. Security Best Practices

7.1 User and Access Management

  • Disable root login via SSH:

    sudo nano /etc/ssh/sshd_config
    

    Set PermitRootLogin no.

  • Add a new user:

    sudo adduser newuser
    sudo usermod -aG sudo newuser
    

7.2 Fail2Ban

  1. Install Fail2Ban:
    sudo apt install fail2ban
    
  2. Configure jail settings in /etc/fail2ban/jail.local.

7.3 Regular Updates

  • Automate updates:
    sudo apt install unattended-upgrades
    

8. Use Cases of Ubuntu Server 24.04

8.1 Web Hosting

  • Run websites using Apache, Nginx, or Node.js.

8.2 Database Servers

  • Deploy MySQL, PostgreSQL, or MongoDB.

8.3 Cloud Environments

  • Integrate with OpenStack or Kubernetes for cloud infrastructure.

8.4 IoT and Edge Computing

  • Use Ubuntu Core for secure, lightweight IoT devices.

9. Conclusion

Ubuntu Server 24.04 offers a robust, secure, and versatile platform for a wide array of server applications. With its ease of installation, rich feature set, and strong community support, it’s an excellent choice for both beginners and seasoned professionals. By following this guide, you’re well-equipped to deploy and manage Ubuntu Server for your specific needs.

For more information, visit the official Ubuntu Server documentation.