- Magento system requirements, you can check this if you want, but you will get all the needed components running in your droplet if you follow this guide.
- DigitalOcean Account - Click here for $10 referral credit, you will need a DigitalOcean account with a new one-click LAMP droplet running on Ubuntu 16.04, I have included my referral link, you can get 10 bucks which is enough for 2 months of the cheapest droplet, or 1 month of the 2GB-RAM droplet which is recommended for running Magento smoothly.
- Magento Account, you can use this repo to clone the code for installation, but it might be easier if you setup an account at Magento.com to download other stable versions, some with sample data, for your installation.
- SFTP client, if you decide to download the zip files above, you will need SFTP client to upload it to your droplet.
- Domain name, for setting up SSL using Let's Encrypt. You might be able to use some DDNS services with it as well.
Get your droplet ready, log in with SSH, note down the passwords and the mysql root password from the fresh install.
pico /etc/default/locale
Add following lines to locale file:
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
LC_ALL="en_US.UTF-8"
Then run:
sudo apt-get update
sudo apt-get upgrade
sudo nano /etc/apache2/sites-available/magento.conf
Add the following lines:
<VirtualHost *:80>
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
</VirtualHost>
Then run:
sudo a2ensite magento.conf
sudo a2dissite 000-default.conf
sudo a2enmod rewrite
sudo service apache2 restart
sudo nano /etc/php/7.0/apache2/php.ini
edit this line to increase memory limit
memory_limit = 512M
then run these:
sudo apt-get install php7.0-curl php7.0-gd php7.0-mcrypt php-xml php7.0-soap php7.0-bcmath php7.0-intl php7.0-zip php7.0-mbstring
sudo phpenmod mcrypt
Start MySQL
mysql -u root -p
Run the following in MySQL to create database and user, choose a properly.
CREATE DATABASE magento;
CREATE USER magento_user@localhost IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON magento.* TO magento_user@localhost IDENTIFIED BY '<password>';
FLUSH PRIVILEGES;
exit
Download the Magento file archive to your home directory manually from Magento.com In my case, I downloaded Magento-CE-2.2.2_sample_data-2017-12-11-09-37-31.tar.gz.
mv Magento-CE-2.2.2_sample_data-2017-12-11-09-37-31.tar.gz /var/www/html/
cd /var/www/html/
tar xzvf Magento-CE-2.2.2_sample_data-2017-12-11-09-37-31.tar.gz
rm Magento-CE-2.2.2_sample_data-2017-12-11-09-37-31.tar.gz
sudo chown -R www-data:www-data /var/www/html/
You need to have mapped your domain name to the IP address. Follow the setup screens below, I suggest not setting up for force all HTTPS traffic, you can do that inside Magento setup later.
cd /usr/local/sbin
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x /usr/local/sbin/certbot-auto
certbot-auto --apache -d <domain name, without https:// part, for example, www.github.com>
You can check your certificate using the following URL. https://www.ssllabs.com/ssltest/analyze.html?d=<domain name, without https:// part, for example, www.github.com>&latest
sudo crontab -e
Add the following lines:
30 2 * * 1 /usr/local/sbin/certbot-auto renew >> /var/log/le-renew.log
* * * * * /usr/bin/php /var/www/html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/log/magento.cron.log
* * * * * /usr/bin/php /var/www/html/update/cron.php >> /var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/bin/magento setup:cron:run >> /var/log/setup.cron.log
service apache2 restart
Visit your new domain for the first time to get started. You will need the username and password you setup in MySQL for the database user access. It should now be working. Well done!
To reindex Magento
php /var/www/html/bin/magento indexer:reindex
Check your php path
which php
- Magento DevBox, the easiest way to get started with Magento.
- Installation guide
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) Please see LICENSE.txt for the full text of the OSL 3.0 license or contact [email protected] for a copy.
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file. Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise.