How to Install Mailchimp Open Commerce on Linux Mint

In this tutorial, we will go through the steps to install Mailchimp Open Commerce, a free and open-source e-commerce platform from Mailchimp, on a Linux Mint system.

Prerequisites

Before we begin, make sure that you have these prerequisites:

Step 1: Install Dependencies

Mailchimp Open Commerce requires some dependencies to be installed on your Linux Mint system. To install the required dependencies, run the following command:

sudo apt update
sudo apt install nginx mysql-server php php-cli php-fpm php-mysqlnd php-xml php-mbstring

This will update the package index and install Nginx, MySQL, and the required PHP packages.

Step 2: Download and Install Mailchimp Open Commerce

Now that we have installed the dependencies, the next step is to download and install Mailchimp Open Commerce. Follow these steps:

  1. Download the latest release of Mailchimp Open Commerce from the official website. You can use the wget command to download the tarball. Replace VERSION with the version you want to download:

    wget https://github.com/mailchimp/open-commerce/archive/v{VERSION}.tar.gz
    

    For example, to download version 0.8.0, run:

    wget https://github.com/mailchimp/open-commerce/archive/v0.8.0.tar.gz
    
  2. Extract the tarball:

    tar xzf v{VERSION}.tar.gz
    
  3. Move the extracted files to the Nginx document root directory:

    sudo mv open-commerce-{VERSION} /var/www/html/open-commerce
    
  4. Set the ownership and permissions for the Open Commerce directory:

    sudo chown -R www-data:www-data /var/www/html/open-commerce
    sudo chmod -R 755 /var/www/html/open-commerce
    

Step 3: Configure MySQL

Mailchimp Open Commerce requires a MySQL database to store the data. To configure MySQL, follow these steps:

  1. Log in to MySQL:

    sudo mysql -u root
    
  2. Create a new database for Mailchimp Open Commerce:

    CREATE DATABASE open_commerce_db;
    
  3. Create a new user and grant privileges on the database:

    CREATE USER 'open_commerce_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD';
    GRANT ALL PRIVILEGES ON open_commerce_db.* TO 'open_commerce_user'@'localhost';
    FLUSH PRIVILEGES;
    

    Replace YOUR_PASSWORD with a strong password.

  4. Exit the MySQL console:

    exit;
    

Step 4: Configure Nginx

Mailchimp Open Commerce requires a web server to serve content. We will use Nginx as the web server. To configure Nginx, follow these steps:

  1. Create a new Nginx configuration file:

    sudo nano /etc/nginx/sites-available/open-commerce.conf
    
  2. Paste the following configuration into the file:

    server {
        listen 80;
        server_name localhost;
        root /var/www/html/open-commerce/public;
    
        index index.php;
    
        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }
    
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }
    }
    

    Save and close the file.

  3. Remove the default Nginx configuration file:

    sudo rm /etc/nginx/sites-enabled/default
    
  4. Create a symbolic link to the Open Commerce configuration file:

    sudo ln -s /etc/nginx/sites-available/open-commerce.conf /etc/nginx/sites-enabled/open-commerce.conf
    
  5. Test the Nginx configuration:

    sudo nginx -t
    

    If the configuration file syntax is okay, restart Nginx:

    sudo systemctl restart nginx
    

Step 5: Install Composer and Dependencies

Mailchimp Open Commerce uses Composer, a PHP package manager, to manage the dependencies. To install Composer and dependencies, follow these steps:

  1. Install Composer:

    sudo curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    
  2. Change to the Open Commerce directory:

    cd /var/www/html/open-commerce
    
  3. Install the PHP dependencies using Composer:

    sudo composer install
    

Step 6: Run the Setup Wizard

Mailchimp Open Commerce provides a setup wizard to configure the system. To run the setup wizard, follow these steps:

  1. Open your web browser and go to http://localhost.

  2. Follow the instructions in the setup wizard to configure the system. You will need to provide the MySQL database credentials that you created earlier.

  3. When the setup wizard is complete, log in to the Open Commerce dashboard using the provided credentials.

Congratulations! You have successfully installed Mailchimp Open Commerce on your Linux Mint system. You can now start building your e-commerce website.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!