PrestaShop is a powerful open-source e-commerce platform that allows businesses to create and manage online stores with ease. It includes features for product management, inventory tracking, payments, multilingual storefronts, and more, making it a popular choice for small and medium-sized businesses.
In this tutorial, you’ll learn how to install PrestaShop on Ubuntu 26.04 using a LAMP stack (Linux, Apache, MariaDB, and PHP). By the end of this guide, you’ll have a working PrestaShop installation accessible through your domain name.
Prerequisites
Before you begin, make sure you have:
- An Ubuntu 26.04 server
- A root user or a user with sudo privileges
- A domain name pointed to your server with a valid A record
- Internet access to download packages and dependencies
Note: Having your domain configured before starting makes the final web-based installation much easier.
Step 1: Update the System
Before installing any software, update your system packages to ensure you are using the latest available versions.
apt update -y && apt upgrade -y

This command refreshes the package list and upgrades installed packages.
Step 2: Install the LAMP Stack
PrestaShop requires a web server, database server, and PHP environment. In this section, you’ll install Apache, MariaDB, and PHP.
Install Apache Web Server
Install Apache using the following command:
apt install apache2 -y

After installation, start Apache and enable it to launch automatically after reboot:
systemctl start apache2 && systemctl enable apache2

Verify that Apache is running:
systemctl status apache2

You should see the service listed as active (running).
Install MariaDB Database Server
MariaDB will store all PrestaShop data, including products, customer accounts, and orders.
Install MariaDB:
apt install mariadb-server -y

Start the service and enable automatic startup:
systemctl start mariadb && systemctl enable mariadb
Check the service status:
systemctl status mariadb
The service should be running successfully.

Install PHP and Required Extensions
PrestaShop depends on PHP and several PHP extensions.
Install PHP and the required modules:
apt install php libapache2-mod-php php-cli php-fpm php-curl php-mysqlnd php-gd php-readline php-mbstring php-apcu php-xml php-dom php-zip php-intl php-common php-bcmath php-json -y

Verify the PHP installation:
php -v

The command should display the installed PHP version.
Step 3: Create a PrestaShop Database and User
PrestaShop requires a dedicated database and database user.
Log in to the MariaDB console:
mysql
Run the following SQL commands:
CREATE DATABASE prestadb;
CREATE USER 'prestauser'@'localhost'
IDENTIFIED BY 'YourStrongPasswordHere';
GRANT ALL ON prestadb.* TO 'prestauser'@'localhost'
WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
Important: Replace YourStrongPasswordHere with a strong password before continuing.
Step 4: Download and Install PrestaShop
Now that the LAMP environment and database are ready, download PrestaShop and prepare the application files.
Download the PrestaShop Source Code
Move to the web root directory:
cd /var/www/html
Download the PrestaShop archive:
wget https://github.com/PrestaShop/PrestaShop/archive/refs/tags/9.1.1.zip

Extract the archive:
unzip 9.1.1.zip

Rename the extracted directory:
mv PrestaShop-9.1.1/ prestashop/

Remove the downloaded ZIP file:
rm 9.1.1.zip
Install Composer
Composer is required to install and manage PrestaShop dependencies.
Install Composer:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

Install PrestaShop Dependencies
Navigate to the PrestaShop directory:
cd /var/www/html/prestashop
Install required dependencies:
composer install
Configure File Permissions
Assign Apache ownership to the application files:
chown -R www-data:www-data /var/www/html/prestashop/
Set recommended directory permissions:
find . -type d -exec chmod 755 {} \;
Set recommended file permissions:
find . -type f -exec chmod 644 {} \;
These permissions allow Apache to access the files while maintaining reasonable security.
Step 5: Configure Apache for PrestaShop
To access your store through a domain name, create an Apache virtual host configuration.
Create a Virtual Host File
Create a new configuration file:
touch /etc/apache2/sites-available/prestashop.conf
Open the file with your preferred text editor and add:
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/prestashop
<Directory /var/www/html/prestashop>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Replace: yourdomain.com with your actual domain name.
Enable Required Apache Features
Enable the rewrite module:
a2enmod rewrite

Enable the virtual host:
a2ensite prestashop.conf
Test Apache Configuration
Before restarting Apache, verify that the configuration syntax is correct:
apachectl -t
If everything is configured properly, Apache will report that the syntax is valid.
Restart Apache
Apply the changes:
systemctl restart apache2
Your site should now be accessible at:
http://yourdomain.com
Important: Ensure your domain’s DNS A record points to the server’s public IP address.

Step 6: Complete the Web-Based PrestaShop Installation
With the server configuration complete, finish the installation through the PrestaShop setup wizard.

Open the Installation Wizard
Visit:
http://yourdomain.com
The PrestaShop installer will load in your browser.
Select Your Language
Choose the language you want to use for the installer and administration panel.
Accept the License Agreement
Review the license terms and select:
- I agree to the above terms and conditions
Continue to the next step.
Enter Store Information
Provide the required store details, such as:
- Store name
- Country
- Administrator account information
- Email address
- Password

Choose Installation Options
Select the content and modules you want installed.
For this installation, choose:
- Demo products
- All available modules

Enter Database Information
Enter the database details created earlier:
- Database Name: prestadb
- Database User: prestauser
- Database Password: Your chosen password
- Database Host: localhost

Start Installation
After validating the settings, start the installation process. The installer will configure the database, create tables, and finalize the store setup automatically.

Access the Admin Dashboard
Once installation finishes successfully, you’ll be redirected to the PrestaShop administration panel where you can begin managing your online store.

Conclusion
You have successfully installed PrestaShop on Ubuntu 26.04 using Apache, MariaDB, PHP, and Composer. The process included setting up a LAMP stack, creating a database, downloading PrestaShop, configuring Apache virtual hosting, and completing the web-based installation wizard.
Your e-commerce platform is now ready for store customization, product management, and online sales.




