Installing Shopware 6
The below example demonstrates the from-scratch setup of the Shopware 6 application for local development. A similar process can easily be used to configure an environment of any other type. This assumes that RollDev has been previously started via roll svc up
as part of the installation procedure.
Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started:
mkdir -p ~/Sites/exampleproject cd ~/Sites/exampleproject
From the root of your new project directory, run
env-init
to create the.env.roll
file with configuration needed for RollDev and Docker to work with the project.roll env-init exampleproject shopware
The result of this command is a
.env.roll
file in the project root (tip: commit this to your VCS to share the configuration with other team members) having the following contents:ROLL_ENV_NAME=exampleproject ROLL_ENV_TYPE=shopware ROLL_WEB_ROOT=/ TRAEFIK_DOMAIN=exampleproject.test TRAEFIK_SUBDOMAIN=app ROLL_DB=1 ROLL_REDIS=1 ROLL_RABBITMQ=0 ROLL_ELASTICSEARCH=0 ROLL_VARNISH=0 DB_DISTRIBUTION=mariadb DB_DISTRIBUTION_VERSION=10.4 NODE_VERSION=12 COMPOSER_VERSION=2 PHP_VERSION=7.4 PHP_XDEBUG_3=1 RABBITMQ_VERSION=3.8 REDIS_VERSION=5.0 VARNISH_VERSION=6.0
Sign an SSL certificate for use with the project (the input here should match the value of
TRAEFIK_DOMAIN
in the above.env.roll
example file):roll sign-certificate exampleproject.test
Configure the project to use
./webroot
so the Shopware installer won’t overwrite RollDev’s.env.roll
fileperl -pi -e 's#^ROLL_WEB_ROOT.*#ROLL_WEB_ROOT=/webroot#' .env.roll
Clone the Shopware development template
git clone git@github.com:shopware/development.git ./webroot
Next you’ll want to start the project environment:
roll env up
Warning
If you encounter an error about
Mounts denied
, follow the instructions in the error message and runroll env up
again.Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the
php-fpm
docker container this launches you into:roll shell
Configure the
APP_URL
Shopware will use during installation:echo $'const:\n APP_URL: "https://app.exampleproject.test"\n' > .psh.yaml.override
Install the Shopware application complete with sample data:
./psh.phar install
Launch the application in your browser:
Note
The default username for Shopware 6 is admin
with password shopware
.
Note
To completely destroy the exampleproject
environment we just created, run roll env down -v
to tear down the project’s Docker containers, volumes, etc.