# 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 Certbot
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d ch.hal.se
# Restart nginx
sudo systemctl restart nginx
sudo systemctl enable nginx