Deployment guide

How to install Magento on a VPS

Deploy on a VPS Cloud →

Self-hosting9 min read

How to install Magento on a VPS

Magento Open Source (Adobe Commerce) is a powerful e-commerce platform, built for large catalogues and advanced customisation needs. Self-hosted on your VPS, it gives you full control of your store, its performance and its customer data, without depending on costly managed hosting. Here is how to install it cleanly with Docker, a reverse proxy and HTTPS.

Why host Magento on your own VPS

Magento is resource-hungry and sensitive to configuration: shared hosting cannot handle the load, and specialised managed offers are expensive. A dedicated VPS lets you size PHP, the database and the cache (Redis, OpenSearch) precisely, keep your customer data and orders under your control, and deploy your extensions without restrictions imposed by a provider.

The concrete benefits of a self-hosted Magento

  • Adjustable performance: you size PHP-FPM, Redis and OpenSearch according to your catalogue.
  • Sovereignty over customer data and order history.
  • Complete freedom of extensions and themes, without a host's approval.
  • Staging environments easy to create for testing updates.
  • Controlled cost compared with high-end managed e-commerce offers.
  • Progressive scaling: add vCPU and RAM during seasonal peaks.

Hardware and software requirements

Magento is demanding. Plan for at least 4 GB of RAM (6 to 8 GB recommended in production), 2 to 4 vCPU and 20 GB of disk or more depending on the catalogue and media. The stack requires PHP 8.x, MariaDB/MySQL, OpenSearch (or Elasticsearch) and Redis. On the network side: a domain name (e.g. shop.your-domain.com) pointing to the VPS and port 443 open.

Install Magento with Docker and HTTPS

01

Prepare the VPS and Docker

Over SSH, update the system and install Docker via curl -fsSL https://get.docker.com | sh. Create a folder mkdir -p /opt/magento && cd /opt/magento.

02

Assemble the stack

Put together a docker-compose bringing together PHP-FPM, Nginx, MariaDB, Redis and OpenSearch. Proven community images (e.g. markshust/docker-magento) provide a ready-to-use base.

03

Get Magento via Composer

With your Adobe access keys (Public/Private keys), run composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition.

04

Launch the installation

Run bin/magento setup:install providing the database, OpenSearch, base URL and admin account, then bin/magento setup:di:compile and bin/magento deploy:mode:set production.

05

Configure the reverse proxy

Place Caddy or Nginx in front of the web container: shop.your-domain.com { reverse_proxy localhost:8080 }. Caddy handles Let's Encrypt TLS automatically.

06

Optimise and secure

Enable the Redis cache for sessions and pages, configure the Magento crons, restrict admin access by IP and schedule backups of the database and media.

Always enable production mode (deploy:mode:set production) before going live: it precompiles the code and assets, which radically changes response times compared with developer mode.

The official documentation

For advanced configuration and tool-specific options, refer to the official Magento / Adobe Commerce documentation. This guide covers going live on a VPS; the vendor documentation remains the reference for fine-tuning, major updates and specific use cases.

Deploy your instance on a ServOrbit Cloud VPS

A ServOrbit Cloud VPS with preconfigured Docker and scalable resources lets you install this tool without friction, and adjust RAM and vCPU as usage grows.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.