How to Install Shopware with Nginx on Ubuntu 24.04
Shopware on Ubuntu 24.04 with Nginx runs a fast online store using an Nginx web server to load product pages quickly. Shopware is free e-commerce software that lets you sell products, take payments, and add plugins, while Nginx handles heavy traffic without slowing down your site.
You need a server running Ubuntu 24.04 along with PHP and a database to complete this setup. Setting up these three tools together gives your online shop a strong foundation on your own hardware.
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
You install Nginx on Ubuntu to handle web requests for your online store by running standard package manager commands in your terminal. This free web server forms the foundation of your hosting stack, making your store accessible to visitors over the internet.
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
You install MariaDB on Ubuntu to store all your store data, customer details, and product catalogs securely in a relational database. This database server runs in the background and processes queries from Shopware as customers browse your site.
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
You create a dedicated Shopware database and a matching user account within MariaDB so the application can read and write store data securely. Running SQL commands in your terminal sets up this isolated storage space with the correct permissions.
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
You install PHP along with its required extensions on Ubuntu to process the code that powers your store's backend logic and features. Shopware relies heavily on PHP and specific modules to function correctly on your web server.
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
You download the official Shopware application archive directly to your Ubuntu server and extract the source code into your web root directory. This places all the core files where your Nginx web server can serve them to visitors.
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.
This will allow the Nginx web server to interact safely with the files, ensuring a secure environment for your Shopware installation.
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
You secure your Shopware store with a free Let's Encrypt SSL/TLS certificate to encrypt customer data and enable HTTPS connections through Nginx. This step protects sensitive information like passwords and payment details during transit.
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!