• Email: [email protected]
  • Dedicated Server Login
  • About
  • 9288041031
  • Knowledge Base
  • Support
India's best web hosting | Ehostpiya India
  • Home
  • Hosting
    Web Hosting Quality Hosting Starting at ₹60/mo
    Cloud VPS Starting at ₹300/mo
    Dedicated Server First Starting at ₹2401/mo
    Reseller Web Hosting Conveniently Starting at ₹421/mo
    Application For Hosting
    • iconWordPress Hosting
    • iconJoomla Hosting
    • iconMagento Hosting
    • iconOpencart Hosting
    • iconPrestashop Hosting
    • iconDrupal Hosting
  • Email
  • Domain
  • SVG
    Contact Us Face any problem contact with us
    SVG
    About Us We are leading hosting company
  • My Account
Web Hosting Blogs by Ehostpiya | Tips and Tricks Web Hosting Blogs by Ehostpiya | Tips and Tricks
Buy Now

Archives

  • October 2026
  • September 2026
  • August 2026
  • October 2023

Categories

  • Control Panels
  • Magento
  • Miscellaneous
  • SEO
  • Technology
  • Trends
  • Web Hosting
  • Wordpress
Facebook Twitter Instagram Pinterest
Home How to Install Magento Using SSH?
ByVandeeta
October 3, 2026

How to Install Magento Using SSH?

Below is a complete, SEO-friendly tutorial you can publish on your hosting blog.

Table of Contents

Toggle
  • How to Install Magento Using SSH
    • Prerequisites
    • Step 1: Connect to Your Server Using SSH
      • Ubuntu/Debian
      • AlmaLinux/Rocky Linux
    • Step 2: Install Required Packages
    • Step 3: Install Composer
    • Step 4: Configure MySQL
    • Step 5: Create a Directory for Magento
    • Step 6: Obtain Magento Access Keys
    • Step 7: Download Magento Using Composer
    • Step 8: Set Magento File Permissions
    • Step 9: Install Magento From the Command Line
      • Important
    • Step 10: Check the Magento Installation
    • Step 11: Configure Magento Cron Jobs
    • Step 12: Configure Magento for Production
    • Step 13: Configure OpenSearch/Elasticsearch
    • Step 14: Configure Your Web Server
    • Step 15: Enable SSL
    • Step 16: Access Magento Admin
  • Useful Magento SSH Commands
      • Check Magento version
      • Check Magento mode
      • Enable maintenance mode
      • Disable maintenance mode
      • Clear cache
      • Reindex Magento
      • Check indexer status
      • Display Admin URL
      • Check cron configuration
  • Common Magento Installation Problems
    • 1. Composer Authentication Error
    • 2. PHP Version Error
    • 3. Permission Denied
    • 4. Database Connection Error
    • 5. 500 Internal Server Error
  • Conclusion

How to Install Magento Using SSH

Magento, now known as Adobe Commerce, is a powerful e-commerce platform designed for building and managing online stores. Installing Magento through SSH gives you direct access to the server and is especially useful when working with a VPS or dedicated server.

In this guide, we will explain how to install Magento Open Source using SSH on a Linux server.

Note: Magento installation requirements vary by Magento version. Before starting, check the official Adobe Commerce system requirements and use a supported PHP, database, OpenSearch, and Composer version for the Magento release you intend to install.

Prerequisites

Before installing Magento, make sure you have:

  • A Linux VPS or dedicated server
  • SSH access with sudo privileges
  • A domain name pointing to your server
  • Apache or Nginx
  • MySQL/MariaDB
  • PHP with the extensions required by your Magento version
  • Composer
  • OpenSearch or Elasticsearch, depending on the Magento version
  • SSL certificate for production use
  • A Magento Marketplace access key

You should also have sufficient server resources. For a production Magento store, a VPS with adequate CPU, RAM, SSD/NVMe storage, and a properly configured database and search service is recommended.


