How to Use Magento for eCommerce

  Use code KB4KDO0L9 to receive a 10% recurring discount on any server.

E-Commerce businesses have a variety of options these days when considering which software to use in running their e-commerce business. There are SaaS options for those who are comfortable releasing control of their site to a third party who will manage the server backend, as well as self-hosted options where you can install the software on a server managed by your company.

One of the most popular open-source options is Magento. It has established itself as a reliable and trusted e-commerce software platform over the years. In this article, we'll provide an overview on what is Magento, how much does it cost, and how you can run it on your own server. 

See Also:How to Setup Ecommerce server hosting

What is Magento?

First released in 2008, Magento is an e-commerce management platform developed in PHP.  The Magento company is currently owned by eBay. There are two versions of Magento software, Magento Open Source and Magento Commerce. Magento Open Source is the free version of Magento, and Magento Commerce is a paid version of the product which is hosted by Magento directly. 

When reviewing who uses Magento, you will find e-commerce retailers of all shapes and sizes leveraging the completely customizable nature of the software. 

Magento Pricing

For users looking to setup Magento Open Source on their own servers, there is no cost for licensing Magento directly. The only costs would be running and maintaining the Magento server, which could be as little as $30 per month. Visit our blog for more details on server cost.

If you're wondering how much does Magento Commerce cost, the Magento prices for the Commerce version range from $22,000 per year for sales under 1 million dollars, and can go as high as $125,000 per year for businesses with over 25 million in revenue. Exact pricing for Magento Commerce can be obtained by requesting a quote with Magento directly.

Magento System Requirements

The Magento requirements to run the open-source version are as follows:

  • Linux distributions such as CentOS, Ubuntu, Debian or RedHat Enterprise Linux
  • 2GB of RAM
  • 2.0GHz Processor
  • Web Server: Apache 2.2 or 2.4 / Nginx 1.8
  • Database: MySQL 5.6, 5.7
  • PHP: 7.1.3+ 7.2.x

The Magento 2 requirements also need the following PHP curl extensions:

  • curl;
  • gd, ImageMagick > 6.3.7;
  • intl;
  • mbstring;
  • mcrypt;
  • mhash;
  • openssl;
  • PDO/MySQL;
  • SimpleXML;
  • soap;
  • xml;
  • xsl;
  • zip;
  • json (PHP 7 only);
  • iconv (PHP 7 only)

How to Install Magento

The easiest way to install Magento is by using Composer. This guide will document how to install Magento 2 on Ubuntu, so instructions may vary for other distributions:

Step 1: Install Composer, ZIp, Apache, MariaDB, and PHP Extensions

apt update
apt install mariadb-server mariadb-client apache2 composer zip php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gmp php7.2-curl php7.2-soap php7.2-bcmath php7.2-intl php7.2-mbstring php7.2-xmlrpc php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip

Step 2: Configure the Document Root

nano /etc/apache2/sites-available/magento2.conf

Paste the following content, substituting your domain and email:

<VirtualHost *:80>
DocumentRoot /var/www/html/magento2/

<Directory /var/www/html/magento2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Clear the directory and enable rewrites:

rm /var/www/html/index.html
a2ensite magento2.conf
a2enmod rewrite

Restart the database and Web Servers:

systemctl restart mariadb.service
systemctl restart apache2

Step 3: Configure the Database


Make the following selections:

Enter current password for root (enter for none): Enter
Set root password? [Y/n]: Y
New password: Type your password
Re-enter new password: Type your password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

Login to the database:

sudo mysql -u root -p

Create a new database for Magento 2:


Then create a new user called magento:


Grant magento access to the magento2 database:


Flush privileges and exit:


Step 4: Download Magento

Enter the following command, substituting the directory at the end with your desired install directory:

composer create-project --repository= magento/project-community-edition /var/www/html/

You will be required to enter your Magento public key as your username and private key as the password to authenticate. You can get your authentication keys here.

Step 5: Install Magento

You can now navigate to your server IP or installation to proceed through the graphical installation.

Deploy A Magento Server

If you're ready to create your next Magento or Small Business Server, consider booking a free consultation. ServerMania offers a wide selection of dynamic hosting solutions and a 100% uptime guarantee. We'll help you choose the right e-commerce server for your needs and budget.

Have any questions about Magento? Leave your comments below!

About The Author

generic avatar icon

Complete Digital Server Solutions For All

Bare Metal

Dedicated Servers

A single tenant, physical server allowing you full access to its resources.


Hybrid Servers

Virtualized server platform hosted on enterprise-grade physical servers.

Affordable & Secure

Cloud Servers

High-performance and highly-available infrastructure, delivering a reliable, secure, and scalable solution.