PrestaShop is an open-source e-commerce platform that provides everything you need to build and manage your online store. Whether you're starting a small business or setting up a large-scale e-commerce website, PrestaShop is a flexible and powerful solution. In this guide, we will walk you through the installation and setup of PrestaShop on a VPS (Virtual Private Server) for your e-commerce needs.
Prerequisites
Before beginning the installation, make sure you have the following:
- A VPS running Ubuntu 20.04 or later (Other distributions such as CentOS or Debian can also be used, but this guide assumes Ubuntu).
- Root or sudo access to your VPS.
- A domain name (optional, but highly recommended).
- A web server like Apache or Nginx.
- PHP 7.1 or later (PrestaShop requires PHP).
- MySQL or MariaDB database (for storing e-commerce data).
- Basic knowledge of Linux commands.
Step 1: Update Your VPS
- Update System Packages
- First, update the package list and installed packages to ensure your VPS is up to date:
Step 2: Install Apache, MySQL, and PHP
PrestaShop requires Apache, MySQL, and PHP to run. Here’s how to install them on your VPS.
Install Apache
-
Install Apache Web Server
- Run the following command to install Apache:
-
Enable Apache to Start on Boot
- Ensure Apache starts automatically on boot:
-
Verify Apache Installation
- Open your browser and enter the IP address of your VPS. You should see the Apache default page. Alternatively, you can run:
Install MySQL
-
Install MySQL Server
- Install the MySQL server using:
-
Secure MySQL Installation
-
Run the MySQL secure installation script to improve security:
-
You will be prompted to set the root password and configure security options. Choose the appropriate options to secure your installation.
-
-
Check MySQL Status
- Verify MySQL is running:
Install PHP
PrestaShop requires PHP with several extensions. Here's how to install the required version of PHP.
-
Install PHP and Required Extensions
- Run the following command to install PHP and necessary extensions:
-
Verify PHP Installation
- Check the PHP version to confirm it’s installed correctly:
Step 3: Set Up MySQL Database for PrestaShop
-
Log in to MySQL
- Log in to the MySQL shell as the root user:
-
Create a Database for PrestaShop
- Create a new database for PrestaShop:
-
Create a MySQL User
-
Create a new user and grant privileges to the PrestaShop database:
-
Replace
'your_password'
with a secure password.
-
Step 4: Download and Install PrestaShop
-
Navigate to the Web Directory
- Go to your web server's root directory:
-
Download PrestaShop
- Use
wget
to download the latest version of PrestaShop from the official website:
- Use
-
Extract the PrestaShop Archive
-
Install
unzip
if not already installed: -
Extract the downloaded PrestaShop zip file:
-
-
Set Proper Permissions
- Set proper ownership and permissions for the PrestaShop files:
Step 5: Configure Apache for PrestaShop
-
Create a New Virtual Host File for PrestaShop
- Create a new virtual host configuration for Apache:
-
Add the Following Configuration
- Add the following content, replacing
your_domain_or_ip
with your actual domain name or VPS IP address:
- Add the following content, replacing
-
Enable the New Site Configuration
- Enable the new virtual host and mod_rewrite:
-
Restart Apache
- Restart Apache to apply the changes:
Step 6: Complete the PrestaShop Installation
-
Access the PrestaShop Installer
- Open your browser and navigate to
http://your_domain_or_ip
. You should see the PrestaShop installation page.
- Open your browser and navigate to
-
Choose Your Language
- Select the language for your installation and click "Next."
-
Agree to the License Agreement
- Read and agree to the PrestaShop license terms.
-
Enter Your Database Details
-
In the "Database Configuration" step, enter the following:
- Database Server:
localhost
- Database Name:
prestashop
- Database User:
prestashopuser
- Database Password: The password you set earlier.
- Database Server:
-
Click "Next" to proceed.
-
-
Configure Your Store
- Set up the store name, country, and other relevant information. Choose the default theme and create an admin account.
-
Complete Installation
- After filling out all necessary details, click "Next" to finish the installation.
Step 7: Secure Your PrestaShop Installation
-
Remove the Installation Folder
- Once PrestaShop is installed, you need to delete the
install
directory to secure your store:
- Once PrestaShop is installed, you need to delete the
-
Configure File Permissions
- Ensure the correct file permissions are applied to the PrestaShop directories:
Step 8: Access the PrestaShop Admin Panel
-
Log in to the Admin Panel
- Once the installation is complete, you can access the PrestaShop admin panel by going to:
- Replace
adminXXXX
with the actual admin folder name generated during installation.
-
Login with Admin Credentials
- Use the admin username and password you created during the installation to log in.
Conclusion
You have successfully installed and set up PrestaShop on your VPS for e-commerce. Now, you can start customizing your online store, adding products, and configuring payment and shipping methods. With PrestaShop, you have a powerful and scalable platform to grow your online business.