[Yandex Cloud documentation](../../../index.md) > [Tutorials](../../index.md) > Application solutions > Creating a website > [OpenCart online store](index.md) > Management console

# Creating an OpenCart online store using the management console

To create an [OpenCart online store](index.md) using the Yandex Cloud management console:

1. [Get your cloud ready](#before-you-begin).
1. [Create a VM with OpenCart](#create-vm).
1. [Optionally, create a MySQL® DB cluster](#create-mysql).
1. [Set up OpenCart](#configure-opencart).

If you no longer need the resources you created, [delete them](#clear-out).


## Get your cloud ready {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../../../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../../../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../../../billing/quickstart/index.md) and [link](../../../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../../../resource-manager/concepts/resources-hierarchy.md).

### Required paid resources {#paid-resources}

* VM instance: use of computing resources, storage, public IP address, and OS (see [Compute Cloud pricing](../../../compute/pricing.md)).
* Managed Service for MySQL® cluster if created for DBMS support and maintenance: computing resources allocated to hosts, size of storage and backups (see [Managed Service for MySQL® pricing](../../../managed-mysql/pricing.md)).
* Public IP addresses if public access is enabled for cluster hosts (see [Virtual Private Cloud pricing](../../../vpc/pricing.md)).

## Create a VM with OpenCart {#create-vm}

The VM boot disk will have OpenCart and the required components, including PHP and MySQL®, pre-installed on it.

To create a VM:

{% list tabs %}

- Management console

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) where you want to create your VM.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/server.svg) **VMs**.
  1. Click **Create VM**.
  1. Under **Boot disk image**, in the **Product search** field, enter `OpenCart` and select a public [OpenCart](https://yandex.cloud/en/marketplace/products/yc/opencart-3) image.
  1. Under **Location**, select an [availability zone](../../../overview/concepts/geo-scope.md) where your VM will reside.
  1. Under **Disks and file storages**, configure the boot [disk](../../../compute/concepts/disk.md):

      * Select the [disk type](../../../compute/concepts/disk.md#disks_types): `SSD`.
      * Specify the disk size: `13 GB`.

  1. Under **Computing resources**, switch to the `Custom` tab and specify the [platform](../../../compute/concepts/vm-platforms.md), number of vCPUs, and amount of RAM:

      * **Platform**: `Intel Ice Lake`
      * **vCPU**: `2`
      * **Guaranteed vCPU performance**: `20%`
      * **RAM**: `4 GB`

  1. Under **Network settings**:

      * In the **Subnet** field, enter the ID of a subnet in the new VM’s availability zone. Alternatively, select a [cloud network](../../../vpc/concepts/network.md#network) from the list.

          * Each network must have at least one [subnet](../../../vpc/concepts/network.md#subnet). If there is no subnet, create one by selecting **Create subnet**.
          * If there are no networks in the list, click **Create network** to create one:

              * In the window that opens, specify the network name and select the folder where it will be created.
              * Optionally, enable the **Create subnets** setting to automatically create subnets in all availability zones.
              * Click **Create network**.

      * In the **Public IP address** field, select `Auto` to assign a random IP address from the Yandex Cloud pool. Alternatively, select a static address from the list if you reserved one.

    1. Under **Access**, select **SSH key** and specify the VM access credentials:

        * In the **Login** field, enter the preferred login for the user you will create on the VM, e.g., `ubuntu`.
        * In the **SSH key** field, select the SSH key saved in your [organization user](../../../organization/concepts/membership.md) profile.
          
          If there are no SSH keys in your profile or you want to add a new key:
          
          1. Click **Add key**.
          1. Enter a name for the SSH key.
          1. Select one of the following:
          
              * `Enter manually`: Paste the contents of the public SSH key. You need to [create](../../../compute/operations/vm-connect/ssh.md#creating-ssh-keys) an SSH key pair on your own.
              * `Load from file`: Upload the public part of the SSH key. You need to create an SSH key pair on your own.
              * `Generate key`: Automatically create an SSH key pair.
              
                When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the `/home/<user_name>/.ssh` directory. In Windows, unpack the archive to the `C:\Users\<user_name>/.ssh` directory. You do not need additionally enter the public key in the management console.
          
          1. Click **Add**.
          
          The system will add the SSH key to your organization user profile. If the organization has [disabled](../../../organization/operations/os-login-access.md) the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

  1. Under **General information**, enter the VM name, e.g., `opencart`. The naming requirements are as follows:

      * Length: between 3 and 63 characters.
      * It can only contain lowercase Latin letters, numbers, and hyphens.
      * It must start with a letter and cannot end with a hyphen.

  1. Click **Create VM**.
  1. Get the VM [public IP address](../../../vpc/concepts/address.md#public-addresses): you will use it later to [configure OpenCart](#configure-opencart). You can get the public IP address in the management console. On the VM page, navigate to the **Network** section and find the **Public IPv4 address** field.

{% endlist %}

If you expect a significant load on the DB or want to use a managed DBMS service, [create a DB cluster](#create-mysql) using Managed Service for MySQL®. Otherwise, [configure OpenCart](#configure-opencart).

## Create a MySQL® DB cluster {#create-mysql}

Managed Service for MySQL® supports and maintains your [object Object] database, including status and current activity monitoring, automatic backup, and easily configurable fault tolerance.

If you do not need a cluster, skip this step and [configure OpenCart](#configure-opencart).

To create a DB cluster:

{% list tabs %}

- Management console

  1. On the folder page in the [management console](https://console.yandex.cloud), click ![plus](../../../_assets/console-icons/plus.svg) **Create resource** and select **MySQL® cluster**.
  1. Specify a name for the cluster, e.g., `opencart`.
  1. Under **Host class**, select `s2.micro`. This configuration is sufficient for the system to run under a normal workload.
  1. Under **Database**, enter:
     * **DB name**: Leave the default value, `db1`.
     * **Username** to connect to the DB: Keep the default value, `user1`.
     * **Password** for OpenCart to access the MySQL® DB.
  1. Under **Hosts**, change the DB **Availability zone**, if required. To do this, click ![pencil](../../../_assets/console-icons/pencil.svg) to the right of the currently selected availability zone and select the one you need from the drop-down list.

     {% note tip %}

     We recommend selecting the same availability zone as for the VM you created. This reduces latency between the VM and the DB.

     {% endnote %}

  1. Optionally, if you want to ensure DB fault tolerance, add more hosts to the cluster by clicking **Add host** and specifying the availability zone for it.
  1. Leave the other fields unchanged.
  1. Click **Create cluster**.

{% endlist %}

Creating a DB cluster may take a few minutes. Upon completion, [configure OpenCart](#configure-opencart).

## Configure OpenCart {#configure-opencart}

1. Open the web interface of the OpenCart online store. In the browser, open `http://<VM_public_IP_address>/`. The OpenCart settings page opens.
1. Read the license and click **Continue**.

   ![Step 1](../../../_assets/tutorials/opencart/opencart1.png)

1. Make sure that all lines with system requirements are marked with green ticks and click **Continue**.

   ![Step 2](../../../_assets/tutorials/opencart/opencart2.png)

1. Set up access to the DB:

   {% list tabs %}

   - Local server MySQL®

      DB connection attributes are generated in a special file when a VM is created:
      1. Log in to the created VM via SSH.
      1. Switch to `sudo -i` administration mode.
      1. Open `default_passwords.txt` in the admin's home directory:

         ```bash
         root@opencart:~# cat default_passwords.txt
         MYSQL_USER=opencart
         MYSQL_PASS=qDbvN1R6tA6ET
         MYSQL_ROOT_PASS=5DiVb80l1kXVz
         MYSQL_DB=opencart
         ```

      1. On the OpenCart setup page, in the DB section, enter the relevant data:
         * **Username**: `MYSQL_USER` variable value.
         * **Database**: `MYSQL_DB` variable value.
         * **Password**: `MYSQL_PASS` variable value.

         Leave the other fields unchanged.

   - Cluster Managed Service for MySQL®

      If you are using a Managed Service for MySQL® cluster, enter the required cluster attributes:
      * **Hostname**: Enter the [fully qualified domain name (FQDN)](../../../compute/concepts/network.md#hostname) of the created DB. To find out this name:
         1. Open the folder page in the [management console](https://console.yandex.cloud) in a new browser tab.
         1. Go to the **Managed Service for MySQL®** section.
         1. Select the cluster you created in the table.
         1. Select the **Hosts** tab in the left menu.
         1. Hover over the **Hostname** field (for example, `rc1c-vok617m35g3dj23i`) and copy the database's FQDN by clicking ![copy](../../../_assets/console-icons/copy.svg).
      * **Username**: Username (`user1` in the example).
      * **Database**: DB name (`db1` in the example).
      * **Password**: User password you specified.

      Leave the other fields unchanged.

   {% endlist %}

1. Enter the administrator's name, password, and current email address. Then click **Continue**.

   ![Step 3](../../../_assets/tutorials/opencart/opencart3.png)

1. A page will open to notify you that system configuration is complete. To configure the online store, click **Login to your administration** and enter your admin username and password.

   ![Step 4](../../../_assets/tutorials/opencart/opencart4.png)

1. When the installation is complete, log in to the VM via SSH and delete the installation files you no longer need:

   ```bash
   user@opencart:~$ sudo -i
   root@opencart:~# rm -rf /var/www/opencart/install/
   ```

1. To test the home page, go to `http://<VM_public_IP_address>/`. You will see your website home page the way your online store visitors will see it.

   ![Step 5](../../../_assets/tutorials/opencart/opencart5.png)

## How to delete the resources you created {#clear-out}

To stop paying for the resources you created:

1. [Delete](../../../compute/operations/vm-control/vm-delete.md) `opencart`.
1. If you used a MySQL® database, [delete the Managed Service for MySQL® cluster](../../../managed-mysql/operations/cluster-delete.md). In this example, we created a DB cluster named `opencart`.

If you reserved a static public IP address for this VM:
1. Navigate to **Virtual Private Cloud** in your folder.
1. Navigate to the **IP addresses** tab.
1. Find the required IP address, click ![ellipsis](../../../_assets/console-icons/ellipsis.svg), and select **Delete**.

#### See also {#see-also}

* [Creating an OpenCart online store using Terraform](terraform.md).