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) and apt-get (Debian-based) package managers
Complete installation in just a few minutes
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
Requirement
Minimum
Disk Space
5 GiB
RAM
512 MiB
Network
Internet connection required
Repository
Correct system repository
User
root
x86_64 (amd64)
aarch64 (arm64)
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
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} -*
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} -*
Item
Path
Web root
/data/www/default
Main config
/etc/caddy/Caddyfile
Sites config
/etc/caddy/conf.d/
Item
Path
Data directory
/var/lib/mysql
Config (RPM)
/etc/my.cnf
Config (DEB)
/etc/mysql/my.cnf
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
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
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
Please feel free to report any bugs or issues:
Copyright (C) 2023 - 2026 Teddysun
Licensed under the GPLv3 License.