DEV Community

Babatofunmi Osho-Davies
Babatofunmi Osho-Davies

Posted on

Prestashop Deployment on AWS (Free Tier)

Architecture Overview

PrestaShop is an Open Source e-commerce web application, committed to providing the best shopping cart experience for both merchants and customers. It is written in PHP, is highly customizable, supports all the major payment services, is translated in many languages and localized for many countries, has a fully responsive design (both front and back office), etc.

This project demonstrates the deployment of a PrestaShop e-commerce application using AWS Free Tier services. The architecture separates the application and database layers for scalability and reliability.

  1. EC2 Instance (Application Server): Hosts Apache, PHP, and PrestaShop
  2. Amazon RDS (Database Server): Hosts MySQL database
  3. Public Access via EC2 Public IP

Implementation Steps

Step 1: Launch EC2 Instance

Create an Ubuntu 24.04 t3.micro instance.
Configure a security group.
Add an inbound rule for All TCP from Anywhere (basically Protocol: TCP, Port: 0-65536, Source: 0.0.0.0/0)

launch instance

select server engine

configure security group

creation success

Step 2: Create Database (Amazon RDS)

Create a MySQL database using Free Tier. Configure credentials and enable public access temporarily.
Add an inbound rule for MYSQL from Anywhere (basically Protocol: TCP, Port: 3306, Source: 0.0.0.0/0)

create mysql db

creation success

Step 3: Connect to EC2

On the EC2 console.
Select the Instance you created and click on connect which will launch a Dashboard
Select SSH client and follow the instructions on how to connect.

ssh -i your-key.pem ubuntu@your-ec2-public-ip
Enter fullscreen mode Exit fullscreen mode

instance connect

Update system and install Apache Webserver

sudo apt update; sudo apt install apache2 -y
Enter fullscreen mode Exit fullscreen mode

Install Apache

Install PHP v7.4

sudo apt install software-properties-common; sudo add-apt-repository ppa:ondrej/php; sudo apt update; sudo apt-get install -y php7.4 php7.4-cli php7.4-zip php7.4-json php7.4-common php7.4-mysql php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath php7.4-simple php7.4-intl
Enter fullscreen mode Exit fullscreen mode

Install PHP

Step 4: Connect to AWS RDS using the Endpoint and Create Database

sudo apt install mysql-client
Enter fullscreen mode Exit fullscreen mode

install mysql client

sudo mysql -h YourRdsEndpoint -u admin -p
Enter fullscreen mode Exit fullscreen mode
create database db;
show databases;
exit
Enter fullscreen mode Exit fullscreen mode

Create db

Step 5: Download PrestaShop

Download the zip file and then unzip the downloaded file.
After unzipping the downloaded file, you will get prestashop.zip, and then you can store it in /var/www/html

cd /var/www/html
sudo wget https://download.prestashop.com/download/releases/prestashop_8.1.0.zip
sudo unzip prestashop_8.1.0.zip
sudo chown -R www-data:www-data /var/www/html
Enter fullscreen mode Exit fullscreen mode

Step 6: Configure Apache

Restart Apache to apply changes.

sudo chmod -R 755 /var/www/html/; 
sudo a2enmod rewrite;
sudo systemctl restart apache2.service;
sudo rm -rf index.html
Enter fullscreen mode Exit fullscreen mode

Step 8: Run Installer

To complete the installation, go to http://yourpublicipaddress
Choose your language then click Next

installation page

Click "Next" after agreeing to the terms and conditions.
Add information about your store.
Configure your database with the credentials you created when creating your AWS RDS and test the connection.

test db connection

After installation, a window will appear.

installation finished

Step 9: Access Application

Finally, close the window and revisit your site using http://yourpublicaddress

deployed site

Key Configuration Decisions

  1. Used AWS Free Tier (t2.micro) to minimize cost.
  2. Separated database using Amazon RDS for scalability.
  3. Opened only necessary ports for security.
  4. Used Apache and PHP for PrestaShop compatibility.

Deliverables

1 Public URL of deployed PrestaShop
2 Screenshots of AWS setup (EC2, RDS, Security Groups)
3 Installation and configuration steps
4 Working application accessible via browser

Top comments (0)