Mets Minor League Blog

Music theory, instruments and musicians

Mets Minor League Blog

Music theory, instruments and musicians

How to Install CubeCart with Nginx on Ubuntu 24.04

How to Install CubeCart with Nginx on Ubuntu 24.04

Setting up an online store can be a rewarding way to showcase your products and reach customers worldwide. CubeCart is a popular, easy-to-use e-commerce platform that allows you to create a professional online shop without extensive coding knowledge. When combined with Nginx, a high-performance web server, you get a fast, scalable, and secure environment for your store. This guide walks you through installing CubeCart on an Ubuntu 24.04 server using Nginx, ensuring your e-commerce site runs smoothly and efficiently. Before you start, ensure you have a fresh Ubuntu 24.04 server with root or sudo access, a domain name pointed to your server’s IP address, and basic familiarity with Linux command line operations.

What You’ll Need

  • Ubuntu 24.04 server with sudo privileges
  • Domain name pointing to your server’s IP
  • Basic knowledge of Linux terminal commands
  • SSH client (like PuTTY or terminal)
  • SSL certificate (optional but recommended for security)

Step-by-Step

  1. Update your system packages: Log into your server via SSH and run:
    sudo apt update && sudo apt upgrade -y
  2. Install required dependencies: Install Nginx, PHP, MariaDB (MySQL), and necessary PHP extensions:
    sudo apt install nginx php-fpm php-mysql php-cli php-zip php-gd php-curl php-xml php-mbstring mariadb-server unzip -y
  3. Secure MariaDB: Run the security script and set root password:
    sudo mysql_secure_installation
  4. Create a database and user for CubeCart: Log into MariaDB:
    sudo mysql -u root -p
    Then execute:
    CREATE DATABASE cubecart_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 
    CREATE USER 'cubecartuser'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON cubecart_db.* TO 'cubecartuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
  5. Download CubeCart: Visit the official website and download the latest version:
    wget https://www.cubecart.com/download/latest
    or get the direct link from their site, then extract:
    unzip latest -d /var/www/cubecart
  6. Set permissions: Ensure web server can access files:
    sudo chown -R www-data:www-data /var/www/cubecart
  7. Configure Nginx server block: Create a new configuration file:
    sudo nano /etc/nginx/sites-available/cubecart and add:
    server { 
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/cubecart;
    index index.php;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }

    location ~ /\.ht {
    deny all;
    }
    }

    Save and exit.

  8. Enable site and restart Nginx:
    Create a symlink and restart:
    sudo ln -s /etc/nginx/sites-available/cubecart /etc/nginx/sites-enabled/
    sudo nginx -t (to test configuration)
    sudo systemctl restart nginx
  9. Configure PHP settings: Edit PHP-FPM config if needed, for example:
    sudo nano /etc/php/8.2/fpm/php.ini and adjust settings like upload_max_filesize and post_max_size. Then restart PHP-FPM:
    sudo systemctl restart php8.2-fpm
  10. Complete CubeCart setup: Open your browser and navigate to Related
    How to Install CubeCart with Nginx on Ubuntu 24.04
Scroll to top