Skip to content
Follow
CMS

How to Install Pimcore with Nginx on Ubuntu 24.04

Richard
Written by
Richard
Updated 9 min read
How to install Pimcore with Nginx on Ubuntu 24.04
How to install Pimcore with Nginx on Ubuntu 24.04

Installing Pimcore with Nginx on Ubuntu 24.04 gives you a fast web server for managing product data and digital shops. Pimcore is a free software platform that brings your business content and customer files together in one dashboard.

Advertisement

Ubuntu 24.04 LTS is a stable base, and Nginx handles incoming web traffic quickly. The stack has four parts: Nginx, MariaDB, PHP and Pimcore itself, installed with Composer. You need root or sudo access to the server and a terminal window. A domain name pointed at the server is optional, but you need one if you want a Let’s Encrypt certificate at the end.

⚡ Quick Answer

Install Pimcore with Nginx on Ubuntu 24.04 by running sudo apt update, then sudo apt install nginx, then sudo apt install mariadb-server, and starting each service with sudo systemctl start and sudo systemctl enable. Then create a MariaDB database and user for Pimcore before installing Pimcore itself with Composer.

Advertisement

Install Nginx HTTP server on Ubuntu

Nginx serves Pimcore pages to visitors, so it has to be installed before Pimcore. Update your package list first, then install Nginx with the package manager. Use the commands in the code block below.

Follow these steps to install the Nginx web server.

  1. Open the Ubuntu terminal.
  2. Run the commands below. They refresh the package list and install Nginx. If the terminal asks for confirmation, type Y and press Enter.
Advertisement
🐧Bash / Shell
sudo apt update
sudo apt install nginx

Once Nginx is installed, use the commands below to start it, stop it, and enable it so it starts automatically when the server boots.

  1. Run the start command. Nginx begins serving the default page.
  2. Run the enable command so Nginx comes back after a reboot.
  3. Use the stop command only when you need to take the web server offline. Start it again afterwards.
🐧Bash / Shell
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl enable nginx

To test Nginx, open a web browser and browse to the server’s localhost or IP address. If you are working on the server itself, use localhost. If it is a remote machine, use its IP address.

http://localhost

Advertisement
Default Nginx welcome page confirming successful installation on Ubuntu 24.04
Default Nginx welcome page confirming successful installation on Ubuntu 24.04
📝Good to KnowWhen you see Welcome to nginx!, the Nginx HTTP server is installed and working.

If the page does not load, check that the service is running. If the server sits behind a firewall, make sure port 80 is open.

Additional help on installing Nginx on Ubuntu is in the link below.

How to install Nginx on Ubuntu

Install the MariaDB database server on Ubuntu

MariaDB stores the text, settings and user data for your Pimcore site. Install it on Ubuntu before you install Pimcore, because the Pimcore installer needs a working database. Update the package list, then install the database server from the terminal.

Advertisement

To install and use the MariaDB database server, use the instructions below.

Open the Ubuntu terminal and run the commands below to install the MariaDB database server.

🐧Bash / Shell
sudo apt update
sudo apt install mariadb-server

Once MariaDB is installed, use the commands below to stop, start and enable it so it starts automatically at boot. On Ubuntu the service often starts by itself after installation, so the start command is mainly useful after a stop.

🐧Bash / Shell
sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to check that MariaDB installed correctly.

Advertisement
🐧Bash / Shell
sudo mariadb

These commands log you onto the MariaDB console and show a message similar to the one below. If you get a permission error instead, make sure you ran the command with sudo.

💻Code
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you the server is installed and running. Type exit to leave the console if you are not continuing straight to the next section.

Additional help on installing MariaDB.

Advertisement

Create a Pimcore database

Pimcore needs its own database so it can read and write its data without touching anything else on the server. You create it by logging into MariaDB, adding a new database, and creating a user account with full access to that database only.

In this guide we create a database called pimcoredb and a user account called pimcoredbuser.

Finally, we grant pimcoredbuser full access to the pimcoredb database.

All of these database steps use the commands below.

Advertisement

First, log on to the MariaDB database server:

