Compute Engine

Install Shopware on Ubuntu 18.04 with LAMP – Google Cloud

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we recommended.

Pinterest LinkedIn Tumblr

Install Shopware on Ubuntu 18.04 with LAMP on Google Cloud. In this article you are going to learn how to install Shopware on Google Cloud with Ubuntu 18.04 LTS, Apache, PHP 7.3 and use Cloud SQL for Shopware database.


Setup Installation Directories

Once you have LAMP setup completed and your domain name pointed to Google Cloud, you can proceed to setup web root directories for Shopware installation.

sudo mkdir -p  /var/www/html/shopware/public /var/www/html/shopware/logs

Now, you have the directories created and ready to setup virtual host configuration.

Create Apache Virtual Host Config

First you need to disable the default virtual host configuration.

sudo a2dissite 000-default

Create new configuration.

sudo nano /etc/apache2/sites-available/shopware.conf 

Paste the following in the file.

<VirtualHost *:80>
    ServerAdmin [email protected]

    DocumentRoot /var/www/html/shopware/public

    <Directory /var/www/html/shopware/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

    ErrorLog ${APACHE_LOG_DIR}/shopware_error.log 
    CustomLog ${APACHE_LOG_DIR}/shopware_access.log combined 

Hit Ctrl + X followed by Y and Enter to save the file.

Enable the configuration

sudo a2ensite shopware.conf

Enable Apache rewrite module

sudo a2enmod rewrite

Restart Apache.

sudo systemctl restart apache2

Setup Free SSL for Shopware

Now you can install SSL to secure your website.

HTTPS is a protocol for secure communication between a server (instance) and a client (web browser). Due to the introduction of Let’s Encrypt, which provides free SSL certificates, HTTPS are adopted by everyone and also provides trust to your audiences.

sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install python-certbot-apache

Now we have installed Cert bot by Let’s Encrypt for Ubuntu 18.04, run this command to receive your certificates.

sudo certbot --apache -m [email protected] -d -d

Select all the domains you need to receive the certificate and hit Enter

The Cert bot client will automatically generate the new certificate for your domain.

Now you will be asked to create a redirection to https

Select the appropriate option and hit Enter

Renewing SSL Certificate

Certificates provided by Let’s Encrypt are valid for 90 days only, so you need to renew them often. Now you set up a cronjob to check for the certificate which is due to expire in next 30 days and renew it automatically.

sudo crontab -e

Add this line at the end of the file

0 0,12 * * * certbot renew >/dev/null 2>&1

Hit CTRL+X followed by Y to save the changes.

This cronjob will attempt to check for renewing the certificate twice daily.

Download Shopware

To download shopware navigate to the root directory and download the package for the official website.

cd /var/www/html/shopware/public

Download Shopware package. The current latest version is 5.5.8

sudo wget -O

Extract the downloaded zip file.

sudo unzip

Now you are ready to install Shopware from your web browser.

Install Shopware

Now visit your website in the browser and select the language you would like to use and click Next.

Shopware Installation

Next is the system requirements check for Shopware. Click Next.

Shopware System Requirements

Accept the Terms and Conditions and proceed to Database configuration.

Configure Database

Configure database connections details with the Cloud SQL credentials.

  • Database Server: IP address of Cloud SQL
  • Database User: Username created in Cloud SQL
  • Database Password: Password for the user.
  • Database name: Select the database from the dropdown.

Click Next.

Click Start Installation to install Shopware.

Start Installation

Wait for the installation to complete and select the license you are going to use.

Configure your admin login credentials.

Admin Configuration

Now you have completed the installation and ready to use Shopware.

Installation Complete


Now you have installed Shopware on Ubuntu 18.04 with Apache, PHP 7.3 and connected with Cloud SQL. You also secure the installation with free autorenewable SSL certificate from Let’s Encrypt.

Hope this helps to install Shopware on Google Cloud

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.