# How to Install Magento 2.4.9 on Ubuntu 24.04 (with OpenSearch 3 and PHP 8.5)

> Install Magento Open Source 2.4.9 on Ubuntu 24.04 with PHP 8.5, MariaDB and OpenSearch 3: requirements, the manual steps, and a one-form install with Hanoo.

Source: https://hanoo.io/blog/install-magento-2-4-9-ubuntu-24-04 · Published 2026-10-16 · Updated 2026-10-16 · By the Hanoo team

Magento Open Source 2.4.9 is the most demanding PHP application most teams will ever self-host. A working store needs a specific PHP version with a long list of extensions, a supported MariaDB or MySQL, a running OpenSearch cluster, Composer, a web server that understands Magento's `pub/` layout, production-mode compilation, static content deployment and a cron job that runs every minute.

This guide covers both routes on **Ubuntu 24.04 LTS**: what a manual installation involves step by step, and how to get the same store running from a single form with Hanoo on a server you own. Either way, you end up with a real Magento store on your own infrastructure — no shared hosting, no proprietary platform.

> **In short:** Magento 2.4.9 needs PHP 8.4 or 8.5, OpenSearch 3, a recent MariaDB or MySQL, Composer 2 and at least 2 CPU cores and 3 GB of RAM in practice. With Hanoo you pick *Magento Open Source* when creating an application, and the platform installs PHP 8.5, MariaDB 11.8, OpenSearch 3.8, Magento itself and HTTPS for you.

## Magento 2.4.9 system requirements

Adobe tests each Magento release against a specific set of services. For 2.4.9, the release that went generally available in May 2026, the stack looks like this:

| Component | What Magento 2.4.9 expects | What Hanoo installs |
| --- | --- | --- |
| Operating system | Any supported Linux | Ubuntu 22.04, 24.04 or 26.04 LTS (amd64 or arm64) |
| PHP | 8.4 or 8.5 (8.3 only to upgrade older stores) | PHP 8.5 with its own FPM pool |
| Database | MySQL 8.4 or a supported MariaDB release | MariaDB 11.8, one private database per store |
| Search | OpenSearch 3 (Elasticsearch is no longer supported) | OpenSearch 3.8, bound to 127.0.0.1 only |
| Web server | Nginx or Apache | Caddy, serving `pub/` as the document root |
| Composer | Composer 2 | Handled during installation |
| Hardware | 2 GB RAM is the documented floor; real stores need more | Asks for 2 CPU cores, 3 GB RAM and 20 GB disk, and warns before installing on less |

Always check Adobe's own system requirements page for the exact database version matrix before a production launch — Adobe supports only the combinations it tests.

### Why OpenSearch matters

Since Magento 2.4, a search engine is mandatory: catalog search, layered navigation and even some admin grids query it. Magento 2.4.9 targets **OpenSearch 3**. OpenSearch runs on the JVM, so it is the single largest memory consumer on a small Magento server — the most common reason a Magento installation fails on a 1 GB or 2 GB VPS is OpenSearch never finishing its start-up.

## Option 1: install Magento 2.4.9 manually on Ubuntu 24.04

The manual route is worth understanding even if you never take it, because it shows exactly what has to be true on the server. The outline below assumes a fresh Ubuntu 24.04 server and a user with `sudo`.

### 1. Install PHP 8.5 and the extensions Magento needs

Ubuntu 24.04 ships PHP 8.3, which Magento 2.4.9 does not support for new stores. PHP 8.5 comes from the widely used Ondřej Surý PPA:

```bash
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.5-fpm php8.5-cli php8.5-bcmath php8.5-curl php8.5-gd \
  php8.5-intl php8.5-mbstring php8.5-mysql php8.5-soap php8.5-xml \
  php8.5-zip php8.5-sockets php8.5-opcache
```

Then raise the limits Magento's installer checks, in `/etc/php/8.5/fpm/php.ini` and `/etc/php/8.5/cli/php.ini`:

```ini
memory_limit = 2G
max_execution_time = 1800
zlib.output_compression = On
realpath_cache_size = 10M
realpath_cache_ttl = 7200
```

### 2. Install the database

Create a dedicated database and user. Never let Magento connect as `root`:

```sql
CREATE DATABASE magento CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'magento'@'127.0.0.1' IDENTIFIED BY 'a-long-random-password';
GRANT ALL PRIVILEGES ON magento.* TO 'magento'@'127.0.0.1';
FLUSH PRIVILEGES;
```

Make sure the MariaDB version you install is one Adobe lists for 2.4.9; the version in Ubuntu's own archive is usually older than Magento wants, so most teams add MariaDB's official repository.

### 3. Install and tune OpenSearch 3

