How can we help you today?

How to Install Shopware 6 on Hypernode Docker

Created by: Rens Zuurbier

Modified on: Fri, 29 May, 2020 at 9:23 AM


The Hypernode Docker Image can be used to set up a local test environment for Magento as well as Shopware. To set such an environment for Shopware is basically the same process as for Magento. This article explains how you can install Shopware 6 on your Docker environment.

TABLE OF CONTENTS

Step One - Start a Docker container

Before you can start a Docker container make sure that Docker is running. Next you need to run the following commands in order to start a new Docker container:

docker run -p 222:22 -p 8080:80 docker.hypernode.com/byteinternet/hypernode-docker:latest

This will expose port 222 on the container and port 8080 on the localhost. In this example you should use the following command to connect to the container:

# Login as root user
ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -p 222 root@127.0.0.1

The password is insecure_docker_ssh_password.

Step Two - Install MySQL 5.7

Because the Docker environment has at this point MySQL 5.6 as default you need to install MySQL 5.7 manually. In the future we will build new Dockers with MySQL 5.7. So for now we'll need to install MySQL 5.7 with the following steps:

pkill -f mysql || /bin/true
sed -i '/myisam-recover/d' /etc/mysql/my.cnf
sed -i '/innodb_additional_mem_pool_size/d' /etc/mysql/conf.d/mysql-master.cnf
sed -i '/userstat/d' /etc/mysql/conf.d/mysql-master.cnf
apt-get update
apt-get install percona-server-client-5.7 percona-server-server-5.7 -y -q -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
/usr/bin/screen -S hypernode_service_mysql -d -m bash -c 'until /usr/sbin/mysqld; do sleep 1; done'
# wait a bit for mysql to start
mysql_upgrade
pkill -f mysql
/usr/bin/screen -S hypernode_service_mysql -d -m bash -c 'until /usr/sbin/mysqld; do sleep 1; done'
# mysql --version
mysql Ver 14.14 Distrib 5.7.26-29, for debian-linux-gnu (x86_64) using 6.3

Step Three - Update the PHP-version

In docker, changing the PHP-version is a bit different then on a real Hypernode. You can change the PHP-version by following the steps below.

# Edit /etc/my_init.d/60_restart_services.sh to use the correct PHP
vim /etc/my_init.d/60_restart_services.sh
# Change the following lines to your preferable PHP-version
/usr/bin/screen -S hypernode_service_php -d -m /usr/sbin/php-fpm7.2 --nodaemonize --fpm-config /etc/php/7.2/fpm/php-fpm.conf
update-alternatives --set php $(which php7.1)
# Save and quit the file
# Restart (all) services
bash /etc/my_init.d/60_restart_services.sh

Next: exit as root user and login as app user.

# Login as app user
ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -p 222 app@127.0.0.1

The password is insecure_docker_ssh_password.

Step Four - Install Node.js v10.16

wget https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz
tar xvfJ node-v10.16.0-linux-x64.tar.xz
mv node-v10.16.0-linux-x64 ~/.node
rm node-v10.16.0-linux-x64.tar.xz
mkdir -p ~/.local/bin
for f in ~/.node/bin/*; do ln -s $f ~/.local/bin/`basename $f`; done
ln -s /data/web/.local/bin/node{,js}
source ~/.profile

Step Five - Download and install the latest version of Shopware 6

Download the latest Shopware 6 version from the Shopware website by right clicking on “Download for free” and click on “Copy Link Address”. Now paste the link after the wget command below.

mkdir /data/web/shopware
cd /data/web/shopware
wget https://www.shopware.com/en/Download/redirect/file/install_6.1.3_1582123990.zip
 
# Unzip the downloaded .zip file
unzip install_6.1.3_1582123990.zip
 
# Enable secure document root
rm -rf /data/web/public
ln -s /data/web/shopware/public/ /data/web/public

Install Shopware 6

Now open your browser and browse to http://127.0.0.1:8080/recovery/install/index.php. At this point you can follow the install-guide through your browser. Make sure to fill in the right details at Configure database:

  • Database server: localhost
  • Database user: app
  • Database password: run cat ~/.my.cnf in your Docker and use the password you'll find there.
  • Select New database, give it a name of your choice and start the installation

Fill in the Basic shop set-up how you see fit.

Done! You’ve now successfully installed Shopware 6.

Demo data

If you’d like you could install demo data as well. To do this you’ll need to login the backend: http://APPNAME.hypernode.io/admin/ with the credentials you entered during the step: Basic shop set-up at the installation. At your first login you’ll see the “First Run Wizard”, make sure to install the Demo data at the “Demo data” menu.

R
Rens is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.