Step 1: Connect to Your Server Using SSH

From Linux, macOS, or Windows Terminal, connect to your server using:

ssh root@SERVER_IP

Replace SERVER_IP with your actual server IP address.

For example:

ssh [email protected]

If SSH uses a custom port:

ssh -p 2222 root@SERVER_IP

After logging in, update the operating system.

Ubuntu/Debian

apt update && apt upgrade -y

AlmaLinux/Rocky Linux

dnf update -y

Step 2: Install Required Packages

Magento requires several server-side components.

On Ubuntu, you can install commonly required packages with:

apt install -y unzip git curl wget nginx mysql-server

PHP packages depend on the Magento version you are installing. For example:

apt install -y php php-cli php-fpm php-mysql php-curl php-gd \
php-intl php-mbstring php-soap php-xml php-zip php-bcmath

Check your PHP version:

php -v

Make sure the PHP version is supported by your specific Magento release.


Step 3: Install Composer

Composer is required to download Magento and manage its PHP dependencies.

Check whether Composer is already installed:

composer --version

If it is not installed, install Composer using the official Composer installation method.

After installation, verify it:

composer --version

You should see the installed Composer version.


Step 4: Configure MySQL

Log in to MySQL:

mysql -u root -p

Create a database:

CREATE DATABASE magento;

Create a database user:

CREATE USER 'magento_user'@'localhost' IDENTIFIED BY 'StrongPasswordHere';

Grant the required privileges:

GRANT ALL PRIVILEGES ON magento.* TO 'magento_user'@'localhost';

Apply the changes:

FLUSH PRIVILEGES;

Exit MySQL:

EXIT;

Keep the following information available because you will need it during Magento installation:

  • Database name: magento
  • Database username: magento_user
  • Database password: your database password

Step 5: Create a Directory for Magento

Create a directory for your website:

mkdir -p /var/www/magento

Move into the directory:

cd /var/www/magento

You can also use a directory such as:

/var/www/html

depending on your server configuration.


Step 6: Obtain Magento Access Keys

Magento packages are distributed through Adobe’s Composer repositories.

You generally need Magento Marketplace authentication keys:

  • Public Key
  • Private Key

Log in to your Adobe/Magento Marketplace account and obtain your access keys.

When Composer asks for authentication, use:

  • Username → Public Key
  • Password → Private Key

Keep your private key secure and do not publish it.


Step 7: Download Magento Using Composer

Navigate to your Magento directory:

cd /var/www/magento

Create the Magento project with Composer using the package/version appropriate for your installation.

For example:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .

Composer will ask for your Magento authentication credentials if they are not already configured.

The download may take several minutes depending on your server and network connection.


Step 8: Set Magento File Permissions

Magento requires appropriate ownership and permissions.

For a typical Nginx/PHP-FPM setup:

chown -R www-data:www-data /var/www/magento

Then:

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +

The exact web-server user can differ between distributions and control panels, so verify the user running PHP-FPM before applying ownership commands.


Step 9: Install Magento From the Command Line

Magento includes a command-line installation tool.

Run:

php bin/magento setup:install \
--base-url=https://example.com/ \
--db-host=localhost \
--db-name=magento \
--db-user=magento_user \
--db-password='StrongPasswordHere' \
--admin-firstname=Admin \
--admin-lastname=User \
[email protected] \
--admin-user=admin \
--admin-password='StrongAdminPasswordHere' \
--language=en_US \
--currency=USD \
--timezone=America/New_York \
--use-rewrites=1

Replace:

  • example.com with your domain
  • magento with your database name
  • magento_user with your database username
  • StrongPasswordHere with your database password
  • [email protected] with your email address
  • StrongAdminPasswordHere with a strong Magento administrator password
  • Currency and timezone with the settings appropriate for your store

For an Indian store, for example, you may use:

--currency=INR
--timezone=Asia/Kolkata

