How To Install and Configure Zen Cart on an Ubuntu 18.04 VPS or Dedicated Server


Zen Cart is a popular open source shopping cart that sees strong community support. While it isn’t in as wide use as Shopify or Magento, it was one of the earlier available cart solutions.

There are many available plugins and excellent theme support. You may not get the functionality that you would from Magento. You do get a quick, working, easy to configure storefront at a very low cost of ownership.

Install LAMP

  1. Download Zen Cart From SourceForge:
    https://sourceforge.net/projects/zencart/

  1. Upload the Zip File to a Folder On Your Server

How To Install and Configure Zen Cart on an Ubuntu 18

  1. Update the System Prior to Installation

# apt-get update && sudo apt-get upgrade
  1. Install tasksel, unzip, and the software-properties-common Packages

# apt-get install tasksel
# apt-get install unzip
# apt-get install -y software-properties-common
  1. Run tasksel and Install LAMP

# tasksel

How To Install and Configure Zen Cart on an Ubuntu 18

Install Zen Cart Files

  1. Unzip the Zencart Zip File

$ sudo unzip /usr/zencart/zen-cart-v1.5.5f-12312017b.zip -d /usr/zencart
  1. Copy the Contents of the Zen Cart Folder to Your Web Root Document Directory

$ sudo cp -r /usr/zencart/zen-cart-v1.5.5f-12312017b/. /var/www/html/
  1. Rename the Existing index.html File

$ sudo mv /var/www/html/index.html /var/www/html/index.old

Secure the Domain

  1. Install Certbot

$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-apache
  1. Make Sure the Virtual Host File Has the ServerName Set

Your .conf file name may be different if you have a Virtual Host file setup for your domain.

$ sudo nano /etc/apache2/sites-available/000-default.conf

It should contain the line:
ServerName YOURDOMAIN.com;

  1. Install the Certificate

$ sudo certbot --apache -d techwritingshop.com -d www.techwritingshop.com

You should receive a message indicating the certificate was successfully installed.

How To Install and Configure Zen Cart on an Ubuntu 18

Set File Permissions and Configure PHP/MySQL

  1. Configure Zen Cart’s PHP Include Files

$ sudo mv /var/www/html/includes/dist-configure.php /var/www/html/includes/configure.php

$ sudo mv /var/www/html/admin/includes/dist-configure.php /var/www/html/includes/configure.php

$ sudo chmod 644 /var/www/html/includes/configure.php
$ sudo chmod 644 /var/www/html/admin/includes/configure.php
  1. Set Folder Permissions

$ sudo chmod -R 777 /var/www/html/cache
$ sudo chmod -R 777 /var/www/html/images/
$ sudo chmod -R 777 /var/www/html/images/*
$ sudo chmod -R 777 /var/www/html/includes/languages/english/html_includes
$ sudo chmod -R 777 /var/www/html/media
$ sudo chmod -R 777 /var/www/html/pub
$ sudo chmod -R 777 /var/www/html/admin/backups
$ sudo chmod -R 777 /var/www/html/admin/images/graphs$ sudo chmod -R 777 /var/www/html/logs
  1. Create a MySQL User and Set Permissions

$ sudo mysql -u root -p
> create database zencartdb;
> grant all privileges on zencartdb.* to 'username'@'localhost' identified by 'passwordhere';
> flush privileges;
> exit
  1. Check Your Version of PHP. It needs to be 5.2.9 -> 7.1.X. If 7.2 Has Been Installed Downgrade

$ php -v$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install php7.1
$ sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm
$ sudo a2dismod php7.2
$ sudo a2enmod php7.1
$ sudo rm /usr/bin/php
$ sudo ln -s /usr/bin/php7.1 /usr/bin/php
  1. Install the Following Extensions

$ sudo apt-get install php7.1-gd
$ sudo apt-getinstall php7.1-curl
$ sudo apt-getinstall php7.1-xml

Configure Zen Cart Itself

  1. Browse to Your Domain and Start the Installation

    How To Install and Configure Zen Cart on an Ubuntu 18

  2. On the System Inspection Screen There Should Be No Error Messages In Red Preventing the “Continue”

    Button From Being Clickable.

How To Install and Configure Zen Cart on an Ubuntu 18

  1. Agree to the License Terms and Verify the Storefront Paths are Correct and Press “Continue”

    How To Install and Configure Zen Cart on an Ubuntu 18

  2. Put in the Database Credential Setup Earlier and Choose Whether Or Not To Load Demo Data and Press “Continue”
    How To Install and Configure Zen Cart on an Ubuntu 18

  3. Complete The Superuser Information Fields and Press “Continue”. Make Sure to Get the Admin Password.

    How To Install and Configure Zen Cart on an Ubuntu 18

  1. Note the Message On the Setup Finished Screen that We need to Rename the Admin Directory and Delete the Installation Folder

    How To Install and Configure Zen Cart on an Ubuntu 18

  1. Delete the Installation Folder From The Server

$ sudo rm -rf /var/www/html/zc_install
  1. Rename the Admin Folder

$ sudo mv /var/www/html/admin/ /var/www/html/storecontrol/

You can now login and being using the admin panel on the new path. Browse to it and use the username and password created during the Zen Cart setup. Using the path above as an example just browse to https://yourdomain.com/storecontrol

How To Install and Configure Zen Cart on an Ubuntu 18

If you installed the demo store data you should also see the demo store running on the main domain. If you do the cart software is running!

How To Install and Configure Zen Cart on an Ubuntu 18

Check out these top 3 VPS services:

Was this article helpful?