Installation of Ubuntu 22.04 Server with LAMP Stack

Canonical, the company behind Ubuntu, released Ubuntu 22.04 LTS (Jammy Jellyfish) on April 21, 2022, for Ubuntu Desktop, Ubuntu Server, Ubuntu Cloud, and Ubuntu Core with a five years long term support guaranteed on software and updates until April 2032.

The scope of this tutorial is to present a classic installation of Ubuntu 22.04 Server made from a CD media or a USB bootable stick and also, a basic installation of LAMP (Linux, Apache, MySQL, and PHP) packages stack with basic configurations.

Download Ubuntu 22.04 Server

The installation of Ubuntu 22.04 ISO image can be downloaded using the following link for 64-bit bit systems only.

Step 1: Installing Ubuntu 22.04 Server

1. Create a bootable CD/USB image using some bootable creators. After the system booting sequence choose your media bootable type from BIOS options (CD/DVD or USB Drive).

On the first prompt choose Install Ubuntu Server end and hit Enter.

Install Ubuntu Server
Install Ubuntu Server

2. Next select your System default Language and also Installation Process Language.

Ubuntu Server Language
Ubuntu Server Language

3. Please choose your keyboard layout or select “Identify keyboard” to detect your layout automatically.

Ubuntu Server Keyboard Layout
Ubuntu Server Keyboard Layout

4. Choose the first option ‘Ubuntu Server‘ for your installation.

Ubuntu Server Installation Type
Ubuntu Server Installation Type

5. On the next prompt series enter your network interface settings: IP address, netmask, gateway, and DNS name servers.

Ubuntu Server Network Configuration
Ubuntu Server Network Configuration
Ubuntu Server IP Address
Ubuntu Server IP Address

If your server is connected to the network, and you run a DHCP server on your directly connected network the installer automatically configures network settings with the ones provided by the DHCP server.

Ubuntu Server Network via DHCP
Ubuntu Server Network via DHCP

6. If you don’t access the Internet through a proxy leave it blank and Continue.

Ubuntu Server Proxy
Ubuntu Server Proxy

7. If you don’t have other Ubuntu mirrors, stick to default and Continue.

Ubuntu Server Mirror
Ubuntu Server Mirror

8. The hard-disks Partition table is one of the most sensitive subjects involving a server because here you have a lot of tweaking to do depending on your server’s final destination type web server, databases, file sharing NFS, Samba, application server, etc.

  • For example, if redundancy, fail-over, and high availability are needed you can set up RAID 1, if your space grows fast you can set up RAID 0 and LVM, and so on.
  • For more general use you can just use the Guided option with LVM, which is a customized option made by developers.
  • For a production environment, you probably should have LVM, software, or hardware RAID and separate partitions for /(root), /home, /boot, and /var ( the /var partition has the fastest growth rate on a production server because here are logs, databases, applications meta info, servers caches and others located.

So, now on guided storage configuration, choose “Use an entire disk” and set up the disk as an LVM group as shown.

Ubuntu Server Storage
Ubuntu Server Storage

9. Confirm the partition table, If you like to make some changes to this Partition Table you can select ‘Back‘ and edit your partitions.

Ubuntu Server Partitions
Ubuntu Server Partitions

10. Confirm the write changes to the disk.

Ubuntu Server Disk Changes
Ubuntu Server Disk Changes

11. Now is the time to set up your administrative user. On Ubuntu, this user replaces the root account and has all root account powers by employing sudo. Enter your username and hit on Continue.

Ubuntu Server User
Ubuntu Server User

12. Ubuntu Pro is a yearly subscription that offers open-source software security updates, which you can use free of charge for personal use on up to 5 machines. For enterprise, you need to purchase a subscription. I am skipping this option for now.

Ubuntu Pro
Ubuntu Pro

13. Next, install OpenSSH Server to enable remote login.

Ubuntu Server SSH
Ubuntu Server SSH

14. The “Featured Server Snaps” window shows popular snaps in your server environment. If you don’t want to install any snaps, just leave them blank and continue to Ubuntu installation.

Ubuntu Server Snaps
Ubuntu Server Snaps
Ubuntu Server Installation
Ubuntu Server Installation

15. Once installation and updates are finished, remove your media installation drive (CD/DVD, or USB) and hit Reboot Now/strong> to reboot.

Ubuntu Server Installation Finishes
Ubuntu Server Installation Finishes

Congratulations! Ubuntu 22.04 LTS Server edition is now installed and ready to rock on your brand-new metal or virtual machine.

Step 2: Basic Network Configurations

For now, only the Core server packages are installed and you can’t really offer network services for your network.

16. In order to install software login to your server console for now and verify some basic configurations like network connectivity, settings, startup daemons, software sources, updates, and others by running a series of Linux commands.

17. View system load and basic information – After login with your credentials this information is presented by default MOTD. Also, top and htop commands are useful.

Ubuntu Server Login
Ubuntu Server Login

18. Verify network IP addresses using the following ip command.

$ ip addr
Ubuntu Server IP Address
Ubuntu Server IP Address

19. Verify internet connectivity: run a ping command against a domain name (this will test TCP/IP stack and DNS).

$ ping –c 4 google.com
Ubuntu Server Ping
Ubuntu Server Ping

If you get the “Temporary failure in name resolution“ message, edit your ‘/etc/resolv.conf’ file and add the following.

Ubuntu Server Name Servers
Ubuntu Server Name Servers

20. Verify the machine hostname using the following command.

$ cat /etc/hostname
$ cat /etc/hosts
$ hostname
$ hostname –f
Ubuntu Server Hostname
Ubuntu Server Hostname

21. Finally, update and upgrade your Ubuntu system.

$ sudo apt-get update 
$ sudo apt-get upgrade

Step 3: Install LAMP Stack in Ubuntu 22.04

LAMP acronym stands for Linux OS, Apache HTTP Server, MySQL, MariaDB, MongoDB databases, Php, Perl, or Python programming languages used for generating dynamic webpages.

All of these components are free and Open-Source software and are suitable for building dynamic websites or other web applications and are the most used platforms on the Internet today (Last year Apache was estimated to serve over 23.04% of all active websites).

22. LAMP stack can be installed step by step or using just one single command.

$ sudo apt install apache2 php php-mysql mysql-client mysql-server
Install LAMP in Ubuntu 22.04
Install LAMP in Ubuntu 22.04

23. To confirm php status create an ‘info.php‘ file in the ‘/var/www/html’ server path with the following content.

$ sudo echo "" > /var/www/html/info.php

24. Then open a browser and enter your server IP address or http://server_address/info.php.

Ubuntu Server PHP
Ubuntu Server PHP

Ubuntu 22.04 and LAMP is an excellent platform to deliver network services and develop all kinds of dynamic or static websites, and complex web applications with the help of Apache, all of this made with a minimum financial impact using Free and Open Source software and the latest technologies.

Matei Cezar
I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Leave a Reply to Ravi Saive Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.