Certainly! Below is a step-by-step tutorial to help you install Ubuntu 24.04 on your system and set it up as a server:
---
Step 1: Prepare Your System
Before starting with the installation, ensure your system has enough RAM (at least 4 GB is recommended) and storage space for the ISO file or live USB.
---
Step 2: Choose Your Installation Method
Option 1: Live USB/CD
- Download the Ubuntu 24.04 ISO from an official source.
- Insert the ISO into your computer's CD-ROM drive or use a USB drive.
Option 2: Dual-Booting (Recommended)
- Use a system that already runs Linux, and install Ubuntu alongside it for future updates.
---
Step 3: Install Ubuntu on Your System
For Live USB:
1. Open the ISO file.
2. Insert your preferred bootable media (USB or CD/DVD).
3. Follow on-screen instructions to start installation.
For Dual-Booting:
1. After setting up a dual-boot system, install Ubuntu as described in Option 1.
---
Step 4: Set Up Server Host
1.
Create User Account
- Run
sudo apt update && sudo apt upgrade or from the ISO menu.
- Create an account for your server with sufficient permissions:
Code:
bash
sudo useradd -m -d "/home/user" -c "Server User" user
2.
Prepare partition and LVM (if needed)
- Use
lsblk to check disk space and create partitions as required.
3.
Install Ubuntu Server
- Update your package list:
Code:
bash
sudo apt update && sudo apt upgrade -y
- Install Ubuntu Server components:
Code:
bash
sudo apt install -y https://archive.ubuntu.com/ubuntu/24.04-proi universe-gui multiverse-gui gpg keyring libgpg3 \
webserver apache2 php7.4 php8.1 php8.2 php-fpm python3-tk \
gcc-9 make build-essential \
curl curlsigned-openjdk-ver-8-jdk \
- Install Apache for web services:
Code:
bash
sudo apt install -y apache2-j Tomcat
---
Step 5: Configure System
1.
Set Initial Parameters
- Create a system account and enable SSH access.
2.
Create User Accounts
- Create separate user accounts for your web server, database, and other services:
Code:
bash
sudo useradd -m -d "/home/webuser" -c "Web Server" webuser
sudo useradd -m -d "/home/dbuser" dbuser
3.
Configure Apache
- Start Apache service to make it active:
Code:
bash
sudo systemctl start apache2
4.
Set Up MySQL (Optional)
- Install and configure MySQL for your server.
---
Step 6: Security Configuration
1.
Disable UFW
- To prevent accidental firewall changes, disable User-Friendly Arithmetic:
Code:
bash
sudo update-initramfs -u /etc/ufw/enable
sudo ufw disableonboot
2.
Compile RPM Packages with UAPI
- Install the necessary packages for security updates:
Code:
bash
sudo apt install -y --update-locked \
libgpg3-uapi-seccertificates \
rm -rfR /var/lib/apt/lists/*
sudo update-apache2
---
Step 7: Run Apache
1. Enable and start Apache:
Code:
bash
sudo systemctl enable apache2
sudo systemctl start apache2
2. Log in to your server using SSH (e.g.,
ssh webuser@localhost).
3. Access the Apache interface at
http://localhost/.
---
Step 8: Set Up PHP-FPM
1. Install and configure PHP:
Code:
bash
sudo apt install -y php7.4 php8.1 php8.2 php-fpm \
php-fpm-comment-validators php-fpm-html-parser
2. Enable PHP-FPM for web services.
---
Step 9: Testing
1. Connect to your server via SSH:
Code:
bash
ssh -i ~/.ssh/id_rsa user@localhost
2. Access the Apache interface or any web application you've set up.
---
Step 10: Maintenance
- Regularly back up data and monitor system performance.
- Keep systems updated with
sudo apt update && sudo apt upgrade -y.
---
This guide should help you get started with Ubuntu 24.04 as a server. Let me know if you need further assistance!