How to Install Shopware with Nginx on Ubuntu 24.04
Installing Shopware with Nginx on Ubuntu 24.04 involves setting up Nginx as the web server and then installing the Shopware e-commerce platform.
Shopware is a powerful, free e-commerce software that helps you build online stores. It’s great for managing products, payments, and adding extra features through plugins.
Nginx is a web server famous for being fast and using very little computer power. It handles many visitors at once without slowing down, which is perfect for busy online stores where quick loading times matter a lot to customers.
This setup gives your online business a fast and dependable base on the latest Ubuntu version.
Install Nginx and MariaDB using `apt install nginx mariadb-server`. Create a Shopware database and user with `CREATE DATABASE` and `GRANT` commands in the MariaDB console. Finally, install PHP and configure Nginx to serve your Shopware files.
Install Nginx HTTP server on Ubuntu
Nginx is a web server that handles requests for your Shopware site on Ubuntu. Installing Nginx is a simple process to get your web server ready. You’ll open the Ubuntu terminal and run a couple of commands to get Nginx installed and running.
To do that, open the Ubuntu terminal and run the commands below to install the Nginx web server.
sudo apt update
sudo apt install nginx
Once Nginx is installed, the commands below can start, stop, and enable the Nginx web server to start automatically when your server boots up.
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl enable nginx
You can test the Nginx web server by opening your web browser and browsing to the server’s localhost or IP address.
http://localhost

When you see the Welcome to nginx!, it means the Nginx HTTP server is successfully installed.
Additional help on installing Nginx on Ubuntu is in the link below.
Install the MariaDB database server on Ubuntu
Shopware needs a database to keep all its information organized. Installing MariaDB, a common database server, on your Ubuntu system is the next step. You’ll open the terminal and use simple commands to install MariaDB.
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.
sudo apt update sudo apt install mariadb-server
Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.
sudo systemctl stop mariadb sudo systemctl start mariadb sudo systemctl enable mariadb
Run the following commands to validate and test if the MariaDB database server is installed successfully.
sudo mariadb
Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.
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 that the server is installed successfully.
Additional help on installing MariaDB.
- How to install MariaDB on Ubuntu Linux
- MariaDB without password prompt
Create a Shopware database
After installing MariaDB, you need to create a dedicated database for Shopware. This step also involves setting up a secure username and password. We’ll create a database named ‘shopwaredb’ and a user called ‘shopwaredbuser’ to manage it.
As part of the setup, we will create a shopwaredb database and a user account called shopwaredbuser.
The `shopwaredbuser` account gains full access to the `shopwaredb` database, ensuring the Shopware application can manage its data effectively. This step is crucial for Shopware's core functions to operate correctly after installation.
All the database steps above can be done using the commands below:
But first, log on to the MariaDB database server:
sudo mariadb
Then run the commands below to complete the steps:
CREATE DATABASE shopwaredb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER shopwaredbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON shopwaredb.* TO shopwaredbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Install PHP on Ubuntu Linux
Shopware is built using PHP, a programming language. To make Shopware work correctly, you must install the necessary PHP components on your Ubuntu system. Running a specific command in the terminal will install the latest PHP version and its required extensions.
Then, run the commands below to install the latest PHP version.
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
Download Shopware files
Now it’s time to get the Shopware application files onto your Ubuntu server. You will also set up the main folder where these files will be stored. To get the latest version, you’ll find the download link on Shopware’s website and then download and extract the files.
To always install the latest version, check the download page for Shopware. Get the download link and download the archived package to your computer. Then, extract it.
First, create a Shopware root folder and download the Shopware files.
sudo mkdir -p /var/www/shopware
cd /var/www/shopware
sudo wget https://github.com/shopware/web-recovery/releases/latest/download/shopware-installer.phar.php
sudo chown -R www-data:www-data /var/www/shopware/
Once you have completed all the above steps, continue configuring the Nginx web server below to serve the Shopware content.
Run the commands below to create a Nginx virtual host file for Shopware.
sudo nano /etc/nginx/sites-available/shopware.conf
Then, copy and paste the content block below into the Nginx server block.
server {
listen 80;
listen [::]:80;
root /var/www/shopware;
index index.php;
server_name shopware.example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
# Shopware install / update
location /shopware-installer.phar.php {
try_files $uri /shopware-installer.phar.php$is_args$args;
}
location ~ ^/shopware-installer.phar.php/.+.(?:css|js|png|svg|woff)$ {
try_files $uri /shopware-installer.phar.php$is_args$args;
}
# Deny access to . (dot) files
location ~ /. {
deny all;
}
# Deny access to .php files in public directories
location ~ ^/(media|thumbnail|theme|bundles|sitemap).*.php$ {
deny all;
}
location /recovery/install {
index index.php;
try_files $uri /recovery/install/index.php$is_args$args;
}
location /recovery/update/ {
location /recovery/update/assets {
}
if (!-e $request_filename){
rewrite . /recovery/update/index.php last;
}
}
location / {
try_files $uri /index.php$is_args$args;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}Save the file.
The virtual host configuration for Shopware on Ubuntu 24.04 needs to be activated. Run the command `sudo a2ensite shopware.conf` to enable the virtual host file, and then execute `sudo systemctl restart nginx` to restart the Nginx web server, ensuring your Shopware site is accessible.
sudo ln -s /etc/nginx/sites-available/shopware.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx.service
Setup Let’s Encrypt SSL/TLS for Shopware
Securing your Shopware site is important, so you’ll set up a free SSL/TLS certificate using Let’s Encrypt. This works with your Nginx web server to keep your site safe. You can find more detailed instructions in a separate guide on setting up Let’s Encrypt for Nginx.
Please read the post below for additional resources 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 the Nginx web server, open your browser and browse to the server hostname or IP address defined in the Nginx server block.
http://shopware.example.com/shopware-installer.phar.php
Shopware installation wizard should appear.
Select the installation language and continue.

Select the default PHP library path and continue.

Download the latest version.

After downloading, start the installation and type in the database details created above.

Next, configure your store name and create an admin account.

Shopware should be installed and ready to use.

After the installation, reopen the Nginx virtual host file and change the root path from /var/www/shopware to /var/www/shopware/public.
Reload Nginx to apply the changes.
sudo nano /etc/nginx/sites-available/shopware.conf
sudo systemctl reload nginx
That should do it!
Conclusion:
Installing Shopware with Nginx on Ubuntu 24.04 can enhance your e-commerce platform’s performance and security. Here are the key takeaways:
- Efficient Setup: The combination of Nginx and Ubuntu provides a robust environment for Shopware.
- Database Management: MariaDB is a powerful database solution for handling e-commerce data.
- PHP Compatibility: Ensuring that the latest PHP version is installed provides optimal functionality for Shopware.
- Safe Environment: Proper configuration and permission settings enhance the security of your installation.
- SSL Security: Implementing Let’s Encrypt SSL/TLS certificates secures your site and builds customer trust.
- User-Friendly Installation: The installation wizard simplifies the process, making it accessible even for those with limited technical expertise.
Shopware's capabilities empower you to build a successful online store. By completing the installation steps, you unlock features for managing products, orders, and customer interactions.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!