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:
- A Linux Mint system running the latest version.
- A user account with sudo privileges.
- Access to the root account or the ability to run commands with sudo.
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:
Download the latest release of Mailchimp Open Commerce from the official website. You can use the
wgetcommand to download the tarball. ReplaceVERSIONwith the version you want to download:wget https://github.com/mailchimp/open-commerce/archive/v{VERSION}.tar.gzFor example, to download version 0.8.0, run:
wget https://github.com/mailchimp/open-commerce/archive/v0.8.0.tar.gzExtract the tarball:
tar xzf v{VERSION}.tar.gzMove the extracted files to the Nginx document root directory:
sudo mv open-commerce-{VERSION} /var/www/html/open-commerceSet 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:
Log in to MySQL:
sudo mysql -u rootCreate a new database for Mailchimp Open Commerce:
CREATE DATABASE open_commerce_db;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_PASSWORDwith a strong password.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:
Create a new Nginx configuration file:
sudo nano /etc/nginx/sites-available/open-commerce.confPaste 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.
Remove the default Nginx configuration file:
sudo rm /etc/nginx/sites-enabled/defaultCreate 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.confTest the Nginx configuration:
sudo nginx -tIf 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:
Install Composer:
sudo curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composerChange to the Open Commerce directory:
cd /var/www/html/open-commerceInstall 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:
Open your web browser and go to
http://localhost.Follow the instructions in the setup wizard to configure the system. You will need to provide the MySQL database credentials that you created earlier.
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.