How to install Pimcore on Ubuntu

install-pimcore-on-an-ubuntu-vpsIn this tutorial, we will show you how to install Pimcore on an Ubuntu 14.04 VPS with PHP-FPM and Nginx. Pimcore is an open source, content and product management framework. It is fast, flexible, and designer and developer-friendly. This guide should work on other Linux VPS systems as well but was tested and written for an Ubuntu 14.04 VPS.

Login to your VPS via SSH

ssh [email protected]_IP

Update the system and install necessary packages

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install software-properties-common nano wget

Install MariaDB 10.1

To add the MariaDB repository to your sources list and install the latest MariaDB server, run the following commands:

[user]$ sudo apt-key adv --recv-keys --keyserver hkp:// 0xcbcb082a1bb943db
[user]$ sudo add-apt-repository 'deb trusty main'
[user]$ sudo apt-get update
[user]$ sudo apt-get install -y mariadb-server

When the installation is complete, run the following command to secure your installation:

[user]$ mysql_secure_installation

Next, we need to create a database for the Pimcore installation.

[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE pimcore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON pimcore.* TO 'pimcore'@'localhost' IDENTIFIED BY 'strong_password';
MariaDB [(none)]> \q

Install and configure PHP

To install the latest stable version of PHP version 5.6 and all necessary modules, run:

[user]$ sudo add-apt-repository -y ppa:ondrej/php5-5.6
[user]$ sudo apt-get update
[user]$ sudo apt-get -y install php5-fpm php5-cli php5-json php5-curl php5-gd php5-mysqlnd php5-mcrypt

Create a new PHP-FPM pool for your user:

[user]$ sudo nano /etc/php5/fpm/pool.d/your_user.conf
user = your_user
group = your_user
listen = /var/run/php-fpm-your_user.sock
listen.owner = your_user = your_user
listen.mode = 0666
pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
pm.max_requests = 200
chdir = /

Do not forget to change your_user with your username.
Restart PHP-FPM:

[user]$ sudo service php5-fpm restart

Install Pimcore

Create a root directory for your Pimcore installation using the following command:

[user]$ mkdir -p ~/

Change to the directory:

[user]$ cd  ~/

Download the latest release using wget:

[user]$ wget

Extract the zip file in document root

[user]$ unzip

Install and configure Nginx

Ubuntu 14.04 comes with Nginx version 1.4, to install the latest stable version of Nginx version 1.8, run:

[user]$ sudo add-apt-repository -y ppa:nginx/stable
[user]$ sudo apt-get update
[user]$ sudo apt-get -y install nginx

Next, create a new Nginx server block:

[user]$ sudo nano /etc/nginx/sites-available/
server {
    listen 80;
    root /home/your_user/;
    index index.php;

    access_log  /var/log/nginx/pimcore.access.log;
    error_log   /var/log/nginx/pimcore.error.log;

    set $getassets "";
    if ($uri ~* ^/website/var/assets)   { set $getassets "${getassets}A"; }
    if ($request_method = GET)      { set $getassets "${getassets}B"; }
    if ($getassets = "AB") {
        rewrite ^ $uri$args last;

    location ~* ^(/plugins/(?!.*/static).*|^/pimcore/(?!(static|modules/3rdparty)).*|/website/var/(?!tmp|assets|areas)|^.*modules/.*/static.*|^(vendor|tests|node_modules|phing)/.*|^(bower|package|composer|gulpfile)\.) {
        return 403;

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

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php-fpm-your_user.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;

    location ~* \.(jpe?g|gif|png|bmp|ico|css|js|pdf|zip|htm|html|docx?|xlsx?|pptx?|txt|wav|swf|avi|mp\d)$ {
        access_log off;
        log_not_found off;
        try_files $uri $uri/ /website/var/assets$uri /index.php?$args;
        expires 1w;

    location ~ /\.ht {
        deny all;

Do not forget to change your_user with your username.

Activate the server block by creating a symbolic link :

[user]$ sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Test the Nginx configuration and restart the service:

[user]$ sudo nginx -t
[user]$ sudo service nginx restart

Open in your favorite web browser and you should see the Pimcore install screen. On this page you’ll need to enter the database details you created earlier, Pimcore admin details and click on the Install now button.

That’s it. You have successfully installed Pimcore on your Ubuntu 14.04 VPS. For more information about how to manage your Pimcore installation, please refer to the official Pimcore documentation.

Leave a Reply