How to Install Shopware 6 on Ubuntu 24.04 Using Nginx, PHP 8.3 and MySQL
This guide explains how to manually install and configure Shopware 6 on an Ubuntu 24.04 server. The steps below follow the same configuration used in the supplied Shopware Ansible playbook.
- PHP 8.3
- PHP 8.3-FPM
- Nginx
- MySQL Server
- Composer
- Git
- Shopware 6
- Shopware MySQL database
- Shopware MySQL database user
- Nginx configuration for Shopware
- Ubuntu 24.04 LTS
- Root or sudo access
- Internet connection
- SSH access to the server
Step 1: Connect to the Ubuntu Server
Open PowerShell, Windows Terminal, or another SSH client and connect to your Ubuntu server.
ssh username@SERVER-IPReplace username with your Ubuntu username and SERVER-IP with your server's IP address.
Example:
ssh ubuntu@203.0.113.10Step 2: Check the Ubuntu Version
Confirm that your server is running Ubuntu 24.04:
lsb_release -aThe server should report Ubuntu 24.04 LTS.
Step 3: Update Ubuntu
Update the package list:
sudo apt updateUpgrade installed packages:
sudo apt upgrade -yStep 4: Install the Required Packages
Install the packages used by the Shopware Ansible playbook:
sudo apt install -y software-properties-common nginx mysql-server composer git unzip curl python3-pymysqlThis installs Nginx, MySQL, Composer, Git, PHP repository management tools, and the other required utilities.
Step 5: Add the PHP Repository
The playbook uses the Ondřej Surý PHP repository to obtain PHP 8.3. Add the repository:
sudo add-apt-repository ppa:ondrej/phpIf Ubuntu asks you to confirm, press Enter.
Update the package list:
sudo apt updateStep 6: Install PHP 8.3
Install PHP 8.3 and the extensions specified by the playbook:
sudo apt install -y php8.3 php8.3-cli php8.3-fpm php8.3-mysql php8.3-xml php8.3-curl php8.3-mbstring php8.3-zip php8.3-intl php8.3-gdCheck the installed PHP version:
php -vYou should see PHP 8.3 in the output.
Step 7: Check PHP-FPM
Shopware uses PHP-FPM through Nginx. Check the PHP 8.3-FPM service:
sudo systemctl status php8.3-fpm --no-pagerIf it is not running, start it:
sudo systemctl start php8.3-fpmEnable it at boot:
sudo systemctl enable php8.3-fpmStep 8: Start Nginx
Start Nginx:
sudo systemctl start nginxEnable Nginx at boot:
sudo systemctl enable nginxCheck its status:
sudo systemctl status nginx --no-pagerStep 9: Start MySQL
Start MySQL:
sudo systemctl start mysqlEnable MySQL at boot:
sudo systemctl enable mysqlCheck MySQL:
sudo systemctl status mysql --no-pagerStep 10: Create the Shopware Directory
The supplied Ansible playbook installs Shopware in:
/var/www/upcloud_storeCreate the directory:
sudo mkdir -p /var/www/upcloud_storeSet the owner to the Nginx web-server user:
sudo chown www-data:www-data /var/www/upcloud_storeSet the permissions:
sudo chmod 755 /var/www/upcloud_storeStep 11: Install Shopware Using Composer
Change into the Shopware directory:
cd /var/www/upcloud_storeRun the Composer command used by the Ansible playbook:
sudo COMPOSER_ALLOW_SUPERUSER=1 composer create-project shopware/production:^6.5 .Composer will download Shopware and its dependencies. This can take several minutes.
Step 12: Set Shopware Ownership
After Composer finishes, make sure the Shopware files belong to www-data:
sudo chown -R www-data:www-data /var/www/upcloud_storeStep 13: Create the Shopware Database
The Ansible playbook creates the following database:
- Database: upcloud_store_db
- User: upcloud_store
- Password: upcloud_store_password
Open MySQL:
sudo mysqlInside MySQL, create the database:
CREATE DATABASE upcloud_store_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Create the Shopware database user:
CREATE USER 'upcloud_store'@'localhost' IDENTIFIED BY 'upcloud_store_password';Give the user access to the database:
GRANT ALL PRIVILEGES ON upcloud_store_db.* TO 'upcloud_store'@'localhost';Apply the privileges:
FLUSH PRIVILEGES;Exit MySQL:
EXIT;Step 14: Verify the Shopware Database
Log into MySQL using the Shopware database user:
mysql -u upcloud_store -pEnter:
upcloud_store_passwordIf the login succeeds, the database user has been created correctly. Exit MySQL:
EXIT;Step 15: Create the Nginx Configuration
Create the Shopware Nginx configuration file:
sudo nano /etc/nginx/sites-available/shopware.confPaste the following configuration:
server {
listen 80;
listen [::]:80;
server_name _;
root /var/www/upcloud_store/public;
index index.php index.html;
access_log /var/log/nginx/shopware_access.log;
error_log /var/log/nginx/shopware_error.log;
client_max_body_size 100M;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
location ~ /\.(?!well-known).* {
deny all;
}
}Save the file:
- Press Ctrl + O
- Press Enter
- Press Ctrl + X
Step 16: Enable the Shopware Nginx Site
Create the symbolic link:
sudo ln -s /etc/nginx/sites-available/shopware.conf /etc/nginx/sites-enabled/shopware.confStep 17: Remove the Default Nginx Site
Remove the default Nginx site:
sudo rm -f /etc/nginx/sites-enabled/defaultStep 18: Test the Nginx Configuration
Always test Nginx before restarting it:
sudo nginx -tA successful configuration should show something similar to:
syntax is ok
test is successfulnginx -t reports an error, do not restart Nginx. Read the error message and correct the configuration first.Step 19: Restart Nginx
Restart Nginx:
sudo systemctl restart nginxCheck Nginx:
sudo systemctl status nginx --no-pagerStep 20: Verify PHP-FPM
Check PHP-FPM:
sudo systemctl status php8.3-fpm --no-pagerThe service should show:
Active: active (running)Check that the PHP-FPM socket exists:
ls -l /run/php/php8.3-fpm.sockStep 21: Verify the Shopware Files
Check the Shopware installation directory:
ls -lah /var/www/upcloud_storeCheck the public directory:
ls -lah /var/www/upcloud_store/publicThe Nginx configuration uses:
/var/www/upcloud_store/publicStep 22: Check the Server IP Address
Find the IP address of the Ubuntu server:
hostname -ICopy the server's IP address.
Step 23: Open Shopware in Your Browser
Open a web browser on your computer and enter:
http://YOUR_SERVER_IPFor example:
http://203.0.113.10Replace the example IP address with your actual server IP.
Step 24: Complete the Shopware Installation Wizard
The Shopware installation wizard should now appear in your browser. Follow the instructions shown on screen.
When Shopware asks for the database information, use:
| Setting | Value |
|---|---|
| Database Host | localhost |
| Database Name | upcloud_store_db |
| Database Username | upcloud_store |
| Database Password | upcloud_store_password |
Complete the remaining Shopware installation wizard steps and create the administrator account when requested.
Step 25: Check Nginx Logs
If Shopware does not open, check the Shopware Nginx error log:
sudo tail -f /var/log/nginx/shopware_error.logPress Ctrl + C to stop viewing the log.
Check the access log:
sudo tail -f /var/log/nginx/shopware_access.logStep 26: Troubleshooting Nginx
If Nginx is not working, first test its configuration:
sudo nginx -tCheck its status:
sudo systemctl status nginx --no-pager -lCheck its logs:
sudo journalctl -u nginx -n 100 --no-pagerStep 27: Troubleshooting PHP-FPM
Check PHP-FPM:
sudo systemctl status php8.3-fpm --no-pager -lCheck the PHP-FPM logs:
sudo journalctl -u php8.3-fpm -n 100 --no-pagerRestart PHP-FPM if necessary:
sudo systemctl restart php8.3-fpmStep 28: Troubleshooting MySQL
Check MySQL:
sudo systemctl status mysql --no-pager -lTest the Shopware database:
mysql -u upcloud_store -p -e "SHOW DATABASES;"Enter the database password when prompted.
Step 29: Troubleshooting Shopware
If Shopware returns an error, first check that the files are owned by www-data:
sudo chown -R www-data:www-data /var/www/upcloud_storeCheck the Shopware directory:
ls -lah /var/www/upcloud_storeCheck the public directory:
ls -lah /var/www/upcloud_store/publicStep 30: Useful Service Commands
Nginx
Start:
sudo systemctl start nginxStop:
sudo systemctl stop nginxRestart:
sudo systemctl restart nginxPHP-FPM
Restart:
sudo systemctl restart php8.3-fpmMySQL
Restart:
sudo systemctl restart mysqlStep 31: Final Verification
Run the following commands to verify the main components:
php -v
sudo systemctl status nginx --no-pager
sudo systemctl status mysql --no-pager
sudo systemctl status php8.3-fpm --no-pager
sudo nginx -t
ls -lah /var/www/upcloud_store
ls -lah /var/www/upcloud_store/publicIf the services are running and nginx -t reports a successful configuration test, open:
http://YOUR_SERVER_IPInstallation Complete
Shopware has been installed on Ubuntu 24.04 with:
- PHP 8.3
- PHP-FPM 8.3
- Nginx
- MySQL
- Composer
- Shopware 6
- Shopware database
- Shopware database user
- Nginx reverse/front-end configuration
Shopware URL:http://YOUR_SERVER_IP
Configuration Summary
| Component | Configuration |
|---|---|
| Operating System | Ubuntu 24.04 LTS |
| PHP | 8.3 |
| Web Server | Nginx |
| Database | MySQL |
| Shopware Directory | /var/www/upcloud_store |
| Shopware Public Directory | /var/www/upcloud_store/public |
| Database Name | upcloud_store_db |
| Database User | upcloud_store |
| PHP-FPM Socket | /run/php/php8.3-fpm.sock |
| HTTP Port | 80 |
Quick Access
Shopware:http://YOUR_SERVER_IP
Shopware installation directory:/var/www/upcloud_store
Shopware public directory:/var/www/upcloud_store/public
Nginx configuration:/etc/nginx/sites-available/shopware.conf
The database credentials shown in this guide are the credentials defined in the provided Ansible project. For a production deployment, replace the example database password with a strong, unique password and configure HTTPS/TLS before using the Shopware installation publicly.
This knowledgebase article follows the supplied Shopware Ansible configuration, including PHP 8.3, Nginx, MySQL, Composer, the /var/www/upcloud_store installation path, the Shopware database configuration, and the supplied Nginx configuration.

