Next, let’s make sure that we’re on Debian 10. You can do that like this:<\/p>\n
# lsb_release -a<\/pre>\nYou should get this as the output:<\/p>\n
Distributor ID: Debian\r\nDescription: Debian GNU\/Linux 10 (buster)\r\nRelease: 10\r\nCodename: buster<\/pre>\nThen, run the following command to make sure that all installed packages on the server are updated to their latest available versions:<\/p>\n
# apt update && apt upgrade<\/pre>\n<\/span>Step 2: Install Nginx, MariaDB, and PHP<\/span><\/h2>\nInstall Nginx, MariaDB and other required packages with the following command:<\/p>\n
apt-get install nginx mariadb-server git curl software-properties-common -y<\/pre>\nBy default, Debian 10 ships with PHP version 7.3. But, Magento 2.3 does not support PHP 7.3. So, we will need to install PHP 7.2 and other required extensions.<\/p>\n
Of course, Magento will eventually release a version that works with PHP 7.3. If you are installing Magento with a version that supports PHP 7.3, then you should skip this step.<\/p>\n
You can install PHP 7.2 from the SURY repository. To add SURY repository, first download and GPG key with the following command:<\/p>\n
wget https:\/\/packages.sury.org\/php\/apt.gpg\r\napt-key add apt.gpg<\/pre>\nNext, add the SURY repository to APT with the following command:<\/p>\n
echo \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" | tee \/etc\/apt\/sources.list.d\/php.list<\/pre>\nNext, update the repository and install PHP 7.2 along with all required extensions with the following commands:<\/p>\n
apt-get update -y\r\napt-get install php7.2 php7.2-fpm php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql php7.2-cli php7.2-ldap php7.2-zip php7.2-curl php7.2-bcmath php7.2-imagick php7.2-xsl php7.2-intl -y<\/pre>\nNext, open php.ini<\/code> file and change the default PHP settings:<\/p>\nnano \/etc\/php\/7.2\/fpm\/php.ini<\/pre>\nChange the following settings:<\/p>\n
memory_limit = 256M\r\nupload_max_filesize = 128M\r\nzlib.output_compression = On\r\nmax_execution_time = 15000\r\ndate.timezone = America\/Chicago<\/pre>\nSave and close the file.<\/p>\n
<\/span>Step 3: Create a Magento Database<\/span><\/h2>\nSecure your MariaDB installation by using the mysql_secure_installation<\/code> script. This script will remove anonymous users, disallow root login remotely, and remove the test database.<\/p>\nmysql_secure_installation<\/pre>\nYou should answer all the questions as shown below:<\/p>\n
Enter current password for root (enter for none): Press [Enter] since no password is set by default\r\nSet root password? [Y\/n]: N (Optional)\r\nRemove anonymous users? [Y\/n]: Y\r\nDisallow root login remotely? [Y\/n]: Y\r\nRemove test database and access to it? [Y\/n]: Y\r\nReload privilege tables now? [Y\/n]: Y<\/pre>\nOnce MariaDB is secured, log in to MariaDB shell:<\/p>\n
mysql -u root -p<\/pre>\nProvide your MariaDB root password when prompted (if you set one), then create a database and user for Magento:<\/p>\n
MariaDB [(none)]> CREATE DATABASE magentodb;\r\nMariaDB [(none)]> CREATE USER 'magentouser'@'localhost';\r\nMariaDB [(none)]> SET PASSWORD FOR 'magentouser'@'localhost' = PASSWORD('Str0n9PasSworD<\/span>');<\/pre>\nMake sure to use a unique password for the database user.<\/p>\n
Next, grant all the privileges to Magento Database with the following command:<\/p>\n
MariaDB [(none)]> GRANT ALL ON magentodb.* TO 'magentouser'@'localhost' IDENTIFIED BY 'Str0n9PasSworD<\/span>' WITH GRANT OPTION;<\/pre>\nNext, flush the privileges and exit from the MariaDB shell with the following command:<\/p>\n
MariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> EXIT;<\/pre>\nOnce you have done, you can proceed to the next step.<\/p>\n