Shopware Community Edition is a free and open source e-commerce application written in PHP. It uses MySQL as the database server to store the data. Shopware is very easy to use and require no coding knowledge to work. It is secure and responsive. The application provides the interface for elements to drag and drop, it also supports design grids. It contains story tellings, slide shows, and quick views. It is used by more than 500,000 shops across the globe.
Shopware can be installed on systems with a small amount of RAM, as the requirement of RAM increase as the number of products and users increases. You will also need a minimal installation of CentOS 7 with root access on it. If you are logged in as non-root user, you can run
sudo -i to switch to root user.
Before installing any package it is recommended that you update the packages and repository using the following command.
yum -y update
Once you have your system updated, you can proceed to install the LAMP stack. Start the LAMP installation by installing Apache web server and MariaDB, which is a fork of MySQL using the following command.
yum -y install httpd mariadb-server mariadb
Since Shopware uses a PHP version greater than 5.6.4 but the YUM repository contains PHP version 5.4 only, hence we will need to use the Webtatic repository to install a version of PHP greater than 5.6.4. Run the following commands for installing EPEL repository as EPEL repository is required before we install Webtatic repository.
yum -y install epel-release
yum -y update
Now install Webtatic repository using the following commands.
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y update
yum clean all
To install PHP 5.6 and all the required PHP modules, run the following command.
yum -y install php56w php56w-fpm php56w-cli php56w-json php56w-curl php56w-gd php56w-mysql php56w-xml php56w-mbstring
To install PHP 7.0 and all the required PHP modules, run the following command.
yum -y install php70w php70w-fpm php70w-cli php70w-json php70w-curl php70w-gd php70w-mysql php70w-xml php70w-mbstring
Make sure that you are using only one of the PHP versions mentioned above. Once you have PHP installed, you can check the version of PHP using the following command.
For example, for PHP 7.0, you will likely see the following output:
[root@ip-172-31-31-130 ~]# php -v PHP 7.0.14 (cli) (built: Dec 10 2016 11:35:27) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
Make sure that your PHP version is not older than 5.6.4. Now start Apache web server and enable it to start at boot time using the following commands:
systemctl start httpd
systemctl enable httpd
Mod_rewrite by editing
/etc/httpd/conf/httpd.conf using your favorite text editor.
Find the following line.
<Directory "/var/www/html"> AllowOverride None
Change it to
You will also need to make few changes into PHP configuration file
/etc/php.ini. Open /etc/php.ini using your favorite editor.
If you do not have nano installed, you can install it using
yum -y install nano. Scroll down to find the following lines.
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M
You will need to provide at least 256MB RAM to PHP for faster processing of web pages. You may increase it to higher amounts if more RAM on the system is available. Now find
; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 2M
Change the max upload to 100 MB. Now find
Remove the semicolon from the start of the line and change the value of the parameter from 1 to 0. Next, find:
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone ;date.timezone =
Remove the semicolon from the start of the line and provide the timezone of your e-commerce store. For example
date.timezone = Asia/Kolkata
post_max_size = 8M
Change the value of the parameter to 100MB. Now save the file and exit from the editor. Once done, restart Apache web server using the following command.
systemctl restart httpd
To start MariaDB and enable it to start at boot time using the following commands.
systemctl start mariadb
systemctl enable mariadb
Now run the following commands to secure your MySQL or MariaDB installation.
It will run a small script which asks you to set a root password for your MariaDB installation. Most of the questions are self-explanatory and you should answer yes to all the questions.
As we have all the dependencies ready we can now create a database to store the data of Shopware. To create a database we will need to login to MySQL command line first. Run the following command for same.
mysql -u root -p
This will prompt you for the password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your Shopware installation.
CREATE DATABASE shopware;
The above query will create a database named
shopware. For the database, you can use any name you prefer in the place of
shopware. Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. Using root user is not recommended for the databases. To create a new database user, run the following query.
CREATE USER 'shopuser'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username
shopuser. You can use any preferred username instead of
StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command:;
GRANT ALL PRIVILEGES ON shopware.* TO 'shopuser'@'localhost';
Now run the following command to immediately apply the changes on the database privileges.
Exit from MySQL prompt using
As we have all the dependencies ready, we can now download the install package from Shopware site.
wget http://releases.s3.shopware.com.s3.amazonaws.com/install_5.2.12_8c8f67d848ef15aafaac6fed5f0eef062644250f.zip -O shopware.zip
The above command will download the installer archive and store it as
shopware.zip file. You can always look for the latest release by going to the Shopware download page.
Extract the archive using the following command.
If you don't have
unzip installed, you can run
yum -y install unzip. Remove the zip file as it is not required now.
Now you will need to disable your SELinux because iRedMail does not work with SELinux policies. To completely disable the SELinux you will need to edit /etc/selinux/config file.
If you don't have nano installed, you can install it using yum -y install nano Find the following line:
Change it to:
Now you will need to reboot your server so that the new configuration can take effect. Once the server is rebooted, you will need to provide the ownership of the application to web server user using the following command.
chown -R apache:apache /var/www/html
Now you will need to start the browser installation, go to the following link using your favorite web browser.
You will see the welcome interface, you can choose the installer language here.
Click Forward to proceed further. The system will now check for the system requirements. If you have followed the tutorial correctly you will have all the system requirements conditions met except the ionCube loader, which is optional and used when you will be using the premium plugins with Shopware.
Click Forward to proceed further. Now the installer will show you the license agreement which you will need to accept to install the software further.
Now you will need to provide the database details for storing the Shopware data.
Leave the default value in database host and database port. Provide the username and password of the database which we have created earlier to store Shopware data. If the database username and password are correct then the installer will automatically detect the database name. If not, provide the database name also. Click Forward to proceed further.
Now you will see following interface, where the installer is ready to write the data in the database.
Click Start button to write the data into the database.
Once done, you will be taken to the interface in which you will need to choose the edition of your software. If you choose the community edition, then you will not need to provide any installation key.
Finally provide the site configuration, which includes your shop name, email address, the default shop language, and site currency.
Provide the admin information, which includes Admin name, admin username, admin email address, the backend language, and admin password.
Once done, click Forward button and you will see that installer has completed the installation of Shopware application.
You can go to the following URL to browse the front end of the site.
To browse the administrative panel, go to the following URL.
You can now successfully deploy the Shopware e-commerce application on your CentOS 7 server. You can now log in to your backend to add the products to your catalog.