{"id":5999,"date":"2021-09-23T09:22:58","date_gmt":"2021-09-23T09:22:58","guid":{"rendered":"https:\/\/blog.ssdnodes.com\/blog\/?p=5999"},"modified":"2025-05-18T19:56:11","modified_gmt":"2025-05-18T19:56:11","slug":"build-your-ecommerce-platform","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/build-your-ecommerce-platform\/","title":{"rendered":"How To Build a Cloud-Hosted Ecommerce Store With OpenCart (SSD NODES)"},"content":{"rendered":"\r\n<p>Ever dreamt of having your own eCommerce site, having the flexibility of customizing it entirely, and actually launching the business you always wanted to\u2026 but couldn\u2019t for so many reasons?<\/p>\r\n<p>In this guide, we attempt to reveal the mysteries of successfully building your own eCommerce platform.<\/p>\r\n<p><strong>We would do it in 3 simple Steps!<br \/><\/strong><strong style=\"font-size: inherit;\"><em>Ladies &amp; Gents - start your engines!<\/em><\/strong><\/p>\r\n<ul>\r\n<li><a href=\"#step1\">Step 1: Warming Up<\/a><\/li>\r\n<li><a href=\"#step2\">Step 2: Creating a database for the shop<\/a><\/li>\r\n<li><a href=\"#step3\">Step 3: Downloading and Configuring OpenCart<\/a><\/li>\r\n<\/ul>\r\n<p><strong><em>Note:<\/em><\/strong> If you want to get your server up and running with opencart already installed, or what is known as \u201c<strong><em>Chicken-Run\u201d<\/em><\/strong> \ud83d\ude09, please follow this link to access your Client Area: <a href=\"https:\/\/www.ssdnodes.com\/manage\/clientarea.php\">https:\/\/www.ssdnodes.com\/manage\/clientarea.php<\/a>, and choose <strong><em>opencart <\/em><\/strong>from the Apps dropdown selection. Whereas if you like it the old original way building it from the ground up, <strong>keep reading<\/strong> \ud83d\udcaa<\/p>\r\n<h1 id=\"step1\"><span style=\"color: #7f67f7;\">Step 1: Warming Up<\/span><\/h1>\r\n<p>First get your web hosting from a reputable and trustworthy provider like<a href=\"https:\/\/www.ssdnodes.com\/\"> <strong>SSD Nodes<\/strong><\/a> (check out our amazing anniversary deals), with the server environment for your preferred Linux Distribution.<\/p>\r\n<p><em>For this post, we are using Ubuntu 20.04, so take note if there are some minor changes depending on your distribution.<\/em><\/p>\r\n<p>So, let us install the 2 needed components: <strong>Apache web server<\/strong> to make the OpenCart store publicly available on the web, along with <strong>PHP<\/strong> scripting language.<\/p>\r\n<p><strong>Install Apache<\/strong><\/p>\r\n<p>Before installing Apache, first, update the system repositories<\/p>\r\n<pre><code>sudo apt update<\/code><\/pre>\r\n<p>Next, install apache web server by running the command<\/p>\r\n<pre><code>sudo apt install apache2 apache2-utils<\/code><\/pre>\r\n<p>The following commands can be used to <strong>start <\/strong>and <strong>enable <\/strong>Apache2 service to always start up with the server boots, as well as to check its <strong>status<\/strong>:<\/p>\r\n<pre><code>sudo systemctl enable --now apache2\r\nsudo systemctl status apache2<\/code><\/pre>\r\n<p>You can verify that Apache is really running by opening your favorite web browser and entering the URL <strong><em>http:\/\/IP_Server_Address<\/em><\/strong>, if it is installed, then you will see the following:<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6001\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image.jpg\" alt=\"ssd vps server\" width=\"16\" height=\"16\" \/><\/p>\r\n<p><strong>Install PHP 8<\/strong><\/p>\r\n<p>To install PHP 8, we start by adding a third-party PPA to Ubuntu:<\/p>\r\n<pre><code>sudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\r\n<p>Then, we update the packages cache in the system and install PHP packages:<\/p>\r\n<pre><code>sudo apt update\r\nsudo apt install php8.0 libapache2-mod-php8.0<\/code><\/pre>\r\n<p>After installation, restart Apache using the following command:<\/p>\r\n<pre><code>sudo systemctl restart apache2<\/code><\/pre>\r\n<p>Once successfully installed, we confirm the using the following command:<\/p>\r\n<pre><code>php -v<\/code><\/pre>\r\n<p>We also need to install additional PHP extensions to support OpenCart, we run the command below<\/p>\r\n<pre><code>sudo apt install php8.0-curl php8.0-zip php8.0-gd php8.0-mbstring php8.0-xml php8.0-common php8.0-dba php8.0-mysql php8.0-odbc php8.0-phpdbg<\/code><\/pre>\r\n<p>And... Restart Apache<\/p>\r\n<pre><code>sudo systemctl restart apache2<\/code><\/pre>\r\n<p>To test PHP, create a text file named info.php with the content below. Save the file, then browse to it to see if PHP is working:<\/p>\r\n<pre><code>nano \/var\/www\/html\/info.php<\/code><\/pre>\r\n<p>In this file, paste the following code:<\/p>\r\n<pre><code>&lt;?php<br \/>phpinfo();<br \/>?&gt;<\/code><\/pre>\r\n<p>Save it by pressing <strong>Ctrl-x, <\/strong>then <strong>y, <\/strong>and<strong> Enter<\/strong><\/p>\r\n<p>Try to access it at <strong><em>http:\/\/IP_Server_Address\/info.php<\/em><\/strong>. If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.<\/p>\r\n<h1 id=\"step2\"><span style=\"color: #7f67f7;\">Step 2: Creating a database for the shop<\/span><\/h1>\r\n<p>The next step is to create a database on the MariaDB free and open source database engine that is flexible, robust and easy-to-use.<\/p>\r\n<p><strong>Install MariaDB<\/strong><\/p>\r\n<pre><code>sudo apt install software-properties-common mariadb-server mariadb-client<\/code><\/pre>\r\n<p>The commands below can be used to <strong>start <\/strong>and <strong>enable <\/strong>the MariaDB service to always start up when the server boots, as well as to check its <strong>status<\/strong>:<\/p>\r\n<pre><code>sudo systemctl enable --now mariadb\r\nsudo systemctl status mariadb<\/code><\/pre>\r\n<p>Next, we need to secure our database platform to ward off any intruders or anonymous users.<\/p>\r\n<p>To accomplish this, run the command:<\/p>\r\n<pre><code>mysql_secure_installation<\/code><\/pre>\r\n<p>This will present you with a series of questions that require you to set a strong password for the root user, remove test database and anonymous users and disallow remote login as root.<\/p>\r\n<p>For security reasons, Hit Y (Yes) for all of the prompts.<\/p>\r\n<p><strong>Configure Database &amp; user for OpenCart<\/strong><\/p>\r\n<p>Login to MariaDB<\/p>\r\n<pre><code>mysql -u root -p<\/code><\/pre>\r\n<p>In this guide, we will create a database called <strong><em>opencartdb<\/em><\/strong>. Feel free to choose any name<\/p>\r\n<pre><code>CREATE DATABASE opencartdb;<\/code><\/pre>\r\n<p>Next, create the database user and assign all privileges to the user<\/p>\r\n<pre><code>CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY '<span style=\"color: #ff0000;\">strong-password<\/span>';\r\nGRANT ALL PRIVILEGES ON opencartdb . * TO 'opencartuser'@'localhost';<\/code><\/pre>\r\n<p>The above command creates a database user <strong><em>opencart_user<\/em><\/strong> and grants all privileges to the user.<\/p>\r\n<p><span style=\"color: #ff0000;\"><strong>Note: <\/strong><\/span>remember to replace the <span style=\"color: #ff0000;\"><strong><em>strong_password<\/em><\/strong><\/span> attribute with your own strong password.<\/p>\r\n<p>Finally, flush privileges and exit the database engine:<\/p>\r\n<pre><code>FLUSH PRIVILEGES;\r\nEXIT;<\/code><\/pre>\r\n<h1 id=\"step3\"><span style=\"color: #7f67f7;\">Step 3: Downloading and Configuring OpenCart<\/span><\/h1>\r\n<p><strong>Downloading OpenCart<\/strong><\/p>\r\n<p>With the database configured, now we need to download the OpenCart zipped file.<\/p>\r\n<p>First, navigate to \/tmp directory<\/p>\r\n<pre><code>cd \/tmp<\/code><\/pre>\r\n<p>Download the zipped file using the command below<\/p>\r\n<pre><code>wget https:\/\/github.com\/opencart\/opencart\/releases\/download\/3.0.3.7\/opencart-3.0.3.7.zip<\/code><\/pre>\r\n<p>Once downloaded, unzip the OpenCart zip file as shown extract the zipped file<\/p>\r\n<pre><code>apt install unzip\r\nunzip opencart-3.0.3.7.zip<\/code><\/pre>\r\n<p>We need to move this directory to the webroot directory \u2013 \/var\/www\/html<\/p>\r\n<pre><code>mv upload\/ \/var\/www\/html\/opencart<\/code><\/pre>\r\n<p><strong>Configuring OpenCart Directory<\/strong><\/p>\r\n<p>The next step is to copy a few configuration files as shown in the commands below:<\/p>\r\n<pre><code>cp \/var\/www\/html\/opencart\/config-dist.php \/var\/www\/html\/opencart\/config.php\r\ncp \/var\/www\/html\/opencart\/admin\/config-dist.php \/var\/www\/html\/opencart\/admin\/config.php<\/code><\/pre>\r\n<p>Next, modify file permissions of the OpenCart directory to make it writable to the Apache web server<\/p>\r\n<pre><code>chmod -R 755 \/var\/www\/html\/opencart\/<\/code><\/pre>\r\n<p>Finally, change ownership of the OpenCart directory to <strong><em>www:data<\/em><\/strong><\/p>\r\n<pre><code>chown -R www-data:www-data \/var\/www\/html\/opencart\/<\/code><\/pre>\r\n<h1><span style=\"color: #7f67f7;\">Et Voila!<\/span><\/h1>\r\n<p>Head out to your browser and browse your server\u2019s IP address of domain name<\/p>\r\n<p><span style=\"color: #339966;\">http:\/\/IP_address\/opencart\/install\/index.php<\/span><\/p>\r\n<p>1.\u00a0 You may read through the license, check \"I agree to the license\", and press \u201c<strong>Continue<\/strong>\u201d.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6002\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-1.png\" alt=\"eCommerce\" width=\"518\" height=\"250\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-1.png 518w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-1-300x145.png 300w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/p>\r\n<p>2.\u00a0 A list of pre-installation requirements that need to be met for successful installation of OpenCart.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6003\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-2.jpg\" alt=\"eCommerce\" width=\"542\" height=\"634\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-2.jpg 542w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-2-256x300.jpg 256w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/p>\r\n<p>3.\u00a0 You need to fill in the spaces below <strong>#1 <\/strong>by adding the database connection details (<strong>username\/password, database name<\/strong>) established when you created the store's database using MySQL Databases.<\/p>\r\n<p>Under <strong>#2<\/strong>, you should create a new username and password for administration access to the OpenCart shop. When finished, you may press \"<strong>Continue<\/strong>\".<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6004\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-3.png\" alt=\"eCommerce\" width=\"624\" height=\"422\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-3.png 624w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-3-300x203.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\r\n<p>Now that installation is complete, the \"<strong>install<\/strong>\" folder is no longer required and it should be deleted.<\/p>\r\n<p>Navigate to <strong>\/var\/www\/html\/opencart<\/strong>, and execute:<\/p>\r\n<pre><code>rm -rf install\/<\/code><\/pre>\r\n<p>Head out to your browser and browse your server\u2019s IP address of domain name<\/p>\r\n<p>For opening the StoreFront: <span style=\"color: #339966;\">http:\/\/IP_address\/opencart\/<\/span><\/p>\r\n<p>For opening the Admin Interface: <span style=\"color: #339966;\">http:\/\/IP_address\/opencart\/admin\/<\/span><\/p>\r\n<p>In the Admin interface, you will be advised to change the location of the <strong>\u2018storage\u2019 <\/strong>folder.<\/p>\r\n<p><span style=\"color: #ff0000;\">DO NOT do it Automatically<\/span>, as the interface proposes to you, since it messes up the directories paths in the config file, but choose the <strong>Manual Mode<\/strong>, as follows:<\/p>\r\n<p>1.\u00a0 Move <strong>\/var\/www\/html\/opencart\/system\/storage\/<\/strong> to <strong>\/var\/storage\/<\/strong> by executing:<\/p>\r\n<pre><code>sudo mv \/var\/www\/html\/opencart\/system\/storage\/ \/var\/storage\/<\/code><\/pre>\r\n<p>2.\u00a0 Edit <strong>config.php<\/strong> file found in <strong>\/var\/www\/html\/opencart\/<\/strong>, by changing the line<\/p>\r\n<p><code>define('DIR_STORAGE', DIR_SYSTEM . 'storage\/');<\/code><\/p>\r\n<p>to<\/p>\r\n<p><code>define('DIR_STORAGE', '\/var\/storage\/');<\/code><\/p>\r\n<p>3.\u00a0 Edit <strong>config.php<\/strong> file found in <strong>\/var\/www\/html\/opencart\/admin\/<\/strong> by changing the line<\/p>\r\n<p><code>define('DIR_STORAGE', DIR_SYSTEM . 'storage\/');<\/code><\/p>\r\n<p>to<\/p>\r\n<p><code>define('DIR_STORAGE', '\/var\/storage\/');<\/code><\/p>\r\n<p><strong>That\u2019s all - You did it!! \ud83d\ude4c\ud83c\udffb<\/strong><\/p>\r\n<p><strong>You now have the option to browse the Front End of your own shop or choose to log into the Administration side, and customize your own eCommerce platforms!<\/strong><\/p>\r\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6005\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-4.png\" alt=\"ssd vps server\" width=\"617\" height=\"624\" srcset=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-4.png 617w, https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2021\/09\/word-image-4-297x300.png 297w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><\/strong><\/p>\r\n<p><strong>If you liked this piece, please share it with your friends &amp; colleagues on Facebook, Twitter, Reddit and others on the sharing module to your right.<\/strong><\/p>\r\n<p><strong>Want us to write about a particular topic? Please send us an email at <a href=\"mailto:hello@ssdnodes.com\">hello@ssdnodes.com<\/a> so we add it to our pipeline.<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>Ever dreamt of having your own eCommerce site, having the flexibility of customizing it entirely, and actually launching the business you always wanted to\u2026 but couldn\u2019t for so many reasons? In this guide, we attempt to reveal the mysteries of successfully building your own eCommerce platform. We would do it in 3 simple Steps!Ladies &amp;  &#8230;<\/p>\n","protected":false},"author":15,"featured_media":6011,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18,30],"tags":[207,208],"class_list":["post-5999","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-tutorials","tag-ecommerce","tag-opencart"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/5999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=5999"}],"version-history":[{"count":5,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/5999\/revisions"}],"predecessor-version":[{"id":13078,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/5999\/revisions\/13078"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/6011"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=5999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=5999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=5999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}