Step-by-Step Guide to Installing Pimcore CMS on Ubuntu 18.04 LTS

Pimcore is a robust open-source enterprise content management system (CMS) crafted in PHP, leveraging MySQL/MariaDB for its database management. This swift and adaptable platform easily accommodates developers and designers, providing seamless management and distribution of digital assets across various channels. Pimcore also features an intuitive administrative backend, granting users full control over data management and system configurations, and its design is flexible and customizable to suit unique business needs.

This guide will walk you through installing Pimcore CMS on an Ubuntu 18.04 (Bionic Beaver) server.

Prerequisites

  • Ubuntu 18.04 server instance.
  • A non-root user with sudo privileges.

Installing LEMP Stack

Since Pimcore relies on a web server environment, you must install Nginx, PHP, and MariaDB on your system.

Begin by installing Nginx and MariaDB using the following command:

sudo apt-get install nginx mariadb-server -y

After installation, start and enable Nginx and MariaDB services with:

    sudo systemctl start nginx
    sudo systemctl enable nginx
    sudo systemctl start mysql
    sudo systemctl enable mysql

Next, ensure you have the latest PHP and PHP-FPM versions installed. Since Ubuntu 18.04 does not include the latest PHP by default, add the PHP repository:

    sudo apt-get install software-properties-common -y
    sudo add-apt-repository ppa:ondrej/php

Update your repository, then install PHP, PHP-FPM, and required extensions:

    sudo apt-get install php7.1-0 php7.1-fpm php7.1-common php7.1-mbstring php7.1-cli php7.1-zip 
    php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql -y

Edit the php.ini configuration file for necessary adjustments:

sudo nano /etc/php/7.1/fpm/php.ini

Update the following parameters:

    file_uploads = On
    allow_url_fopen = On
    memory_limit = 256M
    upload_max_filesize = 200M
    max_execution_time = 300
    cgi.fix_pathinfo = 0
    date.timezone = Asia/Kolkata

After editing, save your changes and exit the editor.

Configuring MariaDB

First, secure your MariaDB installation by executing:

sudo mysql_secure_installation

Answer the prompts as follows:

    Enter current password for root (enter for none):
    Set root password? [Y/n]: N
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]: Y
    Reload privilege tables now? [Y/n]: Y

Post-security setup, enter the MariaDB shell:

mysql -u root -p

Create the database and user for Pimcore:

    MariaDB [(none)]> CREATE DATABASE pimcoredb;
    MariaDB [(none)]> CREATE USER 'pimcoreuser'@'localhost' IDENTIFIED BY 'password';

Grant privileges and flush them:

    MariaDB [(none)]> GRANT ALL ON pimcoredb.* TO 'pimcoreuser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
    MariaDB [(none)]> FLUSH PRIVILEGES;
    MariaDB [(none)]> EXIT

Installing Pimcore

Download the latest Pimcore version from its official site:

wget https://www.pimcore.org/download/pimcore-latest.zip

Unzip the file to the Nginx web root directory:

    sudo mkdir /var/www/html/pimcore
    sudo unzip pimcore-latest.zip -d /var/www/html/pimcore

Adjust directory permissions:

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

Configuring Nginx for Pimcore

Create an Nginx virtual host file for Pimcore:

sudo nano /etc/nginx/sites-available/pimcore

Include the following configuration:

    server {
        listen 80;
        listen [::]:80;
        root /var/www/html/pimcore;
        index index.php index.html index.htm;
        server_name example.com www.example.com;
      
        client_max_body_size 100M;
      
        location / {
            try_files $uri /app.php$is_args$args;        
        }
      
        location ~ ^/app\.php(/|$) {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            send_timeout 1800;
            fastcgi_read_timeout 1800;
            include fastcgi_params;
        }
    }

Save and close when done.

Activate the virtual host and restart services:

    sudo ln -s /etc/nginx/sites-available/pimcore /etc/nginx/sites-enabled/
    sudo systemctl restart nginx
    sudo /etc/init.d/php7.1-fpm restart

Accessing Pimcore CMS

Browse to http://example.com/install to initiate the Pimcore setup process. You will encounter the installation page:

Pimcore MySQL settings

Input your database information and set your admin credentials before selecting ‘Install Now’. Upon successful installation, log in using your admin credentials.

Upon login, you’ll see the Pimcore dashboard, ready for use:

Pimcore CMS

Frequently Asked Questions (FAQ)

Q: What is Pimcore?\

Pimcore is a free, open-source content management system designed for efficiency in managing digital assets and personalized site configurations.

Q: Why do I need a LEMP stack for Pimcore?\

The LEMP stack provides the necessary server environment for Pimcore’s PHP-based framework and database management.

Q: Can Pimcore be installed on versions of Ubuntu other than 18.04?\

Yes, it can be installed on other versions or distributions, but steps may vary depending on your operating system configuration requirements.

Q: What should I consider before installing Pimcore?\

Ensure all prerequisites are met, such as a suitable server environment (LEMP stack), and have backup protocols in place.