🐧Bash / Shell
sudo mariadb

Then run the commands below to create the database, the user and the permissions. Each command should answer with a short confirmation such as "Query OK".

💻Code
CREATE DATABASE pimcoredb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER pimcoredbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON pimcoredb.* TO pimcoredbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

Replace type_your_password_here with a strong password of your own, and keep it. The Pimcore installer asks for the database name, user and password later.

Install PHP on Ubuntu Linux

PHP runs the code that makes Pimcore work. Install PHP on Ubuntu together with the extensions Pimcore needs and PHP-FPM, which is how Nginx hands PHP requests to PHP. Ubuntu 24.04 ships PHP 8.3 in its default repositories.

Run the commands below to install PHP and its extensions.

🐧Bash / Shell
sudo apt install php-fpm php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip

Additional help on installing PHP:

How to install PHP on Ubuntu Linux

Get Pimcore files

Composer downloads and sets up the core application files for Pimcore. You get the files onto your server by installing Git and Composer, then running the package installation command.

There are several ways to install Pimcore. For the free community version, the Composer installer is the right choice.

First, install Git, Composer and the other dependencies.

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

Next, change to the Nginx web directory and download the Pimcore files. The last command in the block gives the Nginx web server ownership of the files. Nginx can then read and write them, and nothing else on the system needs access. Run the commands in order and wait for Composer to finish. The download is large and can take a few minutes.

⬛Command Prompt
cd /var/www/
sudo COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/demo pimcore
sudo chown www-data:www-data -R /var/www/pimcore/
📝Note

Alternatively, install the skeleton copy if you do not want Pimcore with demo content. Use the skeleton for a real project. Use the demo only if you want sample data to explore.

🐧Bash / Shell
sudo COMPOSER_MEMORY_LIMIT=-1 composer --ignore-platform-req=ext-amqp create-project pimcore/skeleton pimcore

After that, run the command below to install Pimcore.

⬛Command Prompt
cd /var/www/pimcore
sudo -u www-data ./vendor/bin/pimcore-install

Once you have finished the steps above, configure Nginx to serve the Pimcore content, as shown below.

The installer prompts you to create an admin account. Enter an admin username and password of your choice. When it asks for database details, enter the database name, user and password you created earlier (pimcoredb, pimcoredbuser and the password you set).

💻Code
Admin username:
> superadmin

Admin password (input will be hidden):
>

MySQL username:
> pimcoredbuser

MySQL password (input will be hidden):
>

MySQL database:
> pimcoredb

This will install Pimcore with the given settings. Do you want to continue? (yes/no) [yes]:
>

Running installation. You can find a detailed install log in var/installer/log/dev.log

Install complete!

11/11 [============================] 100%

Trying to install assets as relative symbolic links.

--- ------------------------------------------ ------------------
Bundle Method / Error
--- ------------------------------------------ ------------------
✔ FOSJsRoutingBundle relative symlink
✔ PimcoreAdminBundle relative symlink
✔ PimcoreCustomReportsBundle relative symlink
✔ PimcorePersonalizationBundle relative symlink
✔ PimcoreEcommerceFrameworkBundle relative symlink
✔ PimcoreApplicationLoggerBundle relative symlink
✔ PimcoreGoogleMarketingBundle relative symlink
✔ PimcoreCustomerManagementFrameworkBundle relative symlink
✔ PimcoreNewsletterBundle relative symlink
✔ PimcoreGlossaryBundle relative symlink
✔ PimcoreSeoBundle relative symlink
✔ PimcoreSimpleBackendSearchBundle relative symlink
✔ PimcoreDataHubBundle relative symlink
✔ OutputDataConfigToolkitBundle relative symlink
✔ Web2PrintToolsBundle relative symlink
✔ ObjectMergerBundle relative symlink
✔ PimcoreWebToPrintBundle relative symlink
✔ PimcoreTinymceBundle relative symlink
✔ PimcoreStaticRoutesBundle relative symlink
✔ PimcoreWordExportBundle relative symlink
✔ PimcoreXliffBundle relative symlink
✔ PimcoreCoreBundle relative symlink
--- ------------------------------------------ ------------------
[OK] All assets were successfully installed.
[OK] Pimcore was successfully installed

