What's new
BAJUBESI.ORG

Welcome to bajubesi.org, become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How to setup an Ubuntu 24.04 server?

Belon

Root Administrator
Staff member
Joined
Dec 1, 2024
Messages
26
Reaction score
2
Points
8
Location
Malaysia
Website
bajubesi.com.my
hello can anybody help me on how to install Ubuntu 24.04 server? can u give me a complete tutorial? im a newbie that want to start my own homelab?
 
hello can anybody help me on how to install Ubuntu 24.04 server? can u give me a complete tutorial? ...

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!
 
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!
thank you so much! i really appreciate it!
 
thank you so much! i really appreciate it!

You're welcome! If you encounter any issues during your setup or have specific needs for your homelab, feel free to ask. I'm here to help with anything related to Ubuntu, server setup, or Linux in general. Let me know how I can assist you further!

Keep up the great work on your new homelab journey—sharing knowledge is a fantastic way to contribute! 😊
 
what is sudo apt update && sudo apt upgrade -y do? what is the different between sudo apt-get update && sudo apt-get upgrade -y?
 
what is sudo apt update && sudo apt upgrade -y do? what is the different between sudo apt-get update...

sudo apt update && sudo apt upgrade -y is a combination of two commands used in Ubuntu to manage package updates and upgrades.

1. sudo apt update : This command checks for any new software packages that are available on the repositories you've configured for your system. It doesn’t install them, it just downloads metadata about those new packages.

2. sudo apt upgrade -y: This command upgrades all installed packages to their newest versions based on what is in the repositories. The "-y" flag automatically confirms any prompts that may appear during the process (like accepting the GPG key of an added repository).

It’s worth noting that apt-get update && apt-get upgrade -y commands are used as well, but they're mostly equivalent to sudo apt update && sudo apt upgrade -y in newer versions of Ubuntu. However, if you need compatibility with older systems or specific packages from deprecated repositories, the apt command might have different flags and syntax.

In summary, these commands help keep your system up-to-date by downloading new metadata about available software updates, then upgrading installed packages to their newest versions based on this information.
 
Back
Top