Install Opencart 3 on NGINX
In order to install Opencart 3 you must have php 7.3+ installed
Also in the php.ini file you need to uncomment the following modules
extension=curl.so;
extension=gd.so;
extension=zip.so;
Note: If you don't have them on your system, install them. Replace the numbers 8.3 with your php version
apt-get install -y php8.3-curl php8.3-gd php8.3-zip
Restart PHP-FPM
systemctl restart php8.3-fpm
I want my site opencart3.com to be in a folder var/www/
Сreate a opencart3.com folder
mkdir /var/www/opencart3.com
Set folder permissions 755
chmod 755 /var/www/opencart3.com
Download Opencart 3
Unzip the archive and copy the contents of the upload folder to the opencart3.com folder
Rename config-dist.php to config.php and /admin/config-dist.php to /admin/config.php
Set folders and files permissions
Set permissions 777 for the cache directories
chmod 777 /var/www/opencart3.com/image/
chmod 777 /var/www/opencart3.com/image/cache/
chmod 777 /var/www/opencart3.com/image/catalog/
chmod 777 /var/www/opencart3.com/system/storage/cache/
chmod 777 /var/www/opencart3.com/system/storage/logs/
chmod 777 /var/www/opencart3.com/system/storage/download/
chmod 777 /var/www/opencart3.com/system/storage/upload/
chmod 777 /var/www/opencart3.com/system/storage/modification/
chmod 777 /var/www/opencart3.com/system/storage/session/
And files config.php and /admin/config.php
chmod 777 /var/www/opencart3.com/config.php
chmod 777 /var/www/opencart3.com/admin/config.php
Create a database for Opencart. I used Phpmyadmin. The database name can be anything.
Now open our website in the browser
http://localhost/opencart3.com/
You must agree to the license agreement. Click Continue.
Pre-Installation page.

Click Continue.
Configuration page

Click Continue.
Don't forget to delete your installation directory!
rm -r /var/www/opencart3.com/install
NGINX settings
Now open the file default.conf
nano /etc/nginx/conf.d/default.conf
And write to it
server {
listen 80;
server_name opencart3.com;
root /var/www/$server_name/;
error_log /var/log/nginx/opencart3.com.error.log;
location / {
try_files $uri $uri/ /index.php?q=$uri$args;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
try_files $uri =404;
include fastcgi_params;
}
}
Restart NGINX
service nginx restart
How to fully configure the NGINX server is described in this article