After the Pimcore installation finishes, continue below to set up Nginx to serve Pimcore's content.

Run the commands below to create an Nginx virtual host file for Pimcore.

🐧Bash / Shell
sudo nano /etc/nginx/sites-available/pimcore.conf

Then copy and paste the content block below into the Nginx server block. Before you save, check three things: the server name matches your domain or IP address, the root path points to the Pimcore public folder you installed, and the PHP-FPM socket matches the PHP version you installed.

🐘PHP
upstream php-pimcore {
server unix:/var/run/php/php8.3-fpm.sock;
}

map $args $static_page_root {
default /var/tmp/pages;
"~*(^|&)pimcore_editmode=true(&|$)" /var/nonexistent;
"~*(^|&)pimcore_preview=true(&|$)" /var/nonexistent;
"~*(^|&)pimcore_version=[^&]+(&|$)" /var/nonexistent;
}

map $uri $static_page_uri {
default $uri;
"/" /%home;
}

server {
listen 80;
listen [::]:80;
server_name pimcore.example.com;
root /var/www/pimcore/public;
index index.php;

access_log /var/log/nginx/forums-access.log;
error_log /var/log/nginx/forums-error.log;

location ~* ^/admin/external {
rewrite .* /index.php$is_args$args last;
}

location / {
error_page 404 /meta/404;
try_files $static_page_root$static_page_uri.html $uri /index.php$is_args$args;
}

location ~ ^/index.php(/|$) {
fastcgi_split_path_info ^(.+.php)(/.+)$;
try_files $fastcgi_script_name =404;
include fastcgi.conf;
set $path_info $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_pass php-pimcore;
internal;
}
}

Save the file.

To activate the Pimcore site on Ubuntu 24.04, enable the virtual host file and restart Nginx with the commands in the block below. Nginx does not use the Apache a2ensite helper, so use the commands shown below instead. Before you restart, it is worth asking Nginx to test its configuration, because a typo in the server block will stop Nginx from starting. The restart makes Pimcore reachable from your browser.

🐧Bash / Shell
sudo ln -s /etc/nginx/sites-available/pimcore.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Setup Let’s Encrypt SSL/TLS for Pimcore

An SSL certificate encrypts the connection between your site and its visitors. You set up Let's Encrypt SSL/TLS for Pimcore by installing Certbot and letting it configure Nginx to use the certificate. This needs a real domain name that points at your server, so skip it for IP-only test installs. Certificates last 90 days, and Certbot normally sets up automatic renewal.

Please read the post below for more on installing and creating Let's Encrypt SSL certificates for Nginx.

How to set up Let’s Encrypt SSL certificate for Nginx on Ubuntu Linux

Once you have restarted Nginx, open your browser and go to the server hostname or IP address defined in the Nginx server block.

💻Code
http://pimcore.example.com/

A Pimcore web portal page should appear. If you see a 502 error, PHP-FPM is not running or the socket path in the server block is wrong. If you see a 403 or 404 error, check the root path and the file ownership.

Pimcore portal
Pimcore portal

To log on to the backend admin page, use the URL below and sign in with the admin account you created during installation.

💻Code
http://pimcore.example.com/admin

That should do it!

Conclusion:

Setting up Pimcore on Ubuntu with Nginx gives businesses a powerful content management system. To summarize:

  • Robust Platform: Pimcore integrates essential components like PIM, MDM, CMS, and eCommerce, offering a comprehensive solution for content management.
  • High Performance with Nginx: Nginx handles many concurrent connections and uses resources efficiently.
  • Easy Database Setup: Installing MariaDB and creating a dedicated database simplifies data management for Pimcore.
  • PHP Compatibility: Installing a current PHP version with the required extensions gives Pimcore the support and performance it needs.
  • Secure Hosting: A virtual host plus a Let's Encrypt SSL certificate protects the connection for your users.

Following these steps gives you a properly set up Pimcore installation on Ubuntu 24.04. From there you can manage your content and build out your online presence.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *