How to Install PrestaShop 9 on AlmaLinux 9 or Rocky Linux 9
Set up a PrestaShop 9 store on AlmaLinux 9 or Rocky Linux 9 with Apache, PHP 8.3 and MariaDB, including SELinux, the installer and post-install clean-up.
This guide installs PrestaShop 9, the current major version of the open-source e-commerce platform, on AlmaLinux 9 or Rocky Linux 9 with Apache, PHP 8.3 (PHP-FPM) and MariaDB. At the end you have a working store, a back office behind a private admin URL, and a server prepared for HTTPS. The same steps apply to CentOS Stream 9 and RHEL 9.
CentOS 7 reached end of life on 30 June 2024 and its PHP 5.4 cannot run any supported PrestaShop release, so a new store belongs on an Enterprise Linux 9 system.
Requirements
- A server running AlmaLinux 9 or Rocky Linux 9 (release 9.6 or later for the PHP 8.3 module), with a non-root user that has
sudorights. The examples usedeploy. - A domain name pointing to the server. The examples use
example.comand the address203.0.113.10. - At least 512 MB of memory available to PHP; the PrestaShop documentation sets
memory_limitto a minimum of512M.
According to the PrestaShop 9 system requirements, the platform needs PHP 8.1 or newer, Apache 2.4 (or Nginx), and MySQL 5.7+ or MariaDB 10.2+. Required PHP extensions are curl, dom, fileinfo, gd, iconv, intl, json, mbstring, openssl, pdo_mysql, simplexml and zip. Enterprise Linux 9 installs PHP 8.0 by default, which is too old, so you will enable a newer module stream.
Step 1: Install Apache, PHP 8.3 and MariaDB
Update the system, then install PHP from the 8.3 module stream together with the web server, the database server and the extensions PrestaShop needs:
sudo dnf update -y
sudo dnf module install -y php:8.3
sudo dnf install -y httpd mariadb-server php-mysqlnd php-gd php-intl php-mbstring php-xml php-zip php-opcache unzip policycoreutils-python-utilsOn Enterprise Linux 9, Apache runs PHP through PHP-FPM. Start and enable the three services:
sudo systemctl enable --now httpd php-fpm mariadbConfirm the PHP version and that the required extensions are loaded:
php -v
php -m | grep -Ei 'curl|dom|fileinfo|gd|iconv|intl|mbstring|openssl|pdo_mysql|simplexml|zip'Open the web ports in firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reloadStep 2: Set the PHP options PrestaShop expects
Create a small override file instead of editing /etc/php.ini:
sudo tee /etc/php.d/90-prestashop.ini > /dev/null <<'EOF'
memory_limit = 512M
allow_url_fopen = On
allow_url_include = Off
EOF
sudo systemctl restart php-fpmallow_url_fopen must stay on: PrestaShop uses it to reach remote services such as payment providers and the module catalogue.
Step 3: Create the database
Secure the fresh MariaDB installation, then open a database shell as root:
sudo mariadb-secure-installation
sudo mariadbCreate a database with 4-byte UTF-8 encoding and a dedicated user. Replace the password with a strong one of your own:
CREATE DATABASE prestashop COLLATE utf8mb4_general_ci;
CREATE USER 'prestashopuser'@'localhost' IDENTIFIED BY 'change-this-password';
GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashopuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;Step 4: Download and unpack PrestaShop
Starting with version 9, the ready-to-install release package is distributed only from the PrestaShop website (the "Classic" edition download, behind a short form); the files on GitHub are source archives that still need Composer and an asset build. Download the zip on your own computer and copy it to the server:
scp prestashop_edition_classic_version_*.zip deploy@203.0.113.10:/tmp/The package contains an inner prestashop.zip with the application, an index.php that can unpack it from the browser, and Install_PrestaShop.html, which must not be uploaded to a web root. On a VPS it is simpler to unpack the inner archive yourself:
cd /tmp
unzip -q prestashop_edition_classic_version_*.zip -d /tmp/ps-package
sudo mkdir -p /var/www/prestashop
sudo unzip -q /tmp/ps-package/prestashop.zip -d /var/www/prestashop
sudo chown -R apache:apache /var/www/prestashopSELinux is enforcing by default and blocks PHP from writing to the web root. Label the store directory as writable web content and allow PHP to open outgoing connections:
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/prestashop(/.*)?"
sudo restorecon -R /var/www/prestashop
sudo setsebool -P httpd_can_network_connect 1Step 5: Configure the Apache virtual host
PrestaShop writes its URL rewriting rules to an .htaccess file, so the directory needs AllowOverride All. Create /etc/httpd/conf.d/prestashop.conf:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/prestashop
<Directory /var/www/prestashop>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/prestashop_error.log
CustomLog /var/log/httpd/prestashop_access.log combined
</VirtualHost>Test the configuration and reload Apache:
sudo apachectl configtest
sudo systemctl reload httpdStep 6: Run the installer
You can use the browser or the command line.
Browser installer
Open http://example.com/install. The assistant walks through language, licence agreement, a system compatibility check (skipped when everything passes), store information with the administrator account, store content (theme, modules, demo products), and finally the database settings. Enter localhost, the database name prestashop, the user prestashopuser and its password, test the connection, and start the installation.
Command-line installer
The same installer runs from the shell, which is handy for repeatable deployments:
cd /var/www/prestashop/install
sudo -u apache php index_cli.php \
--domain=example.com \
--db_server=localhost \
--db_name=prestashop \
--db_user=prestashopuser \
--db_password='change-this-password' \
--prefix=shop_ \
--name='Example Store' \
--country=us \
--timezone=America/New_York \
--firstname=Jane \
--lastname=Doe \
--email=admin@example.com \
--password='a-long-admin-password' \
--fixtures=0--fixtures=0 skips the demo products; omit it if you want sample data. Run php index_cli.php without arguments to list every option. The installer prints -- Installation successful! -- when it finishes.
Step 7: Post-install checks
PrestaShop 9.2 removes the install directory automatically after a successful installation. Confirm that it is gone, and delete it yourself if it is still there, because the back office refuses to open while it exists:
ls -d /var/www/prestashop/install 2>/dev/null && sudo rm -rf /var/www/prestashop/installThe back office lives in a folder with a private name. Find it with:
ls -d /var/www/prestashop/admin*If the folder is still called plain admin, rename it to something hard to guess, then log in at http://example.com/<that-folder-name>/ with the administrator e-mail and password you chose:
sudo mv /var/www/prestashop/admin /var/www/prestashop/admin-k4x9q2z7Do not take real orders over plain HTTP. Obtain a TLS certificate for example.com (for example with Certbot), add the HTTPS virtual host, and then switch on SSL for the whole shop in the back office under Shop Parameters > General.
Troubleshooting
- The installer reports folders that are not writable: check ownership (
apache:apache) and the SELinux label withls -Zd /var/www/prestashop/var. Denials are logged in/var/log/audit/audit.log. - Product or category pages return 404 while the home page works: the
.htaccessfile is not being read. CheckAllowOverride Allin the virtual host. - Blank page or error 500: read
/var/log/httpd/prestashop_error.log,/var/log/php-fpm/www-error.logand the files under/var/www/prestashop/var/logs.
Frequently asked questions
Which PrestaShop version should I install?
Install the newest 9.x release for a new store; 9.2.1 was the latest in November 2026. The 8.2 branch still receives maintenance releases, which matters mainly if a module or theme you depend on has not been updated for version 9 yet.
Can I use the PHP 8.0 that AlmaLinux 9 installs by default?
No. PrestaShop 9 requires PHP 8.1 or newer, so enable a newer module stream before installing any PHP package. If another stream is already active, switch with sudo dnf module switch-to php:8.3.
Why does the download come from the PrestaShop website and not GitHub?
Since PrestaShop 9.0 the project publishes a single release zip through the PrestaShop website. The GitHub repository only offers the source tree, which you would have to build yourself with Composer and Node.js before it can be installed.
Can PrestaShop run on Nginx instead of Apache?
Yes, Nginx is supported, but it ignores .htaccess, so the rewrite rules have to be written into the server block by hand. The PrestaShop developer documentation has a dedicated Nginx page.