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
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.
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.
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.
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.
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.
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.