LAMP Stack Installation Guide for Ubuntu 22.04
Learn to install LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 22.04 VPS. Complete step-by-step guide for web development platform setup.
Installing a LAMP Stack on Ubuntu 22.04
A LAMP (Linux, Apache, MySQL, PHP) stack provides an open-source web development platform for VPS deployments. This stack combines Ubuntu Linux as the operating system foundation, Apache web server for HTTP request handling, MySQL database for data management, and PHP for server-side scripting. The LAMP configuration supports applications ranging from basic websites to enterprise-level platforms.
System Requirements
| Component | Version | Purpose |
|---|---|---|
| Ubuntu | 22.04 LTS | Operating system foundation |
| Apache | 2.4+ | Web server |
| MySQL | 8.0+ | Database management |
| PHP | 8.1+ | Server-side scripting |
Installation Steps
Note: This guide uses Ubuntu 22.04. Enter Y and press Enter when prompted during installation.
1. Connect to Your VPS
Log in to your VPS server using SSH or your preferred connection method.
2. Update System Packages
sudo apt update && sudo apt upgrade
3. Install Apache Web Server
sudo apt install apache2
4. Install MySQL Database Server
sudo apt install mysql-server
5. Install PHP and Required Modules
sudo apt install php libapache2-mod-php php-mysql
6. Install Additional PHP Modules (Optional)
For enhanced functionality, install these common modules:
sudo apt install php-curl php-json php-cgi
7. Install WordPress-Specific Modules (If Required)
For WordPress hosting, install these additional modules:
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc
8. Restart the Server
sudo reboot
Post-Installation Configuration
After installation, configure MySQL security settings using:
sudo mysql_secure_installation
Verify Apache status:
sudo systemctl status apache2
Your LAMP stack is now ready for web application deployment on your VPS.
Related Articles
- SSH Connection Guide - Connect to your VPS before installation
- Common Ubuntu Commands - Linux command reference for VPS management
- VPS Setup Guide - Initial server configuration
- Configure Windows Firewall Ports - Open ports for web traffic
Need a VPS for web hosting? View Vluxon VPS plans with SSD storage and instant deployment.