HeadlinesBriefing favicon HeadlinesBriefing.com

Ubuntu 24.04 LAMP Stack Setup Script

DEV Community •
×

A new automated script installs a complete web development environment on Ubuntu 24.04 (Noble Numbat). It bundles Apache2, MySQL Server, and multiple PHP versions (7.4 through 8.4) using the Ondrej PHP PPA. The setup also includes Docker and Docker Compose from official repositories, plus optional phpMyAdmin and UFW firewall rules.

This single script automates what is typically a tedious, multi-step process for developers and sysadmins. By handling package repositories, service configuration, and security settings, it reduces setup time from hours to minutes. The inclusion of both a traditional LAMP stack and modern container tools reflects the hybrid environments many projects now require.

Developers can customize variables like the PHP version and MySQL root password before execution. After running, the script provides verification commands and a test PHP page. This approach aligns with the DevOps trend of infrastructure-as-code, making server provisioning repeatable and consistent for staging or production deployments.