Shopware is an open-source e-commerce platform that provides a range of features for building and managing online stores. In this tutorial, we will show you how to install Shopware Community Edition (CE) on Rocky Linux 8.
Before we begin, you need to have a server running Rocky Linux 8, with a non-root user with sudo privileges. You also need to have a LAMP (Linux, Apache, MySQL, PHP) stack installed on your server.
Step 1: Install PHP and Required Extensions
- Shopware CE is built on PHP, so you need to install PHP and some required extensions on your server. You can install PHP and the required extensions by running the following command:
sudo dnf install php php-cli php-fpm php-common php-gd php-mysqlnd php-pdo php-mbstring php-xml php-json
- Once the PHP and required extensions are installed, you need to start the
php-fpm
service and enable it to start automatically at boot time:
sudo systemctl start php-fpm
sudo systemctl enable php-fpm
Step 2: Install Apache and Modules
- Shopware CE is a web-based application, so you need to have a web server installed on your server. In this tutorial, we will use Apache as the web server. You can install Apache and some required modules by running the following command:
sudo dnf install httpd mod_fcgid
- Once the Apache and required modules are installed, you need to start the
httpd
service and enable it to start automatically at boot time:
sudo systemctl start httpd
sudo systemctl enable httpd
Step 3: Install MariaDB
- Shopware CE requires a database to store its data. In this tutorial, we will use MariaDB as the database server. You can install MariaDB by running the following command:
sudo dnf install mariadb-server
- Once the MariaDB server is installed, you need to start the
mariadb
service and enable it to start automatically at boot time:
sudo systemctl start mariadb
sudo systemctl enable mariadb
- Next, you need to secure your MariaDB installation by running the
mysql_secure_installation
script:
sudo mysql_secure_installation
The script will prompt you to set a root password, remove anonymous users, disable remote root login, and remove the test database. You should answer “Y” to all the questions.
Step 4: Create a Database and User for Shopware
Now, you need to create a database and a database user for Shopware. First, log in to the MariaDB shell as the root user:
mysql -u root -p
Enter your MariaDB root password when prompted.
Once you are logged in to the MariaDB shell, run the following commands to create a database and a database user for Shopware:
CREATE DATABASE shopware;
CREATE USER 'shopware'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON shopware.* TO 'shopware'@'localhost';
FLUSH PRIVILEGES;
Replace password
with a strong password for the `shopware’.
To install Shopware CE on Rocky Linux 8, you will need to first download and extract the Shopware CE files. After that, you will need to configure the Apache web server and create a database for Shopware. Finally, you can run the Shopware installation script to complete the installation.
To begin, download the latest version of Shopware CE from the official website and extract the files to your web server’s document root. For example, if you are using the Apache web server, the document root would be /var/www/html
.
Next, open the Apache configuration file with your favorite text editor and add a virtual host for Shopware. This virtual host will allow you to access Shopware from a domain name, such as www.myshopware.com
, instead of an IP address.
<VirtualHost *:80>
ServerName myshopware.com
DocumentRoot /var/www/html/shopware
<Directory /var/www/html/shopware>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
After you have added the virtual host, you will need to create a database for Shopware to use. You can do this using the mysql
command line tool. First, log in to the MySQL command line as the root user and create a new database for Shopware.
$ mysql -u root -p
Enter password:
mysql> CREATE DATABASE shopware;
- Next, create a new MySQL user for Shopware and grant it access to the Shopware database.
mysql> CREATE USER shopware@localhost IDENTIFIED BY 'shopware';
mysql> GRANT ALL PRIVILEGES ON shopware.* TO shopware@localhost;
Once the database is set up, you can start the Shopware installation by visiting the www.myshopware.com
URL in your web browser. Follow the on-screen instructions to complete the installation and set up your Shopware store.
In summary, to install Shopware CE on Rocky Linux 8, you will need to download and extract the files, configure the Apache web server, create a MySQL database, and run the installation script. With these steps, you can easily set up a Shopware store on your Rocky Linux 8 server.