banner



How To Install Magento On Windows 10

This brief tutorial shows students and new users how to install Magento eCommerce platform on Windows 10 WSL (Windows Subsystem for Linux) 2 with Nginx HTTP server on Ubuntu 20.04 | 18.04.

Magento 2 is one of the nigh popular eCommerce platforms in use today to run very successful online stores. It'southward an open up source platform and works corking in Linux systems, including Ubuntu.

If y'all're running Windows and desire to use Magento, using Windows with WSL 2 might exist your best pick and the steps beneath will evidence you how to do that.

With WSL, y'all tin can install total Linux operating system inside Windows. So get Windows, enable WSL, install a Linux OS and run Magento.

Back in 2017, Windows released the original WSL version. WSL 2 is an improvement over version one and comes with operation boost, total system telephone call compatibility, and built with a new architecture and that delivers features that make WSL an amazing mode to run a Linux environment in Windows.

If you lot have a motorcar that meets the requirements above to run WSL 2, and so go along beneath.

To go started with running Magento on Windows with WSL, follow the steps beneath:

Enable WSL in Windows

To enable WSL in Windows, yous will want to open PowerShell terminal as administrator. Click on Start and so begin typing PowerShell.

Next, correct-click Windows PowerShell app and choose to run equally administrator.

powershell administrator

When the console opens, run the commands below:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

After installing, you should become a success bulletin similar to the lines beneath:

Deployment Image Servicing and Management tool Version: 10.0.19041.844  Image Version: 10.0.19042.844  Enabling characteristic(south) [==========================100.0%==========================] The operation completed successfully.

Enable Virtual Machine Platform

WSL 2 requires Windows 10 Virtual Machine Platform to be enabled. This is not Hyper-V. To enable the VM platform characteristic in Windows, run the commands beneath from the same PowerShell administrator's panel.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

If yous're using Windows 10 version lower than 2004, then utilize the commands beneath:

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart

When you're done running the commands to a higher place, restart your computer for all the configuration changes to utilise. If you don't restart, the below command might not be recognized.

Later restarting your computer, login back in and launch PowerShell as administrator. And then run the commands below to configure WSL 2 equally the default version of WSL.

wsl --gear up-default-version 2

Install Ubuntu in Windows 10

Now that WSL ii is installed and ready to be used, open the link below to download and install a copy of Ubuntu 20.04 from Windows store.

Get Ubuntu xx.04 LTS – Microsoft Store

Ubuntu 20.04 LTS on Windows allows you to utilise Ubuntu Concluding and run Ubuntu command line utilities including bash, ssh, git, apt and many more.

ubuntu windows wls install

Click the Get button and install. Later installing Ubuntu, you'll want the choice to launch Ubuntu from Windows WSL environment.

After launching Ubuntu, it should install and prompt to create your account.

Installing, this may accept a few minutes. Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username:          richard          New countersign: Retype new password: passwd: password updated successfully Installation successful! To run a command as administrator (user "root"), utilise "sudo <command>". See "man sudo_root" for details.  Welcome to Ubuntu 20.04.two LTS (GNU/Linux four.4.0-19041-Microsoft x86_64)   * Documentation:  https://aid.ubuntu.com  * Management:     https://landscape.canonical.com  * Support:        https://ubuntu.com/advantage    Organisation information as of Mon Apr 12 17:57:37 CDT 2021    System load:    0.52      Processes:             7   Usage of /home: unknown   Users logged in:       0   Memory usage:   26%       IPv4 accost for eth0: x.0.two.15   Swap usage:     0%  ane update can exist installed immediately. 0 of these updates are security updates. To come across these additional updates run: apt list --upgradable

That should do it!

Some troubleshooting commands to run when you run into issues above. These run below and try to launch Ubuntu image once again.

wsl --set-default-version i bcdedit /set hypervisorlaunchtype auto outset

Now that Windows 10 WSL environment is gear up, go on below to install Nginx, MariaDB, PHP and configure Magento to run.

Install Nginx HTTP Server

Magento requires a web server to function, and Nginx is one of the most popular opensource web server available today.

To install Nginx on Ubuntu, run the commands beneath:

sudo apt update sudo apt install nginx

After installing Nginx, the commands beneath can be used to cease and start Nginx services.

sudo service nginx stop sudo service nginx beginning

To test whether Nginx is installed and functioning, open up your web browser and browse to the server's IP address or hostname.

http://localhost

windows wsl ubuntu nginx install

If you see the in a higher place page in your browser, and so Nginx is working equally expected.

Install MariaDB Server

You'll also need a database server to run Magento. A database server is where Magento content get stored.

A true open source database server that you can utilize with Magento is MariaDB database server. It is fast, secure and the default server for almost all Linux servers.

To install MariaDB, run the commands below:

sudo apt install mariadb-server mariadb-client

Later installing MariaDB, the commands below can be used to stop, start and enable MariaDB service to e'er start upward when the server boots.

sudo service mysql          terminate          sudo service mysql          start        

Next, run the commands below to secure the database server with a root countersign if you lot were not prompted to do so during the installation.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

  • Enter electric current password for root (enter for none): Just printing theEnter
  • Fix root countersign? [Y/northward]:Y
  • New countersign:Enter password
  • Re-enter new password: Repeat password
  • Remove bearding users? [Y/n]: Y
  • Disallow root login remotely? [Y/northward]: Y
  • Remove test database and access to information technology? [Y/n]:Y
  • Reload privilege tables now? [Y/n]:Y

To verify and validate that MariaDB is installed and working, login to the database console using the commands below:

sudo mysql -u root -p

type the root password when prompted.

mariadb welcome

If y'all see a like screen as shown above, then the server was successfully installed.

Install PHP and Related Modules

Magento is a PHP based application, and PHP is required to run information technology. Run the commands below to install PHP and related modules to support Magento.

sudo apt install php-fpm php-common php-mysql php-gmp php-scroll php-intl php-mbstring php-xmlrpc php-gd php-xml php-cli php-nil php-lather php-bcmath

Later installing PHP, go and configure some basic settings that may be required for Magento to function properly.

For this tutorial, PHP 7.4 was installed. Based on your surroundings, another version of PHP might be installed. So verify that.

sudo nano /etc/php/seven.iv/fpm/php.ini

Below are skilful settings to configure for virtually Magento websites.

file_uploads = On allow_url_fopen = On short_open_tag = On memory_limit = 256M cgi.fix_pathinfo = 0 upload_max_filesize = 100M max_execution_time = 360 date.timezone = America/Chicago

That should go PHP 7.4 installed with some basic settings to permit Magento to part.

Subsequently setting upward PHP, the command below tin can be used to stop and start PHP7.iv services.

sudo service php7.4-fpm terminate sudo service php7.iv-fpm showtime

Create Magento Database

When all the servers installed above, it's now time to brainstorm setting upward Magento environment. Outset, run the steps below to create a blank database for Magento to employ.

Logon to MariaDB database console using the commands beneath:

sudo mysql -u root -p

Then create a database calledmagentodb

CREATE DATABASE          magentodb;

Next, create a database user called magentodbuser and fix countersign

CREATE USER 'magentodbuser'@'localhost' IDENTIFIED BY 'new_password_here';

And so grant the user total access to the database.

GRANT ALL ON          magentodb.* TO 'magentodbuser'@'localhost' WITH GRANT OPTION;

Finally, relieve your changes and exit.

FLUSH PRIVILEGES; EXIT;

Download Magento

At this betoken, Magento is ready to be downloaded and installed. Employ the commands below to download the latest version of Magento.

To get Magento latest release you lot may want to use GitHub repository… Install Composer, Curl and other dependencies to get started…

sudo apt install gyre git whorl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

