---
slug: Installing Apache, MySQL, PHP (LAMP) Stack on Ubuntu 22.04
title: Installing Apache, MySQL, PHP (LAMP) Stack on Ubuntu 22.04
authors: [slorber, yangshun]
tags: [hola, docusaurus]
---

<!-- truncate -->

import CodeBlock from '@site/src/components/CodeBloack';


<div className="head">Introduction</div>

<div className="text">A "LAMP" stack is a bundle of free software commonly installed together to make a server capable of hosting dynamic websites and web apps built with PHP. LAMP stands for Linux (the operating system), Apache (the web server), MySQL (the database), and PHP (the scripting language).</div><br/>

<div className="text">In this guide, we'll help you set up a LAMP stack on a server running Ubuntu 22.04.</div><br/>


<div className="head">What You'll Need Before Starting</div>

<div className="text">Before we start, make sure you have an Ubuntu 22.04 server set up. You'll also need a user account with sudo privileges and a basic firewall. If you haven't done this yet, you can follow our beginner-friendly guide on setting up your Ubuntu 22.04 server.</div><br/>


<div className="head">Step 1: Setting Up Apache and Firewall</div>

<div className="text">Apache is a widely used web server that's trusted by many website owners. It's well-supported and has been around for a long time, making it a solid choice for hosting your website.</div><br/>

<div className="text">Let's begin by updating the list of available software packages. If you're using the sudo command for the first time during this session, you'll be asked to enter your password to confirm that you have permission to install software on your system.</div>

<!-- <CodeBlock code={`sudo apt update`} /><br/> -->


<!-- <div className="text">Next, install Apache by typing:</div> -->

<!-- <CodeBlock code={`sudo apt install apache2`} /><br/> -->

<!-- <div className="text">You'll be asked to confirm the installation of Apache. Just press Y, then ENTER to proceed.</div><br/> -->

<!-- <div className="text">After Apache is installed, you'll need to adjust your firewall settings to allow web traffic. Ubuntu uses a firewall tool called Uncomplicated Firewall (UFW). It comes with various application profiles you can use. To see a list of these profiles, run the following command:</div> -->

<!-- <CodeBlock code={`sudo ufw app list`} /><br/> -->

<!-- <CodeBlock code={`Output
Available applications:
  Apache
  Apache Full
  Apache Secure
  OpenSSH
`} /><br/> -->

<!-- <div className="text">Understanding Apache Firewall Profiles:</div> -->

<!-- <div className="text"><ol><li>Apache: Allows regular web traffic through port 80.</li><li>Apache Full: Allows both regular web traffic through port 80 and encrypted web traffic through port 443 (TLS/SSL).</li><li>Apache Secure: Allows only encrypted web traffic through port 443 (TLS/SSL)</li></ol></div> -->




