In this tutorial, we will guide you through the process of installing Magento Open Source on Debian Latest version. We will be using the official Magento 2 repository from https://github.com/magento/magento2.
Before we start the installation process, make sure the following requirements are met:
In this step, we will clone the official Magento 2 repository from GitHub.
$ git clone https://github.com/magento/magento2.git
$ cd magento2
Composer is a dependency manager for PHP that will help us manage Magento 2 dependencies. In this step, we will install Composer on our system.
$ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
$ composer --version
In this step, we will install Magento 2.
$ composer install
[SUCCESS] Magento installation complete.
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Press Enter when asked for the file name and directory.
After the SSH key is generated, copy it using the following command:
$ cat ~/.ssh/id_rsa.pub
Copy the output of this command.
Sign in to the Magento Marketplace and go to the Access Keys page.
Click on the Create A New Access Key button.
Enter a name for the new key and paste the SSH key.
Click on the Generate Key button.
Copy the public key and the private key.
Run the following command inside the Magento 2 directory to add the Magento Marketplace credentials:
$ composer config --global http-basic.repo.magento.com <your-public-key> <your-private-key>
Replace <your-public-key>
and <your-private-key>
with the keys you copied from the Magento Marketplace.
After adding the credentials, run the following commands:
$ bin/magento setup:install --base-url=http://localhost/ --db-host=localhost --db-name=magento2 --db-user=root --db-password=<root-password> --admin-firstname=admin --admin-lastname=admin --admin-email=admin@example.com --admin-user=admin --admin-password=<admin-password> --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
Replace <root-password>
and <admin-password>
with your own passwords.
After the installation is finished, you should see the following message:
[SUCCESS] Magento installation complete.
In this step, we will configure Apache or Nginx to serve the Magento site.
$ sudo a2enmod rewrite
<VirtualHost>
section of your Apache configuration:<Directory /var/www/html/magento2>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
$ sudo systemctl restart apache2
location /magento2 {
try_files $uri $uri/ /magento2/index.php$is_args$args;
location ~ ^/magento2/(index|get|static|report|404|503|health_check)\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_MODE developer;
include fastcgi_params;
}
}
$ sudo systemctl restart nginx
In your web browser, go to http://localhost/magento2
to access your Magento 2 installation.
Congratulations, you have successfully installed Magento 2 on Debian Latest version!
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!