Last active
September 20, 2024 00:29
-
-
Save garraflavatra/4543db01887b68427c1dc79a7b7aae20 to your computer and use it in GitHub Desktop.
Install nginx, PHP, FPM, MariaDB & Certbot on Debian 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update apt repositories | |
sudo apt update -y | |
sudo apt upgrade -y | |
# Install nginx & PHP | |
sudo apt install -y nginx php8.2 | |
sudo apt-get install -y php8.2-{fpm,cgi,mysql,curl,xsl,gd,common,xml,zip,xsl,soap,bcmath,mbstring,gettext,imagick,sqlite3,intl} | |
sudo nano /etc/nginx/sites-available/default | |
# Add the following / update the file to contain it: | |
# location ~ \.php$ { | |
# include snippets/fastcgi-php.conf; | |
# fastcgi_pass unix:/var/run/php/php8.2-fpm.sock; | |
# } | |
# Install MariaDB | |
sudo apt install -y mariadb-server | |
sudo mariadb-secure-installation | |
sudo systemctl start mariadb | |
sudo systemctl enable mariadb | |
# Install Certbot | |
sudo apt install -y certbot python3-certbot-nginx | |
sudo certbot --nginx -d mydomain.com | |
# Restart nginx | |
sudo systemctl restart nginx | |
sudo systemctl enable nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment