Installing Pimcore on Ubuntu Server

In this tutorial, we will guide you through the steps required to install Pimcore on Ubuntu Server. Pimcore is an open-source digital platform that can manage web content, e-commerce, and digital asset management.

Prerequisites

Before installing Pimcore, make sure you have the following prerequisites:

Step 1: Update System Packages

Before beginning the installation process, it is essential to update the system packages with the latest versions. Use the following command to update and upgrade your system:

sudo apt-get update && sudo apt-get upgrade -y

Step 2: Install Pimcore prerequisites

Before proceeding further, install the required packages on your Ubuntu system. Use the following command to install the Pimcore prerequisites:

sudo apt-get install -y wget gnupg2 apt-transport-https ca-certificates software-properties-common curl zip unzip

Step 3: Install PHP and Required Modules

Pimcore requires PHP 7.3 or higher with multiple extensions enabled. Execute the below commands to install PHP and the necessary modules.

sudo apt-get install -y php7.4 php7.4-common php7.4-cli php7.4-fpm php7.4-gd php7.4-json php7.4-mysql php7.4-readline php7.4-intl php7.4-mbstring php7.4-curl php7.4-xml php7.4-zip libapache2-mod-php7.4 php7.4-apcu

After installing the PHP modules, execute the following command to modify the PHP memory and execution time settings:

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

Increase the memory_limit value to 512M and set the max_execution_time to 600. After modifying the settings, save and close the file.

memory_limit = 512M
max_execution_time = 600

Save and close the file.

Step 4: Install Composer

Composer is a PHP dependency management tool that manages the PHP dependencies for your application. Run the following commands to install Composer.

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

After installing the Composer, navigate to the Pimcore installation directory with the following command:

cd /var/www/html/

Step 5: Download and Install Pimcore

Next, download the latest stable version of the Pimcore using the following command:

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

After downloading the Pimcore package, extract the downloaded file into your web server document root directory with the following command:

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

After extracting the Pimcore file, navigate to the Pimcore directory with the following command:

cd /var/www/html/pimcore-6.9.x/

Now run this command to install the Pimcore dependencies:

sudo composer install

After running the above commands, change the file and directory permissions:

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

Step 6: Configure Apache/Nginx Web Server

Next, you need to configure Apache or Nginx web server to serve the Pimcore application. In case you are using Apache, create a new virtual host configuration file with the following command:

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

Add the following lines to the configuration file.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/pimcore-6.9.x/web/
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com

    <Directory /var/www/html/pimcore-6.9.x/web>
        AllowOverride All
        Order Allow,Deny
        Allow from All
    </Directory>

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

</VirtualHost>

After creating a virtual host configuration file, enable it with the following command:

sudo a2ensite pimcore.conf

In case you are using Nginx, create a new virtual host configuration file with the following command:

sudo nano /etc/nginx/conf.d/pimcore.conf

Add the following lines to the configuration file.

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    root /var/www/html/pimcore-6.9.x/web;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt  { log_not_found off; access_log off; }
    access_log off;
    error_log  /var/log/nginx/pimcore-6.9.x-error.log error;

    sendfile off;

    client_max_body_size 100m;

    expires off;
}

After creating a virtual host configuration file, test the Nginx configuration with the following command:

sudo nginx -t

If there are no syntax errors, restart the Nginx web server with the following command:

sudo systemctl restart nginx

Step 7: Pimcore Installation Wizard

After configuring the web server, navigate to the Pimcore URL in the web browser.

The Pimcore installation wizard page will open automatically.

Follow the instructions provided by the wizard to complete the Pimcore installation.

Pimcore Installation

Conclusion

In this tutorial, you learned how to install Pimcore on Ubuntu Server, including the configuration of the web server and the installation wizard. You can now use Pimcore to manage your web content, e-commerce, and digital asset management.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!