Skip to content

Instantly share code, notes, and snippets.

@garraflavatra
Last active August 13, 2023 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garraflavatra/4543db01887b68427c1dc79a7b7aae20 to your computer and use it in GitHub Desktop.
Save garraflavatra/4543db01887b68427c1dc79a7b7aae20 to your computer and use it in GitHub Desktop.
Install nginx, PHP, FPM, MariaDB & Certbot on Debian 12
# 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