DropVPS Team
Writer: John hens
how to install magento 2 on ubuntu 25.04

Table of Contents
What you will read?
Magento 2 is one of the most powerful eCommerce platforms. Installing it on Ubuntu 25.04 gives you a stable and secure server for your online store
Step 1: Update System
Before installing Magento, make sure your server is up to date. This ensures security and avoids errors.
sudo apt update && sudor apt upgrade -y
Step 2: Install Required Packages
Magento needs Apache, MySQL, PHP, and some extensions. Install them all at once with this command:
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-cli php-xml php-mbstring php-intl php-bcmath unzip composer -y
Step 3: Create Database
Magento needs a database to store products, customers, and orders. Create one in MySQL:
CREATE DATABASE magento;
CREATE USER 'magento_user'@'localhost' IDENTIFIED BY 'StrongPassword123';
GRANT ALL PRIVILEGES ON magento.* TO 'magento_user'@'localhost';
FLUSH PRIVILEGES;
Step 4: Download Magento 2
Now download Magento 2 using Composer. This will place the files in
cd /var/www/html
sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2
Step 5: Set Permissions
Correct file permissions are important so Apache can read and serve Magento files.
sudo chown -R www-data:www-data /var/www/html/magento2
Step 6: Configure Apache
To access Magento from the browser, set up an Apache virtual host pointing to the Magento folder. Then enable the site and restart Apache.
sudo nano /etc/apache2/sites-available/magento2.conf
sudo a2ensite magento2.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Step 7: Run Setup Wizard
Now finish the installation in your browser. Enter the database details you created earlier and set up the admin account.
http://yourdomain.com