Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md
LCMP

🚀 LCMP - Linux + Caddy + MariaDB + PHP

A powerful bash script for automated installation of Caddy2 + MariaDB + PHP stack

Caddy 2 MariaDB PHP License


📋 Table of Contents


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) and apt-get (Debian-based) package managers
  • Complete installation in just a few minutes

Supported System

DistributionVersions
Enterprise Linux8 / 9 / 10 (CentOS Stream, RHEL, Rocky Linux, AlmaLinux, Oracle Linux)
Debian11 / 12 / 13
Ubuntu22.04 / 24.04

System Requirements

RequirementMinimum
Disk Space5 GiB
RAM512 MiB
NetworkInternet connection required
RepositoryCorrect system repository
Userroot

Supported Software

SoftwareVersionsPackage Source
Caddy2Teddysun Repository
MariaDB10.11, 11.4, 11.8MariaDB Repository
PHP7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5Remi 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 22.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 22.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 22.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

ItemPath
Web root/data/www/default
Main config/etc/caddy/Caddyfile
Sites config/etc/caddy/conf.d/

MariaDB

ItemPath
Data directory/var/lib/mysql
Config (RPM)/etc/my.cnf
Config (DEB)/etc/mysql/my.cnf

PHP

ItemPath
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

ServiceCommand
Caddysystemctl [start|stop|status|restart] caddy
MariaDBsystemctl [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

CommandDescription
lcmp startStart all LCMP services
lcmp stopStop all LCMP services
lcmp restartRestart all LCMP services
lcmp statusCheck all LCMP services status
lcmp versionPrint all LCMP software versions
lcmp vhost addCreate a new Caddy virtual host
lcmp vhost listList all Caddy virtual hosts
lcmp vhost delDelete a Caddy virtual host
lcmp db addCreate a MariaDB database and user
lcmp db listList all MariaDB databases
lcmp db delDelete a MariaDB database and user
lcmp db editUpdate a MariaDB user's password

Bugs & Issues

Please feel free to report any bugs or issues:


License

Copyright (C) 2023 - 2026 Teddysun

Licensed under the GPLv3 License.

关于 About

Install LCMP (Linux + Caddy + MariaDB + PHP) for AlmaLinux/RockyLinux/CentOS/Debian/Ubuntu
almalinuxcaddycaddy2centosdebianlcmpliunxmariadbphprockylinuxubuntu

语言 Languages

Shell84.3%
HTML15.7%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
44
Total Commits
峰值: 15次/周
Less
More

核心贡献者 Contributors