Important

Do not copy passwords containing special characters into shell commands without considering shell quoting. Using single quotes around password values can help, but passwords containing a single quote require additional escaping.


Step 10: Check the Magento Installation

After installation, check Magento’s status:

php bin/magento --version

You can also run:

php bin/magento status

Clear and deploy Magento’s cache:

php bin/magento cache:flush

Step 11: Configure Magento Cron Jobs

Magento relies on cron jobs for many background tasks.

Run:

php bin/magento cron:install

Check the configured cron jobs:

crontab -l

You can also manually configure Magento’s cron tasks if required by your server environment.


Step 12: Configure Magento for Production

For a production website, check the current Magento mode:

php bin/magento deploy:mode:show

Set production mode:

php bin/magento deploy:mode:set production

Then deploy static content:

php bin/magento setup:static-content:deploy -f

Clear the cache:

php bin/magento cache:flush

Step 13: Configure OpenSearch/Elasticsearch

Magento requires a supported search engine for catalog search and related functionality.

Depending on your Magento release, configure the supported OpenSearch or Elasticsearch version.

You can check Magento’s current configuration with:

php bin/magento config:show | grep -i search

The exact configuration commands depend on the Magento release and search engine version.


Step 14: Configure Your Web Server

Magento’s document root should point to:

/var/www/magento/pub

Do not normally point the web server directly to:

/var/www/magento

The pub directory is intended to be the publicly accessible web root.

For Nginx, create a server block for your domain and configure PHP-FPM according to the PHP version installed on your server.

After changing the Nginx configuration, test it:

nginx -t

Then reload Nginx:

systemctl reload nginx

Step 15: Enable SSL

For a production Magento store, HTTPS should be enabled.

After installing an SSL certificate, make sure your Magento base URL uses HTTPS:

https://example.com/

You can also configure Magento’s secure URL settings through the CLI or Admin Panel.


Step 16: Access Magento Admin

After installation, Magento displays the Admin URI.

You can retrieve it with:

php bin/magento info:adminuri

The output may look similar to:

Admin URI: /admin_xxxxx

Open the displayed URL in your browser:

https://example.com/admin_xxxxx

Log in using the administrator credentials created during installation.


Useful Magento SSH Commands

Here are some frequently used Magento CLI commands.

Check Magento version

php bin/magento --version

Check Magento mode

php bin/magento deploy:mode:show

Enable maintenance mode

php bin/magento maintenance:enable

Disable maintenance mode

php bin/magento maintenance:disable

Clear cache

php bin/magento cache:flush

Reindex Magento

php bin/magento indexer:reindex

Check indexer status

php bin/magento indexer:status

Display Admin URL

php bin/magento info:adminuri

Check cron configuration

php bin/magento cron:run

Common Magento Installation Problems

1. Composer Authentication Error

If Composer reports an authentication error, verify your Magento Marketplace access keys.

You can configure them with:

composer config --global http-basic.repo.magento.com PUBLIC_KEY PRIVATE_KEY

Replace the values with your actual credentials.


2. PHP Version Error

If Magento reports an unsupported PHP version, check:

php -v

Install and configure a PHP version supported by the Magento release you are installing.


3. Permission Denied

Check the ownership of the Magento directory:

ls -la /var/www/magento

Then correct ownership and permissions according to your web-server/PHP-FPM user.


4. Database Connection Error

Verify your database credentials:

mysql -u magento_user -p magento

If you cannot connect, check the database name, username, password, host, and MySQL/MariaDB service status.


5. 500 Internal Server Error

Check your web-server and PHP-FPM logs.

For Nginx:

tail -f /var/log/nginx/error.log

For PHP-FPM, check the appropriate PHP-FPM log for your installed version.

Magento’s own logs can also be found under:

var/log/

Conclusion

