First of all, install/upgrade to PHP 7.4 that is required for Groocy 3.0.1
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/source.list.d/php.list
apt update && apt -y install php7.4
Then, install NGinx
systemctl disable --now apache2
apt install -y nginx php7.4-fpm php7.4-fpm php7.4-cli php7.4-curl php7.4-json php7.4-sqlite php7.4-gd
mkdir /var/www/html/grocy
wget -O /usr/local/src/grocy.zip https://releases.grocy.info/latest
unzip /usr/local/src/grocy.zip -d /var/www/html/grocy
cp /var/www/html/grocy/config-dist.php /var/www/html/grocy/data/config.php
chown -R www-data:www-data /var/www/html/grocy
Add next entry in your file at /etc/nginx/sites-enabled/default
server {
listen 80 default_server;
root /var/www/html/grocy/public;
index index.php;
location / {
try_files $uri /index.php;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}