CubeCart is a free and open-source eCommerce solution tailored for setting up online stores efficiently. Developed in PHP, it offers a straightforward deployment process and a user-friendly environment. Key functionalities include:
- Access to technical support
- Comprehensive product statistics
- Integration with social media platforms
- Support for multiple languages
- Multi-currency compatibility
- Database utilities for backup and recovery
- Offline availability with caching capability
This guide walks you through the installation of CubeCart on a server running Ubuntu 20.04.
Prerequisites
- Deploy a Ubuntu 20.04 server with the latest updates applied
- Create a non-root user and grant sudo privileges
Matching infrastructure at centron
Ubuntu servers without your own hardware: ccloud³ VMs with full root access from €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →
Step 1: Set Up the LAMP Stack
Start by updating the system's package index:
$ sudo apt updateAdd the PHP PPA maintained by Ondřej Surý:
$ sudo apt -y install software-properties-common
$ sudo add-apt-repository ppa:ondrej/phpRefresh the package list again to include the new repository:
$ sudo apt updateCubeCart is best supported by PHP version 7.3. Install the required packages, including Apache, MariaDB, and essential PHP modules:
$ sudo apt install apache2 mariadb-server mariadb-client php7.3 libapache2-mod-php7.3 php7.3-json php7.3-common php7.3-gmp php7.3-curl php7.3-mysql php7.3-mysqli php7.3-mcrypt php7.3-opcache php7.3-intl php7.3-fpm php7.3-xmlrpc php7.3-bcmath php7.3-zip php7.3-imagick php7.3-mbstring php7.3-gd php7.3-cli php7.3-xml php7.3-zip wget unzip curl -yModify the PHP settings for optimal CubeCart performance by editing the configuration file:
$ sudo nano /etc/php/7.3/apache2/php.iniUse Control + W to locate the lines you want to change, then update the following values:
memory_limit = 512Mupload_max_filesize = 100Mpost_max_size = 100M
Ensure Apache starts on system reboot:
$ sudo systemctl enable apache2Restart Apache to apply the new configuration settings:
$ sudo systemctl restart apache2Step 2: Create the CubeCart Database
Start by enabling the MariaDB service to launch automatically on system reboot:
$ sudo systemctl enable mariadbNext, run the security script to configure and secure your MariaDB installation:
$ sudo mysql_secure_installationAnswer the prompts as follows to tighten security:
- Press Enter for the current root password
- Choose Y to set a new root password
- Select Y to remove anonymous users
- Choose Y to block remote root login
- Press Y to delete the test database
- Choose Y to reload the privileges table
Now, access the MySQL shell. Enter your root password when prompted:
$ sudo mysql -u root -pInside the MySQL shell, execute the following commands to set up the database:
- Create a new database called
cubecart:
CREATE DATABASE cubecart;- Add a user
cubecartuserwith a secure password (replaceStrongPasswordaccordingly):
CREATE USER 'cubecartuser'@'localhost' IDENTIFIED BY 'StrongPassword';- Grant the user all rights to the
cubecartdatabase:
GRANT ALL ON cubecart.* TO 'cubecartuser'@'localhost' WITH GRANT OPTION;- Apply the permission changes and exit:
FLUSH PRIVILEGES;
EXITStep 3: Install CubeCart
Download the latest version of CubeCart using the link from the official site. The version referenced here is 6.4.4:
$ wget https://www.cubecart.com/download/CubeCart-6.4.4.zipCreate a new directory within the Apache root path for the CubeCart installation:
$ sudo mkdir -p /var/www/cubecartExtract the downloaded ZIP file into the newly created directory:
$ sudo unzip CubeCart-6.4.4.zip -d /var/www/cubecartClean up by removing the ZIP archive:
$ sudo rm CubeCart-6.4.4.zipAssign ownership of the installation files to the Apache user:
$ sudo chown -R www-data:www-data /var/www/cubecartAdjust directory permissions to ensure appropriate access rights:
$ sudo chmod -R 755 /var/www/cubecartStep 4: Configure Apache2 Web Server
Start by permitting HTTP traffic through the system's firewall:
$ sudo ufw allow 80Now create a dedicated Apache configuration file named cubecart.conf:
$ sudo nano /etc/apache2/sites-available/cubecart.confInsert the following configuration details into the file and save your changes:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/cubecart
ServerName example.com
ServerAlias www.example.com
<Directory /var/www/cubecart/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>Deactivate Apache’s default site configuration to avoid conflicts:
$ sudo a2dissite 000-default.confActivate the new CubeCart site configuration:
$ sudo a2ensite cubecart.confEnable URL rewriting support, which is essential for CubeCart to function correctly:
$ sudo a2enmod rewriteRestart Apache to apply all configuration changes:
$ sudo systemctl restart apache2Step 5: Launch the CubeCart Interface
To begin the web-based setup, open your browser and navigate to your server’s IP address. For instance:
Conclusion
You have successfully installed CubeCart on your Ubuntu 20.04 server. Follow the installation wizard in your browser to set up your store. Connect to the database, create an administrator account, and finalize the site configuration. Once completed, you can access both your storefront and admin dashboard.
Testen Sie Ihr Setup auf ccloud³
Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.