Step 1: Download Ubuntu 24.04 Server
Download the latest Ubuntu 24.04 Server ISO from the official Ubuntu releases page and create a bootable USB drive.
Step 2: Install Ubuntu 24.04 Server
Boot from the installation media and proceed with the installation using the guided setup. Ensure you select the required options based on your server needs.
Step 3: First Boot & System Update
Once the installation is complete, log in and update the system:
sudo -i
apt update && apt full-upgrade
apt install software-properties-common
Step 4: Enable SSH
SSH is usually installed by default, but verify and enable it:
apt install openssh-server
systemctl enable --now ssh
Step 5: Install Essential Packages
Add additional repositories and install required packages:
add-apt-repository ppa:ondrej/apache2
add-apt-repository ppa:ondrej/php
apt update
apt install make screen snmp composer libcurl4 unzip net-tools
apt install apache2 libapache2-mod-php mysql-server mysql-client
apt install libapache2-mod-fcgid php8.2-opcache php-apcu
apt install php-gd php-snmp php-mbstring php-mysql
apt install php-odbc php-imap php-xmlrpc php8.2-dba
apt install php-soap php-zip php-intl php-curl
Step 6: Configure Apache and PHP
Enable required Apache modules:
a2enmod rewrite actions fcgid alias proxy_fcgi expires headers
systemctl enable apache2
systemctl restart apache2
Step 7: Secure MySQL Installation
Run the MySQL security script and follow the prompts:
mysql_secure_installation
Step 8: Install phpMyAdmin
apt install phpmyadmin
systemctl restart apache2
Step 9: Install and Configure Postfix
Install Postfix and configure it as an Internet site:
apt install postfix
Edit /etc/postfix/virtual
and add:
root admin@yourdomain.tld
postmaster admin@yourdomain.tld
abuse admin@yourdomain.tld
Apply changes:
postmap /etc/postfix/virtual
postconf -e "virtual_alias_maps = hash:/etc/postfix/virtual"
systemctl restart postfix
systemctl enable postfix
Step 10: Install Cockpit for Server Management
apt install cockpit
systemctl enable --now cockpit.socket
Access Cockpit at https://yourserver.tld:9090
.
Step 11: Remove Cloud-Init (If Not Needed)
apt remove cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf
Final Steps
Ensure your server is secure by setting up a firewall and additional security configurations as required.