How to install Pimcore with Apache on Ubuntu 24.04

This article outlines the steps to install Pimcore software on Ubuntu 24.04 using Apache. It details the installation of necessary components like Apache, MariaDB, and PHP, and guides the user through creating a database, configuring Pimcore files, setting up a virtual host, and implementing SSL/TLS for security.

This article explains installing Pimcore software with Apache on Ubuntu 24.04.

Pimcore platform combines Product Information Management (PIM), Master Data Management (MDM), Content management (CMS), and eCommerce.

It is designed to allow businesses and enterprises to collaborate and automate engaging customer experiences. Ubuntu Linux with Apache support provides a reliable and scalable environment to host Pimcore.

Installing Pimcore on Ubuntu Linux with Apache support provides businesses a robust and secure platform to manage their product information, master data, and eCommerce needs.

The community edition or open-source version is available to install for free. However, to get it, you must register for the download link to your email.

Install Apache HTTP server on Ubuntu

Pimcore requires a web server. This post will install and use the Apache web server to run Pimcore.

To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.

sudo apt update
sudo apt install apache2

Once Apache is installed, the commands below can start, stop, and enable the Apache web server to start automatically when your server boots up.

sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

You can test that the Apache web server is running by opening your web browser and browsing to the server’s localhost or IP address.

http://localhost

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed.

Additional help on installing Apache on Ubuntu is in the link below.

How to install Apache on Ubuntu

Install the MariaDB database server on Ubuntu

The next component required to run Pimcore is a database server. This post will install and use the MariaDB database server.

To install and use the MariaDB database server, use the instructions below.

Open the Ubuntu terminal and run the commands below to install the MariaDB database server.

sudo apt update
sudo apt install mariadb-server

Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.

sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to validate and test if the MariaDB database server is installed successfully.

sudo mariadb

Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.

Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you that the server is installed successfully.

Additional help on installing MariaDB.

Create a Pimcore database

Upon successfully installing the MariaDB database server, create a blank database on the server specifically for the Pimcore application.

As part of the setup, we will create a pimcoredb database and a user account called pimcoredbuser.

Finally, we’ll grant the pimcoredbuser full access to the pimcoredb database.

All the database steps above can be done using the commands below:

But first, log on to the MariaDB database server:

sudo mariadb

Then run the commands below to complete the steps:

CREATE DATABASE pimcoredb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER pimcoredbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON pimcoredb.* TO pimcoredbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

Ensure to replace ‘type_your_password_here ‘with your password.

Install PHP on Ubuntu Linux

The last component you will need to run Pimcore is PHP. The Pimcore application is PHP-based and supports the latest versions of PHP.

Then, run the commands below to install the latest PHP version.

sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip

Additional help on installing PHP

How to install PHP on Ubuntu Linux

Get Pimcore files

Let’s start downloading and configuring the Pimcore files on Ubuntu Linux.

There are multiple ways to get Pimcore installed. For the free community version, the composer installer is the right choice.

First, install git, Composer, and other dependencies.

sudo apt install curl git
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Next, change to the Apache web server directory and clone Pimcore files. The last command allows the Apache web server to interact safely with the files, ensuring a secure environment for your Pimcore installation.

cd /var/www/
sudo COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/demo pimcore
sudo chown www-data:www-data -R /var/www/pimcore/

Alternatively, install the skeleton copy if you do not want to install Pimcore with demo content.

sudo COMPOSER_MEMORY_LIMIT=-1 composer --ignore-platform-req=ext-amqp create-project pimcore/skeleton pimcore

After that, run the command below to install Pimcore.

cd /var/www/pimcore
sudo -u www-data ./vendor/bin/pimcore-install

Once you have completed all the above steps, continue configuring the Apache web server below to serve the Pimcore content.

You will be prompted to create an admin account, type the database and account created above to complete the installation.

Admin username:
> superadmin

Admin password (input will be hidden):
>

