How to Install X-Cart On Ubuntu 18

X-Cart is a widely used open source cart that runs on PHP. X-Cart has been in use for over 17 years and is one of the pioneers in E-commerce solutions. X-Cart is an excellent value in cart solutions as there is just a one-time licensing fee with no ongoing costs past payments to the payment processor and web hosting.

Feature-wise there are few downsides of X-Cart compared to its competition as its been in the market for some time and it has many of the same great integrations and capabilities as its more well-known competition. While it may not have the market penetration that Shopify or Magento does, it’s a great shopping cart solution for your online store. We’re going to go over how to install the free edition on your server to get started:

  1. Add Your Domain to Your Hosts File

$ sudo nano /etc/hosts

Add the following to the bottom of the file, then save and close it:
SERVER_IP DOMAINNAME.COM

  1. Set the Hostname on the System

$ sudo hostnamectl set-hostname yourdomain.com
  1. Install tasksel if Needed

$ sudo apt-get install tasksel
  1. Update Your Current Packages and Reboot

# apt-get update && sudo apt-get upgrade
  1. Install LAMP

$ sudo tasksel

Select only LAMP off the next screen and continue. The LAMP stack will get installed.

How to Install X-Cart On Ubuntu 18

  1. Install the Required PHP Modules

$ sudo apt-get install php-mbstring php-curl php-gd php-xml
  1. Update the PHP ini File

$ sudo nano /etc/php/7.2/apache2/php.ini

Update the following variables in the file. Make sure to set the date.timezone entry to the correct entry for your location per the PHP timezones page.

file_uploads = On
allow_url_fopen = On
memory_limit = 128 M
upload_max_file_size = 64M
date.timezone = Europe/Bucharest

  1. Restart Apache

$ sudo systemctl restart apache2
  1. Create a MySQL Database and User

$ sudo mysql -u root -p
> create database xcartdb;
> grant all privileges on xcartdb.* to 'username'@'localhost' identified by 'passwordhere';
> flush privleges;
> exit
  1. Download X-Cart and Copy it to a Temporary Directory Then Extract the Archive

$ sudo scp x-cart-5.3.5.5-en.tgz sudousername@yourserverip:/tmp
$ sudo tar -xzpf x-cart-5.3.5.5-en.tgz
  1.  Copy the Newly Created X-Cart Directory to the Web Server Root Path

$ sudo cp -rf xcart/* /var/www/html/
$ sudo cp xcart/.htaccess /var/www/html/
  1.  Make Sure All Files on the Webroot Path are Owned by Apache and Rename the Old Index File

$ chown -R www-data:www-data /var/www/html/
$ sudo mv /var/www/html/index.html /var/www/html/index.old
  1. Browse to Your Domain and Follow the on Screen Prompt to Begin the Installation

How to Install X-Cart On Ubuntu 18

  1.  Follow the On Screen Prompts to Setup Your Administrator Account

    How to Install X-Cart On Ubuntu 18

  2.  Enter the Database Information From Step 9 Above

    How to Install X-Cart On Ubuntu 18

  1.  Installation is Now Completed. There Are a Few More File Permissions to Set.

How to Install X-Cart On Ubuntu 18

Set the final file permissions:

$ sudo chmod 755 /var/www/html/
$ sudo chmod 755 /var/www/html/etc/
$ sudo chmod 644 /var/www/html/etc/config.php

If you see a warning about the MySQL query cache not being enabled you can enable it by editing your MySQL conf.d file and updating the query_cache_type variable:

$ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
Find the existing query_cache_type variable and update it or add the following to the file:
query_cache_type = 1

Its Installed!

X-Cart is now installed and ready for use. Yourdomain.com/cart.php should pull up the customer facing site. I’ve installed the sample store that comes with X-Cart.

How to Install X-Cart On Ubuntu 18

The admin side of the store can be by going to yourdomain.com/admin.php. From here you can login and add products, setup your payment methods, and get your store up and running!

How to Install X-Cart On Ubuntu 18

Check out these top 3 Ecommerce hosting services:

HostArmada
$1.79 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How to Create Bundle Products in Magento 2

This is an easy-to-follow tutorial written to help you create a bundle product o
2 min read
Idan Cohen
Idan Cohen
Marketing Expert

How To Create a Custom Widget In Magento 2

This tutorial is compiled to help you create custom widgets in Magento to enable
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Set Up a Custom Contact Form in Drupal 8

This Tutorial will show how to build a custom contact form to collect a user’s
3 min read
Jeffrey Scott
Jeffrey Scott
Hosting Expert

How to Install OpenCart on an Ubuntu 18.04 Server or VPS with Apache, MariaDB and PHP 7

In this how-to, you'll learn how to install OpenCart, an open source shopping ca
3 min read
Angela Olaru
Angela Olaru
Senior Writer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top