> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Magento on Upsun Cloud

> Complete these steps to successfully deploy Magento on Upsun Cloud.


Before attempting to deploy Magento on Upsun, you **must complete the [Getting started guide](https://developer.upsun.com/docs/get-started/here)**.

You can also **check out the [Upsun Cloud demo app](https://console.upsun.com/projects/create-project)** and [Resource configuration guide](https://developer.upsun.com/docs/manage-resources/adjust-resources.md). These provide all of the core concepts and common commands you need to easily follow this Magento guide.

## Before you begin

You need:

<ul><li>[Git](https://git-scm.com/downloads).
Git is the primary tool to manage everything your app needs to run.
Push commits to deploy changes and control configuration through YAML files.
These files describe your infrastructure, making it transparent and version-controlled.</li>
<li>An Upsun account.
If you don't already have one, [register for a trial account](https://auth.upsun.com/register).
You can sign up with an email address or an existing GitHub, Bitbucket, or Google account.
If you choose one of these accounts, you can set a password for your Upsun account later.</li>
<li>The [Upsun CLI](https://developer.upsun.com/cli.md).
This lets you interact with your project from the command line.
You can also do most things through the [Web Console](https://developer.upsun.com/docs/administration/web).</li></ul>

> [!NOTE]
>
> Authentication
> You will not need Adobe Commerce authentication keys for this process but if you would like to learn how to set them up if you want to adjust the Composer repository to [https://repo.magento.com/](https://repo.magento.com/), visit [Adobe Commerce Authentication](https://experienceleague.adobe.com/en/docs/commerce-on-cloud/user-guide/develop/authentication-keys).

We will be using the [Upsun Cloud Magento example project](https://github.com/platformsh-templates/magentoCE24/blob/main/README) for this deployment process. The example specifically features:

* PHP {{meta_version_php}}
* MariaDB {{meta_version_mariadb}}
* Redis {{meta_version_redis}}
* OpenSearch {{meta_version_opensearch}}
* RabbitMQ {{meta_version_rabbitmq}}
* Automatic TLS certificates
* Composer-based build

The example also features an [Upsun Cloud config.yaml](https://github.com/platformsh-templates/magentoCE24/blob/main/.upsun/config.yaml) file. Below is a **shortened example** of the config.yaml file:


&#x20;   applications:
&#x20;       \<APP\_NAME>:
&#x20;           \# The runtime the application uses.
&#x20;           type: php:\{\{version:php:latest}}
&#x20;           \# Specify additional PHP extensions that should be loaded.
&#x20;           runtime:
&#x20;               extensions:
&#x20;                   \- xsl
&#x20;                   \- sodium
&#x20;                   \- redis
&#x20;                   \- blackfire
&#x20;           variables:
&#x20;               env:
&#x20;                   NVM\_VERSION: master
&#x20;                   NODE\_VERSION: 20
&#x20;                   MAGENTO\_DC\_INDEXER\_\_USE\_APPLICATION\_LOCK: true
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOGINVENTORY\_STOCK\_\_SIMPLE: 200
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOG\_CATEGORY\_PRODUCT: 666
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOGSEARCH\_FULLTEXT\_\_PARTIAL\_REINDEX: 100
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOGSEARCH\_FULLTEXT\_\_MYSQL\_GET: 500
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOGSEARCH\_FULLTEXT\_\_ELASTIC\_SAVE: 500
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOG\_PRODUCT\_PRICE\_\_SIMPLE: 200
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOG\_PRODUCT\_PRICE\_\_DEFAULT: 500
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOG\_PRODUCT\_PRICE\_\_CONFIGURABLE: 666
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_CATALOGPERMISSIONS\_CATEGORY: 999
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_INVENTORY\_\_SIMPLE: 210
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_INVENTORY\_\_DEFAULT: 510
&#x20;                   MAGENTO\_INDEXER\_BATCH\_SIZE\_\_INVENTORY\_\_CONFIGURABLE: 616
&#x20;               php:
&#x20;                   memory\_limit: "512M"
&#x20;                 ...

## Create project

Copy and run the following command in command line:

`upsun project:create --init-repo https://github.com/platformsh-templates/magentoCE24/`

You will then have to make the following selections:

* Select an organization to create the project under
* Select a title for your project
* Select a [region to deploy from](https://developer.upsun.com/docs/development/regions.md#regions)
* Select your default branch
* Select whether you would like to set your new project as the remote for any existing repositories that have been detected under your organization

Once you have made your selections, the Upsun bot will activate your project.

When your project is created, you will be provided with the following details to access it:

* `Region`
* `Project ID`
* `Project title`
* `Project URL`
* `Git URL`

## Configure resources

Copy the Project URL into your browser. You should see your newly created project in the Upsun console. For example, if you had named your Magento project `Mage`, you would see something similar to the screenshot below:

![Your magento project in the Upsun console](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/guides/magento/mage-console-1.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=dfdc8499a71dd8baef1a5a9be68d0a30)

You will be prompted to configure your resources. At this stage you can select the CPU, RAM, instances and disk size for your Magento project.

![Configure the resources for your Magento project in the Upsun console](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/guides/magento/configure-mage-resources.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=96a4291f3a76da6bc6560afc0b61215f)

### Recommended configurations

You will see that the `container_profile` for the app container is using the `BALANCED` profile by default. The standard CPU & RAM recommendation for your app container is a minimum of `0.5 CPU, 1088MB RAM`. Please see the table below for all **recommended minimum settings for your app container**:

| CPU & RAM | Instances | Disk/storage |
| - | - | - |
| `0.5 CPU, 1088MB RAM` | No minimum | `256MB` |

All other services will be using their [default container profiles](https://developer.upsun.com/docs/manage-resources/adjust-resources.md#advanced-container-profiles) and therefore can be set to `0.1 CPU`, so the above values only apply as recommended minimums for your app container.

Once your project is deployed, you may need to [adjust your resources](https://developer.upsun.com/docs/manage-resources/adjust-resources.md) and [adjust the container profiles](https://developer.upsun.com/docs/manage-resources/adjust-resources.md#adjust-a-container-profile) of your other services.

> [!NOTE]
>
> Note
> Please note that the deployment after configuring resources may take up to 25 minutes.

## View your log

Now that your resources have been configured, you can view a log of how Upsun creates your project. In the recents section, click the three dots to the right of the activity about your `updated resource allocation on Main`.

![Navigate to the log to see your Magento project being created](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/guides/magento/log-console-1.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=a46ce93a766244d7bcc8e4f0109d74cb)

Below is a **shortened example** of what your log would look like:


&#x20;    Configuring resources
&#x20;      Setting 'app' resources to 0.5 CPU, 1088MB RAM.
&#x20;      Setting 'app' disk to 256MB.
&#x20;      Setting 'db' resources to 0.1 CPU, 448MB RAM.
&#x20;      Setting 'db' disk to 256MB.
&#x20;      Setting 'cache' resources to 0.1 CPU, 352MB RAM.
&#x20;      Setting 'session' resources to 0.1 CPU, 352MB RAM.
&#x20;      Setting 'session' disk to 256MB.
&#x20;      Setting 'indexer' resources to 0.1 CPU, 448MB RAM.
&#x20;      Setting 'indexer' disk to 256MB.
&#x20;      Setting 'queue' resources to 0.1 CPU, 448MB RAM.
&#x20;      Setting 'queue' disk to 256MB.

&#x20;    Building application 'app' (runtime type: php:\{\{version:php:latest}}, tree: 392d8f3)
&#x20;      Generating runtime configuration.

&#x20;      Installing build dependencies...

&#x20;       ...

&#x20;      Environment configuration
&#x20;        app (type: php:\{\{version:php:latest}}, cpu: 0.1, memory: 64, disk: 1024)
&#x20;        db (type: mariadb:\{\{version:mariadb:latest}}, cpu: 0.1, memory: 448, disk: 256)
&#x20;        cache (type: redis:\{\{version:redis:latest}}, cpu: 0.1, memory: 352)
&#x20;        session (type: redis-persistent:\{\{version:redis:latest}}, cpu: 0.1, memory: 352, disk: 256)
&#x20;        indexer (type: opensearch:\{\{version:opensearch:latest}}, cpu: 0.1, memory: 448, disk: 256)
&#x20;        queue (type: rabbitmq:\{\{version:rabbitmq:latest}}, cpu: 0.1, memory: 448, disk: 256)

&#x20;      Environment routes
&#x20;        http\://main-bvxea6i-g7baduaayq63y.eu-5.platformsh.site/ redirects to https\://main-bvxea6i-g7baduaayq63y.eu-5.platformsh.site/
&#x20;        http\://main-bvxea6i-g7baduaayq63y.eu-5.platformsh.site/static/ redirects to https\://main-bvxea6i-g7baduaayq63y.eu-5.platformsh.site/static/
&#x20;        https\://main-bvxea6i-g7baduaayq63y.eu-5.platformsh.site/ is served by application \`app\`
&#x20;        https\://main-bvxea6i-g7baduaayq63y.eu-5.platformsh.site/static/ is served by application \`app\`

&#x20;&#x20;

## Preview your Magento project

Now that your Magento project has been successfully created, you will see the standard Magento layout when you navigate to your preview link:

![Your magento project in preview mode](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/guides/magento/preview-mage.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=d3137aaea14ae8cc3649720949cb56b2)

## Fetch your Magento project locally

First, get your project ID by clicking the three dots in the upper right hand of your console, next to the settings cog wheel. Your project ID will appear in a drop down menu.

![Your project ID in console](https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/guides/magento/project-id-mage-1.png?fit=max\&auto=format\&n=7cK3KMJBgO7MXm_y\&q=85\&s=05086025b9fd2776c6ce8e287a2a7502)

Copy the following command into your command line.

`upsun get <projectid>`

Make sure to replace `<projectid>` with the Project ID you just copied from console. Once you run the command in command line, you will be asked if you want to set the remote project for any existing repositories to your project. You will also need to specify a directory for your project to be stored in when downloaded.

Once your project has successfully downloaded, you will be able to access it locally by navigating to the directory you chose.

## Further resources

### Documentation

* [PHP documentation](https://developer.upsun.com/docs/languages/php/)
* [Authenticated Composer repositories](https://developer.upsun.com/docs/languages/php/composer-auth.md)
* [Resource configuration guide](https://developer.upsun.com/docs/manage-resources/adjust-resources.md)

### Authentication

* [Composer Authentication and Post Installation Setup](https://github.com/platformsh-templates/magentoCE24/blob/main/README#composer-authentication-and-post-installation-setup)
* [Magento Repository authentication keys](https://devdocs.magento.com/guides/v2.4/install-gde/prereq/connect-auth.html)

### Community content

* [PHP topics](https://support.platform.sh/hc/en-us/search?utf8=%E2%9C%93\&query=php)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.