When prompted, enter your authentication keys. Yourpublic key is your username; yourprivate fundamental is your password….  ( https://market.magento.com/customer/accessKeys/ )

Magento Ubuntu Key

Yous'll have to register for an account to create the primal in a higher place.

Afterward installing gyre and Composer above, change into the Nginx root directory and download Magento packages from GitHub… E'er replace the branch number with the latest branch.

To view Magento releases, see this page.

cd /var/www/ sudo composer create-project --repository=https://repo.magento.com/ magento/projection-community-edition magento

Copy and paste the authentication key… (Yourpublic key is your username; yourprivate key is your password)

Output:          Authentication required (repo.magento.com): Username: 234f2343435d190983j0ew8u3220 Password:  Practise you want to store credentials for repo.magento.com in /opt/magento/.config/composer/auth.json ? [Yn]            Y                  

After downloading Magento packages, run the commands below to install Magento with the following options:

cd /var/world wide web/magento sudo bin/magento setup:install --base-url=http://instance.com/          --db-host=localhost --db-proper noun=magentodb          --db-user=magentodbuser          --db-password=db_user_password_here          --admin-firstname=Super          --admin-lastname=Admin          --admin-email=admin@case.com          --admin-user=admin          --admin-password=admin123          --language=en_US          --currency=USD          --timezone=America/Chicago          --use-rewrites=1
  • The Magento software is installed in the root directory on localhost…. Admin isadmin;  therefore: Your storefront URL ishttp://exmaple.com
  • The database server is on the same localhost equally the webserver….
  • The database proper name ismagentodb, and themagentodbuser and countersign isdb_user_password_here
  • Uses serverrewrites
  • The Magento ambassador has the post-obit properties:
    • Get-go and terminal name are:Admin User
    • Username is:admin
  •  and the password isadmin123
  • E-mail address is:admin@example.com
  • Default language is:(U.Due south. English)
  • Default currency is:U.S. dollars
  • Default time zone is: U.Due south. Central (America/Chicago)

Elasticsearch is at present enabled with Magento packages. If you're not using it and you run into trouble after running the commands above, utilize this line to disable Elasticsearch module.

sudo php bin/magento module:disable {Magento_Elasticsearch,Magento_InventoryElasticsearch,Magento_Elasticsearch6,Magento_Elasticsearch7}

If you want to run Magento with Elasticsearch instead, read this post.

After that, run the commands below to prepare the right permissions for Magento two to function.

So run command below to allow www-data user to own the Magento directory.

sudo chown -R world wide web-data:www-information /var/world wide web/magento/ sudo chmod -R 755 /var/world wide web/magento/

Configure Nginx VirtualHost

Below is where you configure Nginx VirtualHost file for the Magento site y'all're creating. This file defines how customer requests are handled and processed.

Run the commands below to create a new VirtualHost file called Magento in the /etc/nginx/sites-bachelor/ directory.

sudo nano /etc/nginx/sites-available/magento

A very good configuration settings for most Magento site on Nginx server is below. This configuration should work great.

Copy the content beneath and save into the file created above.

upstream fastcgi_backend {   server unix:/run/php/php7.4-fpm.sock; }  server {     heed 80;     listen [::]:80;      server_name          example.com world wide web.example.com;     alphabetize  index.php;      fix $MAGE_ROOT /var/world wide web/magento;     set $MAGE_MODE production;      access_log /var/log/nginx/example.com-access.log;     error_log /var/log/nginx/example.com-error.log;      include /var/world wide web/magento/nginx.conf.sample; }

Save the file and get out.

Later on saving the file above, run the commands below to enable the new site, and then restart Nginx server.

sudo ln -south /etc/nginx/sites-bachelor/magento /etc/nginx/sites-enabled/ sudo service nginx restart

At this stage, Magento is prepare and can be launched by going to the server'south IP or hostname.

          https://example.com        

That should bring upwardly Magento home page.

magento on windows wsl ubuntu

Login with account above and you're washed.

That's it!

Conclusion:

This post showed you how to install Magento on Windows 10 with Ubuntu. If y'all find any error above, please use the annotate grade below to study.

Source: https://websiteforstudents.com/how-to-install-magento-2-on-windows-wsl/

Posted by: garciafonly1976.blogspot.com

0 Response to "How To Install Magento On Windows 10"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel