Installing Pimcore

How Can We Help?
< Back
You are here:
Print

Requirements

This guide assumes that you already have the following set up prior to following these instructions:

To easily set up the above requirements on a fresh server, use our ols1clk script with the --pure-mariadb option.

For more specific requirements for Pimcore please see Pimcore’s documentation.

Installation

Installing Composer

The easiest way to install Pimcore is from your SSH terminal using Composer. If you don’t have Composer, you can install it like so:

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

Create Pimcore Project

We will use /var/www/html as our project location example.

cd /var/www/

Pimcore offers two different installation packages: a demo package with example blueprints, and an empty skeleton package for experienced developers.

If you are experienced, create a project with the Skeleton Package:

COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton html

Otherwise, create a project with the Demo Package:

COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/demo html

For more information, please see Pimcore’s official guide.

Install Pimcore

Log in to the project folder and run the pimcore-install command. During the installation, it will ask you to input some necessary values like admin password, database password, etc.

 cd html
 ./vendor/bin/pimcore-install

For advanced installation commands, see Pimcore’s official guide.

Configure permissions

By default OpenLiteSpeed web server runs with www-data:www-data permissions, so apply the same permissions to the project, like so:

chown -R www-data:www-data /var/www/html

Configure Virtual Host Document Root

Since the Pimcore documents are under the public folder, update the virtual host’s document root to /var/www/html/public/.

Add .htaccess file

If there is no .htaccess file, add one and insert the following content:

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

# ASSETS: check if request method is GET (because of WebDAV) and if the requested file (asset) exists on the filesystem, if both match, deliver the asset directly
RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)
RewriteCond %{DOCUMENT_ROOT}/var/assets%{REQUEST_URI} -f
RewriteRule ^(.*)$ /var/assets%{REQUEST_URI} [PT,L]

# Thumbnails
RewriteCond %{REQUEST_URI} .*/(image|video)-thumb__[\d]+__.*
RewriteCond %{DOCUMENT_ROOT}/var/tmp/thumbnails%{REQUEST_URI} -f
RewriteRule ^(.*)$ /var/tmp/thumbnails%{REQUEST_URI} [PT,L]

RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)
RewriteCond %{QUERY_STRING}   !(pimcore_editmode=true|pimcore_preview|pimcore_version)
RewriteCond %{DOCUMENT_ROOT}/var/tmp/pages%{ENV:STATIC_PAGE_URI}e.html -f
RewriteRule .* /var/tmp/pages%{ENV:STATIC_PAGE_URI}e.html [L]

# cache-buster rule for scripts & stylesheets embedded using view helpers
RewriteRule ^cache-buster\-[\d]+/(.*) $1 [PT,L]

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# Rewrite all other queries to the front controller.
RewriteRule ^ %{ENV:BASE}/index.php [L]

Restart OpenLiteSpeed

Now that Pimcore is installed and set up, we need to restart OpenLiteSpeed so it can reload the configuration and .htaccess file. This can be done by running the following command:

systemctl restart lsws

Finished!

That’s it! Navigate to your site in a browser. You should see the following:

To access the Pimcore backend admin page, visit the admin page at http://example.com/admin

Tags: