Lcmp
Install LCMP (Linux + Caddy + MariaDB + PHP) for AlmaLinux/RockyLinux/CentOS/Debian/Ubuntu
Install / Use
/learn @teddysun/LcmpREADME
📋 Table of Contents
- Description
- Supported System
- System Requirements
- Supported Software
- Supported Architecture
- Installation
- Upgrade
- Uninstall
- Default Location
- Process Management
- lcmp Command
- Bugs & Issues
- License
Description
LCMP (Linux + Caddy + MariaDB + PHP) is a powerful bash script for the installation of Caddy2 + MariaDB + PHP stack.
Key Features:
- One-command installation - just input numbers to select components
- Optimized for small memory VPS (512 MiB+ RAM)
- Supports both
dnf(RHEL-based) andapt-get(Debian-based) package managers - Complete installation in just a few minutes
Supported System
| Distribution | Versions | |-------------|----------| | Enterprise Linux | 8 / 9 / 10 (CentOS Stream, RHEL, Rocky Linux, AlmaLinux, Oracle Linux) | | Debian | 11 / 12 / 13 | | Ubuntu | 20.04 / 22.04 / 24.04 |
System Requirements
| Requirement | Minimum | |-------------|---------| | Disk Space | 5 GiB | | RAM | 512 MiB | | Network | Internet connection required | | Repository | Correct system repository | | User | root |
Supported Software
| Software | Versions | Package Source | |----------|----------|----------------| | Caddy | 2 | Teddysun Repository | | MariaDB | 10.11, 11.4, 11.8 | MariaDB Repository | | PHP | 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 | Remi Repository (RPM) / deb.sury.org (DEB) |
Supported Architecture
x86_64(amd64)aarch64(arm64)
Installation
Enterprise Linux 8 / 9 / 10
dnf -y install wget git
git clone https://github.com/teddysun/lcmp.git
cd lcmp
chmod +x *.sh
./lcmp.sh
Debian 11 ~ 13 / Ubuntu 20.04 ~ 24.04
apt-get -y install wget git
git clone https://github.com/teddysun/lcmp.git
cd lcmp
chmod +x *.sh
./lcmp.sh
Upgrade
Enterprise Linux 8 / 9 / 10
# Upgrade individual components
dnf update -y caddy
dnf update -y MariaDB-*
dnf update -y php-*
# Important: Fix PHP directory permissions after PHP version upgrade
chown root:caddy /var/lib/php/{session,wsdlcache,opcache}
Upgrade PHP Major Version (e.g., 8.3 → 8.4)
dnf module switch-to php:remi-8.4
Debian 11 ~ 13 / Ubuntu 20.04 ~ 24.04
# Upgrade individual components
apt-get install --only-upgrade -y caddy
apt-get install --only-upgrade -y mariadb-*
# Upgrade PHP (replace 8.4 with your version: 7.4|8.0|8.1|8.2|8.3|8.4|8.5)
php_ver="8.4"
apt-get install --only-upgrade -y php${php_ver}-*
Uninstall
Enterprise Linux 8 / 9 / 10
dnf remove -y caddy
dnf remove -y MariaDB-*
dnf remove -y php-*
Debian 11 ~ 13 / Ubuntu 20.04 ~ 24.04
apt-get remove -y caddy
apt-get remove -y mariadb-*
# Remove PHP (replace 8.4 with your version: 7.4|8.0|8.1|8.2|8.3|8.4|8.5)
php_ver="8.4"
apt-get remove -y php${php_ver}-*
Default Location
Caddy
| Item | Path |
|------|------|
| Web root | /data/www/default |
| Main config | /etc/caddy/Caddyfile |
| Sites config | /etc/caddy/conf.d/ |
MariaDB
| Item | Path |
|------|------|
| Data directory | /var/lib/mysql |
| Config (RPM) | /etc/my.cnf |
| Config (DEB) | /etc/mysql/my.cnf |
PHP
| Item | Path |
|------|------|
| php-fpm (RPM) | /etc/php-fpm.d/www.conf |
| php-fpm (DEB) | /etc/php/${php_ver}/fpm/pool.d/www.conf |
| php.ini (RPM) | /etc/php.ini |
| php.ini (DEB) | /etc/php/${php_ver}/fpm/php.ini |
Process Management
| Service | Command |
|---------|---------|
| Caddy | systemctl [start\|stop\|status\|restart] caddy |
| MariaDB | systemctl [start\|stop\|status\|restart] mariadb |
| PHP (RPM) | systemctl [start\|stop\|status\|restart] php-fpm |
| PHP (DEB) | systemctl [start\|stop\|status\|restart] php${php_ver}-fpm |
lcmp Command
| Command | Description |
|---------|-------------|
| lcmp start | Start all LCMP services |
| lcmp stop | Stop all LCMP services |
| lcmp restart | Restart all LCMP services |
| lcmp status | Check all LCMP services status |
| lcmp version | Print all LCMP software versions |
| lcmp vhost add | Create a new Caddy virtual host |
| lcmp vhost list | List all Caddy virtual hosts |
| lcmp vhost del | Delete a Caddy virtual host |
| lcmp db add | Create a MariaDB database and user |
| lcmp db list | List all MariaDB databases |
| lcmp db del | Delete a MariaDB database and user |
| lcmp db edit | Update a MariaDB user's password |
Bugs & Issues
Please feel free to report any bugs or issues:
- Email: i@teddysun.com
- GitHub: Open an Issue
License
Copyright (C) 2023 - 2026 Teddysun
Licensed under the GPLv3 License.
Related Skills
node-connect
354.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
