# Alibaba Cloud

{% hint style="danger" %}
This guide applies to **MikoPBX version 2024.2.135** and later!
{% endhint %}

{% embed url="<https://youtu.be/BnQEeaIzllA>" %}

This step-by-step guide will walk you through installing MikoPBX on the Alibaba Cloud platform.

Before starting, download the latest **.raw** MikoPBX image from [MikoPBX’s GitHub releases](https://github.com/mikopbx/core/releases).

## Uploading the Image to Alibaba Cloud

### Creating a Bucket

First, create a bucket for storing your image. Go to the **OSS Management Console** ([link](https://oss.console.aliyun.com/overview)).

1. Go to **Buckets**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F6h4xtvZSqvCJEnpcTA5s%2FbucketsSection.jpg?alt=media&#x26;token=b0b5ed76-9aac-4581-be78-dcc1d07cdef9" alt=""><figcaption><p>Buckets section</p></figcaption></figure>

2. Click **Create Bucket**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FUuojUv0KMFu7Hoslamrr%2FcreateBucketButton.jpg?alt=media&#x26;token=fd202f31-ca64-4f98-b58d-3557054c3c5a" alt=""><figcaption><p>"Create Bucket" button</p></figcaption></figure>

3. Specify the following:

* **Bucket name** – a custom name for your storage.
* **Region** – pick the region where your image will be stored.

{% hint style="danger" %}
The bucket region for your image must match the region of your future virtual machine!
{% endhint %}

Click **OK**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FaATQCfFd3Tno2NgmuiTg%2FbucketParameters.jpg?alt=media&#x26;token=64206625-06f0-4fd2-be20-4f431b08090b" alt=""><figcaption><p>Bucket parameters</p></figcaption></figure>

4. Go to your newly created bucket by clicking its name in the **Buckets** section:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FHmgwKSyf0j91n4DIdYTW%2FbucketName.jpg?alt=media&#x26;token=1100bb12-5e4e-4b2e-90b0-0b0f7bab2d2a" alt=""><figcaption><p>Bucket name</p></figcaption></figure>

5. Click **Upload object** and upload the previously downloaded **.raw** disk image file (leave other parameters at default).

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fqf8boOo9HnuE30hRx30I%2FuploadObject.jpg?alt=media&#x26;token=4816c8a9-217f-440c-ba7f-9405b099c71c" alt=""><figcaption><p>"Upload Object" button</p></figcaption></figure>

6. Once the disk image file is uploaded, copy its link. Click **View Details** to the right of the file name; in the opened menu, copy the **URL** field.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FYeKe0Rok0fBXH49udnGq%2FURL.jpg?alt=media&#x26;token=30ee35d2-2feb-4457-91ec-c479f2dc5c66" alt=""><figcaption><p>URL of the uploaded file</p></figcaption></figure>

### Creating the Image

1. Return to the **ECS Console** ([link](https://ecs.console.aliyun.com/home)) and go to **Images**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FaHJ5vl1A3rkNKmbaUAWa%2FimagesSection.jpg?alt=media&#x26;token=25f6f728-f1c0-4a93-9aef-b05f76578424" alt=""><figcaption><p>"Images" section</p></figcaption></figure>

2. Click **Import Image**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FHuJFtjRxTDmD4jg7y6Zp%2FimportImageButton.jpg?alt=media&#x26;token=232b9307-5bbc-444f-864c-0251c80faf18" alt=""><figcaption><p>"Import Image" Button</p></figcaption></figure>

3. Select **Linux Operating System** and click **Next**.
4. Enter/select the following image parameters:
   * **Image File URL** – Paste the link to the disk image file you uploaded.
   * **Image Name** – A custom, **unique** name for your image.
   * **OS Type** – Linux
   * **OS Version** – Others Linux
   * **Architecture** – 64-bit OS
   * Uncheck **"Check After Import"**

Click **OK** to create the image. Wait until the process finishes (the Status will show <mark style="color:green;">**Available**</mark>).

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F7EqpJNYij74oRPT3sjfe%2FimageParametersMikoPBX.jpg?alt=media&#x26;token=10113890-ad5e-4e0d-84a4-dae343c830ff" alt=""><figcaption><p>Image Parameters</p></figcaption></figure>

## Creating an SSH Key Pair

Next, create and add an SSH key pair in Alibaba Cloud.

1. In the ECS Console, go to **Network Security** → **Key Pairs**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FCKrxmVRW0IVWNZv5g30m%2FkeyPairsSection.jpg?alt=media&#x26;token=8b7700e1-1b20-4550-bb9b-37f68c89f00d" alt=""><figcaption><p>"Key Pairs" section</p></figcaption></figure>

2. Click **Create SSH Key Pair**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FivB9sCWq2LNCazJrDpKT%2FcreateSSHKeyPair.jpg?alt=media&#x26;token=04ca44d8-7b7f-4c61-9fb2-a2a149083472" alt=""><figcaption><p>"Create SSH Key Pair" button</p></figcaption></figure>

3. Generate an SSH key pair. For details on how to generate a key pair, see [this guide](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/connecting-to-a-pbx-using-ssh). Fill in the required parameters:

* **Name** – A custom name for your key pair.
* **Creation Mode** – Import
* **Public Key** – Paste your **public** key, generated earlier.
* **Resource Group** – Choose your resource group.

Click **OK** to create the key pair in the cloud.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FDbhGjJ9lPXShMhovUsLM%2FsshKeyPairParameters.jpg?alt=media&#x26;token=82f48b42-d389-4af4-96b2-e06d317f783c" alt=""><figcaption><p>SSH Key Pair Parameters</p></figcaption></figure>

## Creating a Security Group

Before creating the virtual machine, you must set up a security group (firewall).

1. Go to **Network & Security** → **Security Groups**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FV1CT6YcbCscOZCfX8Rwd%2FsecurityGroupsSection.jpg?alt=media&#x26;token=bf6fef77-e968-49aa-be83-47bd29c11af7" alt=""><figcaption><p>"Security Groups" Section</p></figcaption></figure>

2. Click **Create Security Group**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fje6rpAlMdFl2f5TISzuD%2FcreateSecurityGroup.jpg?alt=media&#x26;token=eaaa53be-0fd7-41d0-8d2d-d2ea7f6243b7" alt=""><figcaption><p>"Create Security Group" button</p></figcaption></figure>

3. Specify the following security group parameters:

* **Security Group** – A custom name for your security group.
* **Network** – Your selected network. If it doesn’t exist yet, click **"Create VPC"** to the right.
* **Security Group** – Basic Security Group.
* **Resource Group** – Your resource group.
* Allow all inbound connections (see example below). Outbound is allowed by default.

{% hint style="info" %}
Be sure to configure the firewall within MikoPBX itself as soon as possible after creating the virtual machine. Read more about that [here](https://docs.mikopbx.com/mikopbx/english/manual/connectivity/firewall).
{% endhint %}

Click **Create Security Group**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FfjuUoPeWVg5dO8S6k8YW%2FParametersOfTheSecurity.jpg?alt=media&#x26;token=3609842b-90e4-4149-b6b4-fc5ee8caf3fa" alt=""><figcaption><p>Security Group parameters</p></figcaption></figure>

## Creating the Virtual Machine

1. Go to **Instances & Images** → **Instances**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F8Pp1Xear0ge4ehmW5u9B%2FinstancesSection.jpg?alt=media&#x26;token=f9a4db80-3fa3-45a8-9c80-1cfa188e2cbc" alt=""><figcaption><p>"Instances" section</p></figcaption></figure>

2. Click **Create Instance** to create a new virtual machine:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FPsKZCGgGU4kS3WS3TEBr%2FcreateInstanceButton.jpg?alt=media&#x26;token=02fc4277-ea95-4858-b6e0-776bdc6c0b0c" alt=""><figcaption><p>"Create Instance" button</p></figcaption></figure>

3. Select your VM parameters:

* **Billing Method** – Choose how you’ll pay for the VM.
* **Region**, **Network, and Zone** – Select the region and zone to match your needs.
* **Instance** – Pick a configuration for your VM.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FJOQlvNbkbM7ctVJ1BaLW%2FVMParameters1.jpg?alt=media&#x26;token=011ff5d5-d2cd-41d3-b473-7746f732c0ca" alt=""><figcaption><p>VM Parameters №1</p></figcaption></figure>

4. Configure additional VM parameters:

* **Image** – **Custom Images** → Choose the previously imported image.
* **Storage** – Select the type and size of the **System Disk** (20 GB is the minimum for Alibaba Cloud).
* **Add a second disk** by clicking **Add Data Disk**, specifying its type and size.

{% hint style="info" %}
We recommend a minimum of **50GB** for call recordings.In this guide we use 30GB as an example.
{% endhint %}

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FQTvCixd7FSMrVNPwXaMC%2FVMParameters2.jpg?alt=media&#x26;token=4dfd7c39-6416-4ad9-b90e-2e2ea39fc2ce" alt=""><figcaption><p>VM Parameters №2</p></figcaption></figure>

5. Choose the network parameters for your VM. The security group created earlier will be assigned automatically:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FrhWjDD39WfxktedcGkhm%2FbandwidthsSecurityGroupsSection.jpg?alt=media&#x26;token=cdaffe58-3643-4974-a248-479ef24312b7" alt=""><figcaption><p>VM Parameters №3</p></figcaption></figure>

6. Click **Create Order**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FZ9bEpgjRHemhpuD9Bq19%2FcreateOrder.jpg?alt=media&#x26;token=947289fe-8658-4d23-b4a4-e3af5b8a7c93" alt=""><figcaption><p>"Create Order" button</p></figcaption></figure>

## Connecting to the MikoPBX Console

In the **Instances** section, open the newly created VM by clicking its name.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F2cfPo45Q6IfcBcKBRC6w%2FgoToVM.jpg?alt=media&#x26;token=503e1a78-65ad-4930-9f32-007d9dbd9985" alt=""><figcaption><p>VM's name</p></figcaption></figure>

### Connecting via Built-in Cloud Console

1. Click **Connect**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FFgISaUq408h57ezyca0z%2FconnectToTheConsole.jpg?alt=media&#x26;token=383aabd1-9d12-4d6b-b880-1203bef2530e" alt=""><figcaption><p>"Connect" button</p></figcaption></figure>

2. Select **VNC**. A new tab will open in your browser with console access.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F7IjyG0XawfopYipWYuh0%2FVNCConsole.jpg?alt=media&#x26;token=31c72ef4-7848-4c06-b83f-ddf529d14c9d" alt=""><figcaption><p>VNC Console</p></figcaption></figure>

### Connecting via SSH

{% hint style="info" %}
For more information on SSH connections, refer to [this set of articles](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/connecting-to-a-pbx-using-ssh). In this guide, we demonstrate SSH access via PowerShell.&#x20;
{% endhint %}

Enter the following command to connect via SSH:

```powershell
ssh -i C:\Users\username\.ssh\id_ed25519 root@ip-adress
```

Replace:

* `C:\Users\username\.ssh\id_ed25519` with the path to your SSH key,
* `root` if you changed the default user when creating the VM,
* `ip-adress` with the external IP address of your MikoPBX instance.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fk774iZwGWLFRRLlj6nvl%2FsshCommandPowerShell.jpg?alt=media&#x26;token=268c54db-643d-44a0-bbf0-6daf88d6b5c0" alt=""><figcaption><p>Command for SSH connection</p></figcaption></figure>

You will then connect via SSH:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fuk6rRSoa5hGifrqCCg0V%2FSSHConnection.jpg?alt=media&#x26;token=27a3cad2-f52e-490d-b845-9ee9fed861ce" alt=""><figcaption><p>SSH Connection</p></figcaption></figure>

## First Login to the Web Interface

On the VM’s main page, you’ll see important parameters for logging into the MikoPBX web interface.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Ftp21snOrXvJI7ZqwsSwy%2FauthorizationParametersEN.jpg?alt=media&#x26;token=f44fdd53-da8e-4ea8-adc9-86114ba35865" alt=""><figcaption><p>Authorization Parameters for the WEB-interface</p></figcaption></figure>

Paste the IP address into your browser’s address bar to access the MikoPBX web interface login page.

{% hint style="info" %}
&#x20;**Login credentials**:

* **Username**: admin
* **Password**: Your Virtual Machine’s ID
  {% endhint %}

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FVZri7YpSE99QDTsFrCy4%2FmikopbxWEB.jpg?alt=media&#x26;token=e947e4f9-051e-442b-8370-96b85d37df29" alt=""><figcaption><p>MikoPBX WEB-interface</p></figcaption></figure>
