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.
Before we begin, make sure that you have these prerequisites:
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.
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 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
Extract the tarball:
tar xzf v{VERSION}.tar.gz
Move the extracted files to the Nginx document root directory:
sudo mv open-commerce-{VERSION} /var/www/html/open-commerce
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
Mailchimp Open Commerce requires a MySQL database to store the data. To configure MySQL, follow these steps:
Log in to MySQL:
sudo mysql -u root
Create 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_PASSWORD
with a strong password.
Exit the MySQL console:
exit;
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.conf
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.
Remove the default Nginx configuration file:
sudo rm /etc/nginx/sites-enabled/default
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
Test the Nginx configuration:
sudo nginx -t
If the configuration file syntax is okay, restart Nginx:
sudo systemctl restart nginx
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=composer
Change to the Open Commerce directory:
cd /var/www/html/open-commerce
Install the PHP dependencies using Composer:
sudo composer install
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.
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!