Prestashop Print

  • 0

How to Install PrestaShop on Ubuntu 24.04 LTS

This guide explains how to manually install PrestaShop on a fresh Ubuntu 24.04 LTS server. The steps below perform the same tasks as our automated Ansible installation playbook.

Requirements:

  • Ubuntu 24.04 LTS VPS or dedicated server
  • Root access or a user with sudo privileges
  • A domain name pointing to your server IP address
  • Minimum 2GB RAM recommended

Step 1 - Connect to Your Server

Connect to your Ubuntu server using SSH:


ssh username@your-server-ip

Example:


ssh root@192.168.1.100

Step 2 - Update Ubuntu Packages

First update the Ubuntu package list:


sudo apt update

Upgrade installed packages:


sudo apt upgrade -y

Step 3 - Install Apache Web Server

PrestaShop requires a web server. We will use Apache.


sudo apt install apache2 -y

Start Apache and enable it on boot:


sudo systemctl start apache2

sudo systemctl enable apache2

Step 4 - Install MariaDB Database Server

PrestaShop stores products, customers, orders and settings inside a database.


sudo apt install mariadb-server mariadb-client -y

Enable MariaDB:


sudo systemctl start mariadb

sudo systemctl enable mariadb

Step 5 - Secure MariaDB Installation

Run the MariaDB security wizard:


sudo mysql_secure_installation

Recommended answers:

  • Switch to unix_socket authentication: Yes
  • Remove anonymous users: Yes
  • Disallow root login remotely: Yes
  • Remove test database: Yes
  • Reload privilege tables: Yes

Step 6 - Install PHP 8.3 and Required Extensions

PrestaShop requires PHP and several PHP extensions.


sudo apt install php8.3 \
php8.3-cli \
php8.3-common \
php8.3-mysql \
php8.3-gd \
php8.3-curl \
php8.3-mbstring \
php8.3-xml \
php8.3-zip \
php8.3-intl \
php8.3-bcmath \
php8.3-soap -y

Restart Apache:


sudo systemctl restart apache2

Step 7 - Install Required Tools


sudo apt install unzip curl wget git -y

Step 8 - Create PrestaShop Database

Login to MariaDB:


sudo mysql

Create the database:


CREATE DATABASE prestashop;

Create a database user:


CREATE USER 'prestashop'@'localhost' IDENTIFIED BY 'ChangeThisStrongPassword';

Give database permissions:


GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashop'@'localhost';

Apply changes and exit:


FLUSH PRIVILEGES;

EXIT;

Step 9 - Download PrestaShop

Move to the web directory:


cd /var/www

Download PrestaShop:


sudo wget https://github.com/PrestaShop/PrestaShop/releases/download/8.1.7/prestashop_8.1.7.zip

Create the installation folder:


sudo mkdir prestashop

Extract files:


sudo unzip prestashop_8.1.7.zip -d prestashop

Step 10 - Set File Permissions


sudo chown -R www-data:www-data /var/www/prestashop

sudo chmod -R 755 /var/www/prestashop

Step 11 - Configure Apache Virtual Host

Create a new Apache configuration file:


sudo nano /etc/apache2/sites-available/prestashop.conf

Paste the following:


<VirtualHost *:80>

ServerName your-domain.com

DocumentRoot /var/www/prestashop

<Directory /var/www/prestashop>

AllowOverride All

Require all granted

</Directory>

ErrorLog ${APACHE_LOG_DIR}/prestashop_error.log

CustomLog ${APACHE_LOG_DIR}/prestashop_access.log combined

</VirtualHost>

Save the file:


CTRL + O

ENTER

CTRL + X

Step 12 - Enable Apache Configuration


sudo a2enmod rewrite

sudo a2ensite prestashop.conf

sudo systemctl restart apache2

Step 13 - Configure Firewall

Allow web traffic:


sudo ufw allow 80/tcp

sudo ufw allow 443/tcp

Enable firewall:


sudo ufw enable

Step 14 - Complete Installation in Browser

Open your browser and visit:


http://your-domain.com

During setup enter:

Setting Value
Database Server localhost
Database Name prestashop
Database User prestashop
Database Password Your database password

Step 15 - Verify Services

Check Apache:


sudo systemctl status apache2

Check MariaDB:


sudo systemctl status mariadb

Installation Complete

Your PrestaShop store is now installed and ready to configure. You can login to the administration panel and start adding products, categories, customers and orders.

Tip: For production websites, we recommend installing SSL certificates using Let's Encrypt.


Hasznosnak találta ezt a választ?
Back