MySQL username:
> pimcoredbuser

MySQL password (input will be hidden):
>

MySQL database:
> pimcoredb

This will install Pimcore with the given settings. Do you want to continue? (yes/no) [yes]:
>

Running installation. You can find a detailed install log in var/installer/log/dev.log

Install complete!

11/11 [============================] 100%

Trying to install assets as relative symbolic links.

--- ------------------------------------------ ------------------
Bundle Method / Error
--- ------------------------------------------ ------------------
✔ FOSJsRoutingBundle relative symlink
✔ PimcoreAdminBundle relative symlink
✔ PimcoreCustomReportsBundle relative symlink
✔ PimcorePersonalizationBundle relative symlink
✔ PimcoreEcommerceFrameworkBundle relative symlink
✔ PimcoreApplicationLoggerBundle relative symlink
✔ PimcoreGoogleMarketingBundle relative symlink
✔ PimcoreCustomerManagementFrameworkBundle relative symlink
✔ PimcoreNewsletterBundle relative symlink
✔ PimcoreGlossaryBundle relative symlink
✔ PimcoreSeoBundle relative symlink
✔ PimcoreSimpleBackendSearchBundle relative symlink
✔ PimcoreDataHubBundle relative symlink
✔ OutputDataConfigToolkitBundle relative symlink
✔ Web2PrintToolsBundle relative symlink
✔ ObjectMergerBundle relative symlink
✔ PimcoreWebToPrintBundle relative symlink
✔ PimcoreTinymceBundle relative symlink
✔ PimcoreStaticRoutesBundle relative symlink
✔ PimcoreWordExportBundle relative symlink
✔ PimcoreXliffBundle relative symlink
✔ PimcoreCoreBundle relative symlink
--- ------------------------------------------ ------------------
[OK] All assets were successfully installed.
[OK] Pimcore was successfully installed

Next, create a .htaccess file for Apache rewrite.

sudo -u www-data nano /var/www/pimcore/public/.htaccess

Then, copy the content from the below link into the file and save it.

.htaccess file for Pimcore

After Pimcore installation, continue below to set up Apache to serve Pimcore’s content.

Run the commands below to create an Apache virtual host file for Pimcore.

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

Then, copy and paste the content block below into the Apache server block.

<VirtualHost *:80>
ServerName pimcore.example.com
ServerAlias www.pimcore.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/pimcore/public

<Directory /var/www/pimcore/public/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save the file.

Then, run the commands below to enable the virtual host and restart the Apache server.

sudo a2ensite pimcore.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

Setup Let’s Encrypt SSL/TLS for Pimcore

You may want to install an SSL/TLS certificate to secure your Pimcore site. Secure your Pimcore installation with HTTPS from Let’s Encrypt.

Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.

How to set up Let’s Encrypt SSL certificate for Apache on Ubuntu Linux

Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block.

http://pimcore.example.com/

A Pimcore web portal page should appear.

To log on to the backend admin page, use the URL below.

http://pimcore.example.com/admin

That should do it!

Conclusion:

In summary, installing Pimcore on Ubuntu with Apache involves several key steps:

  • Setup Environment: Ensure you have a proper Apache, MariaDB, and PHP environment installed.
  • Database Configuration: Create a database specifically for Pimcore and a user account to access it.
  • Download Pimcore: Use Composer to download the Pimcore files and set the correct permissions for your Apache server.
  • Installation Process: Follow the prompts to install Pimcore, input the database details, and set up an admin account.
  • Configure Apache: Create a virtual host configuration and enable the necessary modules for proper URL handling.
  • Implement SSL/TLS: Secure your Pimcore installation using an SSL certificate from Let’s Encrypt to enable HTTPS.
  • Access Pimcore: Open your browser and navigate to your Pimcore installation to use the platform.

Following these steps, you can successfully set up a robust and secure Pimcore environment to enhance your business’s data management and eCommerce capabilities.

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *