Setup Magento on CentOS 6

Last Updated: Fri, Sep 16, 2016
CentOS Linux Guides Server Apps System Admin
Archived content

This article is outdated and may not work correctly for current operating systems or software.

Whether you want to put your store's inventory online or just a simple tech accessory shop, Magento is a great solution to online eCommerce. This article explains how to install Magento on CentOS 6. Instructions for Ubuntu are in a separate article. Magento uses a large amount of memory, you will need at least a 1GB Vultr instance.

Step 1: Installing your web server

The first thing we'll be doing is grabbing ourselves a LAMP stack. You can accomplish this by using the one-click LAMP application, or by following the instructions this article.

Step 2: Configuring the web server

Assuming you have Apache installed properly, you should be able to open up your text editor to /etc/httpd/conf.d/magento.conf.

Do this by using your favorite text editor (in this case, nano).

nano /etc/httpd/conf.d/magento.conf

Paste the following into the file:

NameVirtualHost *:80 

<VirtualHost *:80>


    DocumentRoot /var/www/


Save and close the file.

Create the directory:

mkdir /var/www/

Now, we need to install some core PHP packages for Magento.

yum install php-mcrypt php-curl php-gd curl-devel php-intl php-xsl

Finally, restart Apache:

service httpd restart

Step 3: Installing Magento

We need the Magento files, so we will get them from

Pick the "tar.gz" archive, and complete the necessary steps to download it.

Using a free SFTP client, such as FileZilla, open a connection to your server and upload the Magento tar.gz archive to your /var/www/ directory.

Go back to your SSH prompt and enter the following:

cd /var/www/

tar -xvf Magento-CE-xxxxx.tar.gz

Now that we have the files we need in place, let's setup MySQL. Execute the following to create a database:

mysql -uroot -pyourpasswordgoeshere

create database magento;


Good job. Now, head over to your web browser and type in your server's IP address. With your database details, fill in the configuration page to complete the installation.

Your Magento server is ready for use. You may create products, manage payment gateways, and so forth.

Want to contribute?

You could earn up to $600 by adding new articles.