UbuntuUbuntu Based

How To Install PimCore on Ubuntu 24.04 LTS

Install PimCore on Ubuntu 24.04

Pimcore is a powerful, open-source platform designed to handle multiple digital experience needs. From Product Information Management (PIM) and Master Data Management (MDM) to Content Management System (CMS) capabilities, Pimcore can streamline the way businesses manage, centralize, and distribute their content. Installing Pimcore on Ubuntu 24.04 LTS can be an excellent choice thanks to the stability of a long-term support release, robust package management system, and wide community support.

In this detailed guide, you will learn how to install and configure Pimcore step by step. We will cover essential prerequisites, necessary software dependencies, web server configuration, database setup, SSL/TLS security, and some troubleshooting tips. By following these instructions, your Pimcore installation should run smoothly, and you will be ready to explore its extensive capabilities for managing product information, digital assets, and more.

Prerequisites for Installing Pimcore

Before proceeding with the Pimcore installation, ensure that you meet the following prerequisites:

System Requirements

  • Operating System: Ubuntu 24.04 LTS (or a compatible Linux distribution).
  • Hardware:
    • Modern multi-core CPU recommended.
    • At least 2 GB of RAM (4 GB or more is recommended).
    • Sufficient disk space (at least 10 GB free).

Software Requirements

  • PHP 8.1 or higher (including extensions like php-fpm, php-mysql, php-intl, php-gd, php-curl, php-mbstring, php-xml, and php-zip).
  • Web Server: Apache or Nginx. Both are popular for hosting Pimcore.
  • Database Server: MariaDB or MySQL (or a compatible variant).
  • Composer: Required for installing Pimcore and managing PHP dependencies.

Environment Setup

  • Update and upgrade your system:
    sudo apt update && sudo apt upgrade -y
    
  • Install essential utilities:
    sudo apt install curl git unzip software-properties-common -y
    
  • Ensure that you have a non-root user with sudo privileges to carry out commands securely.

Step 1: Install Required Software Dependencies

Setting up the right environment is the cornerstone of a successful Pimcore installation. Below, we will cover how to install and configure the necessary components, including a web server, PHP, and a database.

Install a Web Server

Pimcore can run on either Apache or Nginx. Choose one based on your preference:

  • Install Nginx:
    sudo apt install nginx -y
    

    Once installed, manage Nginx using:

    sudo systemctl stop nginx
    sudo systemctl start nginx
    sudo systemctl enable nginx
  • Install Apache:
    sudo apt install apache2 -y
    

    Then manage Apache using:

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

Install PHP and Extensions

  • Add the official PHP repository:
    sudo add-apt-repository ppa:ondrej/php
    sudo apt update
    
  • Install PHP (8.1 or higher) and required extensions:
    sudo apt install php php-cli php-fpm php-mysql php-curl php-gd \
    php-intl php-mbstring php-xml php-zip -y
    
  • Increase the memory_limit in php.ini (usually found in /etc/php/8.1/fpm/php.ini or /etc/php/8.1/apache2/php.ini):
    memory_limit = 512M
    

Install and Secure the Database Server

You can install either MariaDB or MySQL. The following steps use MariaDB:

sudo apt install mariadb-server -y

After installation, enable and start the database server:

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

Secure your database server by running:

sudo mysql_secure_installation

Follow the prompts to set a root password, remove anonymous users, disable remote root login, and remove test databases. This step helps maintain the overall security of your Pimcore environment.

Step 2: Configure Database for Pimcore

Next, create a dedicated database and user for Pimcore. This isolates Pimcore’s data, simplifying maintenance and ensuring stronger access control.

  1. Log into MariaDB (or MySQL) as root:
    sudo mariadb
    
  2. Create a database and user:
    CREATE DATABASE pimcoredb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
    CREATE USER 'pimcoredbuser'@'localhost' IDENTIFIED BY 'strongpassword';
    GRANT ALL PRIVILEGES ON pimcoredb.* TO 'pimcoredbuser'@'localhost';
    FLUSH PRIVILEGES;
    
  3. Exit the database console:
    exit;
    

Having a separate database specifically for Pimcore helps prevent potential conflicts with other applications and ensures an organized data structure.

Step 3: Download and Set Up Pimcore Files

Pimcore relies on Composer for its installation and updates. Whether you choose a demo package or a skeleton setup, Composer eases dependency management and keeps your Pimcore instance efficient.

Install Composer

To download and install Composer system-wide, run:

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

Download Pimcore via Composer

Navigate to your web server’s document root or a preferred directory. Replace /var/www with your own web directory if needed:

cd /var/www/

You have two main options:

  • Install Pimcore with demo content (ideal for learning):
    sudo COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/demo pimcore
    
  • Install Pimcore skeleton (no demo content):
    sudo COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton pimcore
    

Assign Permissions to Pimcore Files

sudo chown www-data:www-data -R /var/www/pimcore/
sudo chmod -R 755 /var/www/pimcore/

This ensures that the web server (user: www-data) can handle the files correctly, a critical step to avoid permission-related issues.

Step 4: Run the Pimcore Installer

After downloading the Pimcore files, proceed with the interactive installation to link your database, set up your administrator account, and configure basic project settings.

  1. Navigate to the Pimcore directory:
    cd /var/www/pimcore/
    
  2. Start the installer using the www-data user:
    sudo -u www-data ./vendor/bin/pimcore-install
    
  3. You will be asked for:
    • Admin username and password
    • Database credentials (database name, user, password)

The installer will run and create the necessary tables and default configurations. Keep an eye on the console messages: once you see the success message, Pimcore is officially installed.

Step 5: Configure the Web Server

For Pimcore to work seamlessly, you need a proper configuration for your chosen web server. Below are guidelines for both Nginx and Apache.

Configuring Nginx

  1. Create a new server block file:
    sudo nano /etc/nginx/sites-available/pimcore.conf
    
  2. Add a configuration similar to the following:
    server {
        listen 80;
        server_name your-domain.com;
        root /var/www/pimcore/public;
        index index.php;
    
        location / {
            try_files $uri /index.php$is_args$args;
        }
    
        location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php8.1-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    
        location ~ /\.ht {
            deny all;
        }
    }
    
  3. Enable the configuration and test Nginx:
    sudo ln -s /etc/nginx/sites-available/pimcore.conf /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl restart nginx
    

Configuring Apache

  1. Install and enable required modules:
    sudo a2enmod rewrite
    sudo a2enmod ssl
    
  2. Create a virtual host file:
    sudo nano /etc/apache2/sites-available/pimcore.conf
    
  3. Add content similar to:
    <VirtualHost *:80>
        ServerName your-domain.com
        DocumentRoot /var/www/pimcore/public
    
        <Directory /var/www/pimcore/public>
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/pimcore_error.log
        CustomLog ${APACHE_LOG_DIR}/pimcore_access.log combined
    </VirtualHost>
    
  4. Enable the site and restart Apache:
    sudo a2ensite pimcore.conf
    sudo systemctl restart apache2
    

At this point, your Pimcore installation should be accessible on http://your-domain.com. Verify that all configurations were applied correctly by loading the Pimcore front page in your browser.

Step 6: Secure Installation with SSL/TLS

Protecting user data and establishing trust is crucial. Securing Pimcore with an SSL certificate enables HTTPS, encrypting communications. Let’s Encrypt provides free SSL certificates that can be automatically renewed.

  • Install Certbot:
    # For Nginx:
    sudo apt install certbot python3-certbot-nginx
    
    # Or for Apache:
    sudo apt install certbot python3-certbot-apache
    
  • Obtain the certificate:
    # For Nginx:
    sudo certbot --nginx -d your-domain.com
    
    # For Apache:
    sudo certbot --apache -d your-domain.com
    
  • Follow the prompts for email address and agree to Let’s Encrypt’s terms. Certbot will automatically configure your web server to redirect HTTP to HTTPS.

Step 7: Access and Use Pimcore

After completing the configuration steps and securing your installation, you can access your Pimcore environment using:

https://your-domain.com/admin
  • Log in with the administrator credentials chosen during the installation process.
  • Explore Pimcore’s interface to create, edit, and manage product information, digital assets, or other content.

You can also customize design templates, integrate third-party services, and configure multiple sites within the Pimcore admin panel.

Troubleshooting Common Issues

While Pimcore is well-documented and user-friendly, you may encounter a few hiccups. Below are some common issues and troubleshooting tips:

1. Blank Page or 500 Internal Server Error

  • Check your PHP error log and web server logs in /var/log/nginx or /var/log/apache2. Look for PHP compatibility or syntax errors.
  • Ensure php-fpm is running (for Nginx) or Apache’s PHP module is enabled (for Apache).
  • Verify file ownership and permissions (www-data user and group are recommended).

2. Database Connection Failures

  • Review the .env file or pimcore_install.json (depending on your version) to confirm the correct database host, username, and password.
  • Check if the MariaDB service is running properly:
    sudo systemctl status mariadb
    
  • Ensure the database credentials match those created in Step 2.

3. PHP Memory Limit Exhausted

  • Increase memory_limit in php.ini to at least 512M or higher if necessary.
  • Confirm changes by running:
    php -i | grep memory_limit
    

4. Missing or Incomplete Installation

  • Rerun the Pimcore installer if you encounter incomplete setup:
    sudo -u www-data ./vendor/bin/pimcore-install
    
  • Check the install logs inside var/installer/log for details on installation errors.

5. Permission Denied Errors

  • Ensure the pimcore/var and pimcore/public/var directories have the correct ownership and permissions to allow write access.
  • Run:
    sudo chown -R www-data:www-data /var/www/pimcore
    sudo chmod -R 755 /var/www/pimcore
    

Congratulations! You have successfully installed Pimcore. Thanks for using this tutorial for installing Pimcore on your Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Pimcore website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button