Installing Magento using SSH provides a flexible way to deploy an e-commerce store on a VPS or dedicated server. The basic process involves preparing the server, installing the required PHP and database components, configuring Composer and Magento authentication, downloading Magento, creating the database, running setup:install, and configuring the web server.

For a production Magento store, don’t stop at the installation itself. Configure HTTPS, cron, caching, OpenSearch/Elasticsearch, backups, firewall rules, file permissions, and regular Magento security updates before accepting customers.

Always verify the requirements for the specific Magento version you are installing, because supported PHP versions, database engines, search engines, and other dependencies can change between releases.

ByVandeeta
Updated October 03, 2026
  • Magento

Read Next

ByVandeeta
October 3, 2026

How to Configure Magento After Installation: Complete Step-by-Step Guide

How to Configure Magento After Installation: Complete Step-by-Step Guide Installing Magento is only the first step in launching…
  • Magento
ByVandeeta
October 3, 2026

How to Access the Magento Admin Panel?

How to Access the Magento Admin Panel The Magento Admin Panel is the central control area for managing…
  • Magento
ByVandeeta
October 3, 2026

How to Change the Magento Admin URL?

How to Change the Magento Admin URL The Magento Admin URL is the address used to access the…
  • Magento

Leave a Reply Cancel reply

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

Explore Categories

  • Control Panels 7
  • Magento 52
  • Miscellaneous 5
  • SEO 17
  • Technology 10
  • Trends 9
  • Web Hosting 7
  • Wordpress 100

Recent Posts

  • How to Fix WordPress “Too Many Redirects”
  • How to Fix WordPress Critical Error
  • How to Fix WordPress Database Connection Error
  • How to Fix WordPress White Screen of Death
  • How to Fix WordPress 404 Error

Recent Comments

  1. Tabias H. on The Future is 5G: Understanding the Next Wave of Connectivity
  2. Elliot Alderson on Evolving Workspaces: The Rise of the Hybrid Work Trend
  3. James Mann on Evolving Workspaces: The Rise of the Hybrid Work Trend
Swyft

Welcome to the Ehostpiya Blog, your trusted resource for web hosting, WordPress, VPS, domains, website security, and online business tips.

Our goal is to make web hosting and website management easier to understand for everyone—from beginners launching their first website to experienced developers and business owners. We publish practical guides, hosting tips, tutorials, and helpful insights to help you build, manage, and grow your website successfully.

At Ehostpiya, we believe that reliable information and quality hosting go hand in hand. Explore our latest articles and discover simple solutions for a faster, safer, and more successful online presence.

  • Facebook
  • Twitter
  • Instagram
  • Pinteres

Featured Posts

  • AI and Ethics: Navigating the Complex Landscape of Artificial Intelligence
    by Vandeeta
    October 11, 2023
  • AR and VR: Blurring the Lines Between Reality and Virtuality
    by Vandeeta
    October 11, 2023
  • Best WordPress Caching Plugins to Improve Website Speed
    by Vandeeta
    September 26, 2026
  • Blockchain Unchained: How Distributed Ledger Technology is Transforming Industries
    by Vandeeta
    October 11, 2023

Web Hosting Discount

cLAIM NOW
logo

Ehostpiya is reliable Web hosting provider, with aim to provide affordable Website and application hosting to various clients for their online business and presence.

Hosting
  • Web Hosting
  • Cloud VPS
  • Reseller Hosting
  • Email Hosting
  • Dedicated Server
  • Nodejs Hosting
  • SSL Certificate
Legal
  • Accepted Uses Policy
  • privacy Policy
  • Terms of Service
  • Refund and cancellation
  • Service Delivery Policy
Company
  • About Us
  • Our Clients
  • Contact Us
  • Our Blog
Support & Tools
  • Open Support Request
  • View Ticket
  • Knowledge Base
  • Report Abuse
  • check nameserver
  • What is my IP
  • Mx lookup

© Ehostpiya, All rights reserved

  • Terms & Condition
  • Privacy Policy