Install CS-Cart with LAMP on Ubuntu 18.04 – Google Cloud.
This guide, explains the steps to install CS-Cart with LAMP on Ubuntu 18.04.
This setup is tested on Google Cloud Platform, so this guide can be used on any other cloud hosting services or VPS or Dedicated server running Ubuntu.
Prerequisites
- A running Compute Engine, see the Setting up Compute Engine Instance with Ubuntu 18.04
- Initial Ubuntu Server Set up.
- Install LAMP stack on Ubuntu in Google Cloud.
- A running Cloud SQL instance, see How to set up Cloud SQL in Google Cloud
With the above-completed prerequisites I assume you have your Apache, PHP installed and Cloud SQL is configured.
Set up your Website Directory
Your website will be located in the home directory and have the following structure
Replace yourdomainname.com
with your original domain name.
home
-- yourdomainname.com
---- logs
---- public
The public
directory is your website’s root directory and logs
directory for your error logs
Now we create these directories and set correct permissions
You need to SSH into your VM Instance and run these commands
mkdir -p yourdomainname.com/logs yourdomainname.com/public
sudo chmod -R 755 yourdomainname.com
Download CS-Cart
Once you have your Ubuntu server set up in Google Compute Engine, you can download CS-Cart from their official website.
There is no direct download link available, so you are required to use an email address to receive a download link.
Upload CS-Cart Package to Google Compute Engine
Now you can upload the downloaded CS-Cart zip file to your VM Instance by once of the following methods.
Upload the file to this directory /home/username/yourdomainname.com/public
- Use FileZilla to transfer files to VM Instance (Recommended).
- Upload CS-Cart to Google Cloud Storage and transfer to VM Instance.
- Upload using Cloud Shell.
Extract the CS-Cart Zip
Once you have uploaded the zip file you can proceed to extract the file. So move to the uploaded folder and extract it. Replace the version number with the one you have downloaded.
cd /home/username/yourdomainname.com/public
sudo unzip cscart_v4.9.3.sp1.zip -d /home/username/yourdomainname.com/public
Set up correct permissions.
sudo chown -R username /home/username/yourdomainname.com/public
sudo chmod -R 755 /home/username/yourdomainname.com/public
Configure Apache
Create a new configuration for your website.
sudo nano /etc/apache2/sites-available/yourdomainname.conf
Paste the following.
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/username/yourdomainname.com/public/
ServerName yourdomainname.com
ServerAlias www.yourdomainname.com
<Directory /home/username/yourdomainname.com/public/>
Options FollowSymlinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost *:80>
Hit Ctrl+X
followed by Y
and Enter
to save the file and exit.
Enable Apache Configuration and Rewrite Module
sudo a2ensite yourdomainname.conf
sudo a2enmod rewrite
Finally restart Apache.
sudo service apache2 restart
Now visit your domain name in the web browser, you will see the i

Enter the Cloud SQL details and follow the instructions carefully and click Install.
For MySQL server host enter Cloud SQL IP Address
Wait for the installation to complete.
Then you can login with the credentials you have created with the installation wizard.
Conclusion
Now you have learned how to install CS-Cart on your Ubuntu server in Google Cloud.
Thanks for your time. If you face any problem or any feedback, please leave a comment below.
I have completed the install as instructed (and after dealing with a few hurdles and errors) with all the back-end items installed seems to be running properly, as well as the CS-Cart files unzipped. However, when I open my domain (well, IP address for now until the domain migrates), I only see the index page listing index of Nginx (after deleting default apache index.html). How do I point it to the CS-Cart page so I can get started? Do I need to create an index file for that?