LAMP Stack
Complete Guide
Evans
Last Update há 25 dias
What is LAMP Stack?

Short Description
LAMP Stack is a pre-configured, self-hosted web server environment running Linux, Apache, MySQL, and PHP. Deploy a fully functional web server with phpMyAdmin database management, automatic SSL via Caddy, and a custom branded landing page; all provisioned automatically on order.
LAMP Stack is a pre-configured, self-hosted web server environment running Linux, Apache, MySQL, and PHP. Deploy a fully functional web server with phpMyAdmin database management, automatic SSL via Caddy, and a custom branded landing page; all provisioned automatically on order.
More details on Lamp Stack
LAMP Stack gives you a complete, ready-to-use web hosting environment on your own VPS.Built on Ubuntu 22.04 LTS, it combines Apache (web server), MySQL (database), and PHP (scripting); all secured behind Caddy with automatic SSL certificates and phpMyAdmin for easy database management.
Your server is provisioned and ready within 3–5 minutes of ordering.| Key Features |
| Apache 2.4 web server; pre-configured and running |
| MySQL 8.0 with phpMyAdmin control panel |
| PHP 8.x with common extensions (curl, gd, mbstring, xml, zip, bcmath, json) |
| Caddy reverse proxy with automatic Let's Encrypt SSL |
| Custom branded landing page per deployment |
| Unique credentials generated per order |
| Full root SSH access |
Use Cases
- Host PHP-based applications (WordPress, Laravel, CodeIgniter)
- Database-driven web applications
- Development and staging environments
- Custom web hosting for clients
Implementation on HostAfrica
Deployment Method
LAMP Stack is deployed via our automated provisioning system:
Deployment Method
LAMP Stack is deployed via our automated provisioning system:
- Template-Based: Pre-configured Ubuntu 22.04 LTS template with full LAMP stack pre-installed
- Automation: Domain, SSL, MySQL password, and phpMyAdmin configured automatically
- Zero Manual Setup: Server is ready within 3–5 minutes of ordering
Minimum Requirements
| Component | Requirement |
| OS | Ubuntu 22.04 LTS |
| RAM | 1GB minimum (2GB recommended) |
| CPU | 1 vCPU minimum (2 recommended) |
| Storage | 20GB minimum |
| Network | Public IPv4 + domain |
Included Components
- Apache 2.4 — Web server on port 8080 (internal)
- MySQL 8.0 — Database server with password authentication
- PHP 8.x — With curl, gd, mbstring, xml, zip, bcmath, json extension
- phpMyAdmin — Web-based database management at /phpmyadmin/
- Caddy — Reverse proxy handling HTTPS on port 443 with auto SSL
How It Works (Architecture)
Caddy handles all external HTTPS traffic on port 443 and proxies requests through to Apache, which runs internally on port 8080. MySQL is only accessible from localhost — it's never exposed to the internet.
Security Architecture
- Caddy handles all external traffic on port 443 (HTTPS only)
- Apache bound to port 8080 — not directly internet-accessible
- MySQL accessible from localhost only
- phpMyAdmin secured behind HTTPS via Caddy proxy
- Unique MySQL password generated per deployment
Security Features
Automatic SSL Certificates
Service Isolation
Authentication
Automatic SSL Certificates
- Let's Encrypt certificates obtained automatically by Caddy
- Auto-renewal before expiration
- HTTPS enforced for all connections
Service Isolation
- Apache runs on localhost:8080 only — not exposed to internet
- MySQL binds to 127.0.0.1 — no remote database access by default
- Only Caddy is internet-facing on port 443
Authentication
- Unique MySQL root password generated per deployment
- phpMyAdmin accessible only via HTTPS
- Full root SSH access with password or SSH key
Getting Started
Setup Time: 3–5 minutes for automatic provisioning
Setup Time: 3–5 minutes for automatic provisioning
What You'll Receive
| Detail | Value |
| Application URL | https://your-domain-lampstack.hcloud.app |
| phpMyAdmin URL | https://your-domain-lampstack.hcloud.app/phpmyadmin/ |
| Application Login | root |
| Application Password | Auto-generated (shown in client area) |
| SSH Access | ssh [email protected] |
| Credentials File | /root/credentials.txt |
Accessing Your Server
Via Browser:
Via Browser:
- Navigate to your Application URL from the client area
- The default LAMP Stack landing page will load
- Click the phpMyAdmin link or navigate to /phpmyadmin/
- Login with username root and the password from the client area
Via SSH:
View Deployment Credentials:
Configuration
Deploying a Website
Upload your website files to the Apache document root:
Deploying a Website
Upload your website files to the Apache document root:
Changing the Domain Name
If you need to update the domain after deployment:
If you need to update the domain after deployment:
SSL certificate for the new domain will be obtained automatically.
Important: If you skip this step, phpMyAdmin will redirect to the old domain and may append the wrong port.
Changing MySQL Password
Creating a New Database
Useful Commands
Service Management
Service Management
| Command | Description |
| systemctl status apache2 | Check Apache status |
| systemctl restart apache2 | Restart Apache |
| systemctl status mysql | Check MySQL status |
| systemctl restart mysql | Restart MySQL |
| systemctl status caddy | Check Caddy/SSL status |
| systemctl restart caddy | Restart Caddy (after domain changes) |
Apache
MySQL
Caddy (Web Server)
Configuration Files
| File | Purpose |
| /var/www/html/ | Website document root |
| /etc/caddy/Caddyfile | Caddy reverse proxy config |
| /etc/apache2/ | Apache configuration |
| /etc/phpmyadmin/config.inc.php | phpMyAdmin config |
| /root/credentials.txt | Deployment credentials |
| /var/log/lampstack-deploy.log | Deployment log |
Troubleshooting
phpMyAdmin Not Loading
phpMyAdmin Not Loading
SSL Certificate Issues
Note: DNS must be pointed to the server IP before SSL can be obtained.
MySQL Access Denied
Check System Resources
Updates
System Updates
System Updates
PHP Updates