Install OpenSearch 3 from the official OpenSearch APT repository, then keep it private and sized for the machine:

```yaml
# /etc/opensearch/opensearch.yml
cluster.name: magento
network.host: 127.0.0.1
http.port: 9200
discovery.type: single-node
plugins.security.disabled: true
```

Set the JVM heap explicitly (for example `-Xms512m` and `-Xmx512m` on a small store, more on a large catalogue), raise `vm.max_map_count` to `262144`, then `sudo systemctl enable --now opensearch` and confirm `curl http://127.0.0.1:9200` answers with a 3.x version. Disabling the security plugin is only acceptable because the service listens on `127.0.0.1` — never expose an unauthenticated OpenSearch port to the internet.

### 4. Download Magento and install its dependencies

Download the 2.4.9 release (from Adobe's Composer repository with your access keys, or the tagged source archive on GitHub), place it under a directory owned by a dedicated, unprivileged user, and run `composer install --no-dev` inside it.

### 5. Run the Magento installer

```bash
php8.5 bin/magento setup:install \
  --base-url=https://shop.example.com/ \
  --db-host=127.0.0.1 --db-name=magento --db-user=magento --db-password='…' \
  --search-engine=opensearch --opensearch-host=127.0.0.1 --opensearch-port=9200 \
  --language=en_US --currency=USD --timezone=UTC \
  --use-rewrites=1 --document-root-is-pub=1 \
  --admin-firstname=Store --admin-lastname=Owner \
  --admin-email=you@example.com --admin-user=storeadmin --admin-password='…'
```

### 6. Switch to production mode

```bash
php8.5 bin/magento deploy:mode:set production --skip-compilation
php8.5 bin/magento setup:di:compile
php8.5 bin/magento setup:static-content:deploy -f en_US
php8.5 bin/magento cache:flush
```

Compilation alone can take several minutes and well over a gigabyte of memory.

### 7. Configure the web server for `pub/`

Point the document root at Magento's `pub/` directory, not the project root. Magento's sample Nginx file (`nginx.conf.sample`) shows the rules it expects, including the `static.php` and `get.php` fallbacks for versioned static assets and media. Skipping those fallbacks is the classic cause of a storefront that loads but looks completely unstyled.

### 8. HTTPS, file permissions and cron

Finally: issue a certificate, make sure only the Magento user can write to `var/`, `generated/`, `pub/static/` and `pub/media/`, and add Magento's cron (`bin/magento cron:run`) to run every minute. Without cron, indexers, emails and scheduled tasks silently stop.

That is eight stages, each with its own failure modes. The rest of this guide shows the shorter path.

## Option 2: install Magento 2.4.9 with Hanoo

[Hanoo](/) is a control plane for PHP servers you own. You connect a clean Ubuntu server once, and from then on applications, domains, certificates, databases and services are managed from the dashboard — while everything on the server stays standard Ubuntu, Caddy, PHP-FPM and MariaDB.

### Step 1: connect an Ubuntu server

Create a server at any provider — DigitalOcean, Hetzner, AWS, Vultr or your own hardware — with **Ubuntu 22.04, 24.04 or 26.04 LTS**, at least **2 CPU cores, 3 GB of RAM and 20 GB of disk**. 4 GB of RAM or more is a comfortable starting point for a real catalogue.

In the Hanoo dashboard, choose **Connect server** and run the one-time command it shows on the server:

```bash
curl -fsSL https://app.hanoo.io/api/v1/install.sh \
  | sudo bash -s -- --url https://app.hanoo.io/api --token hne_••••••
```

The command installs a small agent that connects *out* to Hanoo over mutually authenticated TLS. No inbound management port is opened, and no root password or private key is shared. Review the server's details and approve it in the dashboard.

### Step 2: create a Magento application

Open **Applications → Create application** and choose **Magento Open Source**. Give the store a name and pick the server you just connected. PHP 8.5 is selected for you, because it is the version this Magento release is installed with.

When you create the application, Hanoo's agent on your server:

1. Checks the server against Magento's minimums and warns you up front if the install is likely to fail.
2. Installs **OpenSearch 3.8**, bound to `127.0.0.1` with a fixed JVM heap and the kernel setting it needs, and waits until it answers.
3. Creates an isolated Linux user and a dedicated **PHP 8.5-FPM pool** for the store.
4. Creates a private **MariaDB 11.8** database and user, and keeps the password out of process lists and logs.
5. Downloads the pinned **Magento 2.4.9** release, verifies its checksum and installs its dependencies.
6. Runs `setup:install`, switches the store to **production mode**, compiles dependency injection and deploys static content.
7. Configures **Caddy** to serve `pub/` with Magento's static and media fallbacks, and refuses PHP execution inside `pub/media` and `pub/static`.

You can follow every phase live on the application's page; the whole run typically takes several minutes, most of it Magento's own compilation. If a step fails, the page names the step and the reason — not just "installation failed".

The store is immediately reachable on its temporary Hanoo address over HTTPS.

### Step 3: create your admin user

The installer does not invent an admin password for you. Create the first admin account yourself over SSH, as the store's own user. Add your public key under the application's **Access** tab, connect, and run:

```bash
cd /srv/hanoo/apps/<application-id>/current
php8.5 bin/magento admin:user:create \
  --admin-user=storeadmin --admin-password='a-long-unique-password' \
  --admin-email=you@example.com --admin-firstname=Store --admin-lastname=Owner
php8.5 bin/magento info:adminuri
```

`info:adminuri` prints the admin path. Magento enables **two-factor authentication** for the admin by default and emails the setup link, so configure outgoing mail before your first sign-in on a production store.

### Step 4: add your domain and switch the base URL

Under the application's **Domains** tab, add `shop.example.com`. Hanoo checks that its DNS points at your server, issues a Let's Encrypt certificate and serves the store on it.

Magento stores its own base URLs in the database, so tell it about the new domain once:

```bash
php8.5 bin/magento config:set web/unsecure/base_url https://shop.example.com/
php8.5 bin/magento config:set web/secure/base_url https://shop.example.com/
php8.5 bin/magento config:set web/secure/use_in_frontend 1
php8.5 bin/magento config:set web/secure/use_in_adminhtml 1
php8.5 bin/magento cache:flush
```

### Step 5: schedule Magento's cron

Open the application's **Cron jobs** tab and add an entry that runs every minute (`* * * * *`):

```bash
php8.5 bin/magento cron:run
```

Cron jobs run as the store's own user, in its current release directory, and by default a run is skipped while the previous one is still going, so a slow run is never stacked on top of itself. You can run the entry on demand and see its last result and output in the dashboard.

## Troubleshooting a Magento 2.4.9 installation

### The installer stops at OpenSearch

Almost always memory. OpenSearch needs its heap plus headroom, and Magento's compile step runs alongside it. On a 1-core, 1 GB server OpenSearch never answers; give the server at least 3 GB of RAM (Hanoo warns you before installing on anything smaller, and names the memory problem if OpenSearch does not start) and avoid running other heavy services on it.

### The storefront loads without any styling

Static assets are requested with a versioned prefix such as `/static/version1760000000/…`. If the web server does not route missing files under `pub/static` to `static.php`, every stylesheet request returns a 404 page. Hanoo configures these routes for you; on a manual setup, copy them from Magento's `nginx.conf.sample`.

### "There has been an error processing your request"

Look in `var/report/` for the report number shown on the page, and in `var/log/exception.log`. After any code or configuration change in production mode, re-run `setup:di:compile` and `setup:static-content:deploy`.

### Indexers say "Reindex required"

Cron is not running. Check the cron job's last run in the dashboard, or run `php8.5 bin/magento indexer:status` to see which indexers are behind.

## Frequently asked questions

### Can I install Magento 2.4.9 on Ubuntu 24.04?

Yes. Ubuntu 24.04 LTS is a solid base for Magento 2.4.9, but its built-in PHP 8.3 is not supported for new 2.4.9 stores, so you need PHP 8.4 or 8.5 from another source, plus OpenSearch 3 and a supported database. Hanoo installs all of these for you on Ubuntu 22.04, 24.04 or 26.04.

### How much RAM does Magento 2.4.9 need?

Adobe documents 2 GB as a minimum, but that leaves no room for OpenSearch and compilation. Plan for at least 3 GB on a small store and 4–8 GB once you have real traffic and a larger catalogue.

### Does Magento 2.4.9 still support Elasticsearch?

No. Magento 2.4.9 uses OpenSearch, with OpenSearch 3 as the target version. If you are upgrading from a store that used Elasticsearch, migrate to OpenSearch first.

### Which PHP version should I use for Magento 2.4.9?

PHP 8.4 or 8.5. PHP 8.3 is only meant as a stepping stone when upgrading an older store. Hanoo installs Magento 2.4.9 with PHP 8.5.

### Is it safe to run Magento on my own VPS instead of managed Magento hosting?

Yes, if the basics are right: a dedicated unprivileged user per store, search and database bound to localhost, HTTPS everywhere, admin two-factor authentication, and timely security patches. Running on a server you own also means no platform lock-in — with Hanoo, your store keeps running even if you stop using the dashboard.

### How do I find my Magento admin URL?

Run `php8.5 bin/magento info:adminuri` in the store's directory. The admin path is randomised at installation so it is not trivially guessable.
