After creating a new project create a new VM instances for manage the server, go to compute engine -> VM Instances. And create a new VM instances
Please make sure these fileds are filled when creating New VM instance
- Set name, Region, Zone
- Set machine type
RAM which is a minimum of 3GB to run effectively, but I recommend 5 GB is suitable to load smoothly(client projects). - Boot disk Click on change button
i. operating system
Set Ubuntu as operating system instead Debian (please select operating system as per your requirement)
ii. Version
Set 18.04 LTS
iii. Boot disk type
Set SSD persistent
iv. Size (GB)
use default 10 - Firewall check Allow HTTPS traffic and Allow HTTP traffic
- Install Apache
- sudo apt update && sudo apt install apache2
- Configure Firewall
- sudo ufw allow OpenSSH
sudo ufw allow in “Apache Full”
sudo ufw enable ——————— enter “y”(yes)
sudo ufw status
- sudo ufw allow OpenSSH
- Installing Repositories
- sudo add-apt-repository ppa:ondrej/php
sudo apt-get update sudo nano /etc/apache2/sites-available/000-default.conf
<Directory “/var/www/html”>AllowOverride All</Directory> - All add below line to last line of the page ServerName 35.225.91.40 (Add your server address)
- sudo apachectl configtest
sudo a2enmod rewrite
sudo systemctl restart apache2
- sudo add-apt-repository ppa:ondrej/php
- Installing PHP 7.4
- sudo apt-get install php7.4 libapache2-mod-php7.4 php7.4-mysql php7.4-soap php7.4-bcmath php7.4-xml php7.4-mbstring php7.4-gd php7.4-common php7.4-cli php7.4-curl php7.4-intl php7.4-zip zip unzip -y
- sudo nano /etc/apache2/mods-enabled/dir.conf
- sudo systemctl restart apache2
- Install MySQL
- sudo apt update && sudo apt install mysql-server (If there is a specific version then use those.)
- Installing phpMyAdmin
- sudo apt-get install phpmyadmin php7.2-mbstring php7.2-gettext -y
- sudo systemctl restart apache2
- Create MySQL DB
- sudo mysql
- CREATE DATABASE dbname; ——- dbname – choose your databasename
- exit;
- sudo systemctl restart apache2
- Create a user and set permission (YourNewName — Replace with yourchoice of new user name )
- sudo adduser YourNewName
- sudo usermod -g www-data YourNewName
- sudo chown YourNewName:www-data /var/www/html/
- cd /var/www/html
- rm index.html (remove index.html).
- Install Elastic search
- Use this link for elastic search installation https://devdocs.magento.com/guides/v2.4/install-gde/prereq/elasticsearch.html
- Install Magento i. If we have a magento project
#If you having magento project to deploy then unzip it in /var/www/html/ folder
#Import the db in hand
#Change the db credentials in the env.php file
#Change the base url in core_config_data table
#Run Commandssudo rm -rf var/cache/ generated/ pub/static/*sudo bin/magento setup:upgrade sudorm -rf var/cache/ generated/ pub/static/*sudo php bin/magento setup:static-content:deployphp bin/magento cache:flush- If creating a new project
#If creating a new project we can install through composer or download it from magento platform
Thank you!