Skip to content
Setup a LAMP or LEMP server automatically on CentOS or Debian
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE PHP 7.3 and better NC 14 support Sep 26, 2018


Attention! 2019-05-29

I've started working on a rewrite version. This will include some breaking changes. In the future only Debian will be supported!

If you need CentOS support please fork this project asap for your own.

More details soon.

Attention! 2019-05-29

SLWMP stands for Secure Linux Webserver. It will install all necessary binaries for a secure LAMP or LEMP server automatically. Supported are the latest versions of Debian (Stretch) and CentOS (7.x).


  • Setup a secure webserver config
  • nginx OR Apache Support (HTTP2 is not supported by Apache on CentOS)
  • Secure your host with a Let's Encrypt certificate
  • Subdomain support
  • Domain Redirects and Alias support
  • Multiple PHP versions (7.1, 7.2, 7.3) running as FPM service
  • MariaDB databases with random generated passwords
  • Install Nextcloud or Wordpress with an optimized configuration for Apache and Nginx
  • Redis support (optional, but recommended if you are using Nextcloud)
  • Fail2ban support (optional)
  • UFW (uncomplicated firewall) support (Debian only, optional)


  • OS: Debian 9 (Stretch) or CentOS 7.x, clean install!


Important: SLWMP makes use of various open-source software. Please assure you agree with their license before using it. Any part of SL(A)EMP itself is released under GNU General Public License, Version 3.

git clone SLEMP
chmod +x

The setup script will add the following repositories, dependent on your OS:

After the installer is finished, CentOS user have to restart there system, because SELinux will be disabled during the installation. Also save your MySQL root password on a secure place! You will see the password at the end of the installation.

If something goes wrong there is an installer log available at /tmp/slemp_install.txt



The script will guide you through the setup. Be sure to point your domain to the IP of your server (www and non-www dns record)

You will find the config and files at the following paths:


CentOS: /etc/httpd/conf.d/ Debian: /etc/apache2/sites-enabled/


  • /etc/nginx/conf.d/


  • CentOS: /etc/opt/remi/php7x/php-fpm.d/
  • Debian: /etc/php/7.x/fpm/pool.d/


  • /var/www/YOUR-DOMAIN/

How I upload files?

  • Set a password to your location user
  • Connect over SCP with your server (Windows: WinSCP, macOS: Transmit)

What's next

  • Cleanup the script
  • Option to anonymize IPs
  • Advices to secure the server in general
You can’t perform that action at this time.