# Installing the system on a USB drive (Bootable USB)

Before starting, download the disk image file with the `.raw` extension. You can do this [here](https://www.mikopbx.com/download/).

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

## Installing the system on a USB drive

### Windows

{% hint style="danger" %}
The USB drive must be at least 1 GB in size. **All data on the USB drive will be deleted!**
{% endhint %}

This guide uses the **balenaEtcher** utility. You can download it [here](https://etcher.balena.io/).

1. First, format your USB drive with the following parameters:

* **File system** - FAT32
* **Allocation unit size** - 8192 bytes

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FUVX9HawvZKrjZUMSVNpo%2FformatFlashUSB.png?alt=media&#x26;token=c3c34f99-f522-4aea-80ea-36fd954c9061" alt=""><figcaption><p>Formatting USB drive</p></figcaption></figure>

2. Open **balenaEtcher**. Click "**Flash from file**" and select the previously downloaded `.raw` file.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FpN06FBWtuEPQSsgOtev2%2FbEflashFromFile.png?alt=media&#x26;token=26c11be5-0b31-4775-898a-4cb28f1873c9" alt=""><figcaption><p>"Flash from file" button</p></figcaption></figure>

3. Click "**Select target**".

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FLgS52lFO5zfScui6Yx6I%2FbEselectTarget.png?alt=media&#x26;token=0cc5a7df-925d-4124-b18d-059104c4b08e" alt=""><figcaption><p>"Select target" button</p></figcaption></figure>

4. From the list, select your USB drive. Then click "**Select 1**".

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FZyFO8fAkMuuuXs2zBrTg%2FbEselectTargetDialog.png?alt=media&#x26;token=2b311702-8a0f-4b03-9879-a6b54cca82a8" alt=""><figcaption><p>Selecting the disk for writing</p></figcaption></figure>

5. Next, click "**Flash!**"

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FNIacl8UrD3GqmZ3TFOEL%2FbEflash!.png?alt=media&#x26;token=35c50fbd-f03c-45a4-82d3-1c39546b8a26" alt=""><figcaption><p>"Flash!" button</p></figcaption></figure>

Wait for the process to complete. Then proceed to the section ["Booting from USB drive"](#booting-from-usb-drive).

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FnfyezOiB1W2MdscYRl3J%2FbEflashComplete.png?alt=media&#x26;token=d958994e-d334-48dd-ade4-5a8db4fac03f" alt=""><figcaption><p>Successfully writed image</p></figcaption></figure>

### MacOS

1. Connect your USB drive and open the Terminal.

{% hint style="danger" %}
The USB drive must be at least 1 GB in size. **All data on the USB drive will be deleted!**
{% endhint %}

2. Run the following command:

```bash
diskutil list
```

This command displays all connected disks. Look for the disk labeled **(external, physical)**.\
In our case, it is **disk4** (the number may differ on your system). Use this number in the following steps.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FBK1agj77XpXFzw0zJS8z%2FdiskutilListNew.png?alt=media&#x26;token=6f1c6411-4c4b-4a38-b678-4bdfecd8d86e" alt=""><figcaption><p>List of all available disks</p></figcaption></figure>

3. Next, format the USB drive using this command:

```bash
sudo diskutil eraseDisk FAT32 NONAME MBRFormat /dev/disk4;
```

{% hint style="danger" %}
**All data on the disk will be deleted!** Double-check the disk name before formatting!
{% endhint %}

Enter your administrator password when prompted and wait for the formatting to complete.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FV7UgkwDSERYWi9CCbWEZ%2FeraseDiskUtil.png?alt=media&#x26;token=641b7421-63b6-4c1e-8c8e-eb8c9cc01385" alt=""><figcaption><p>Formatting the disk</p></figcaption></figure>

4. Unmount (disconnect) the disk using the following command:

```bash
sudo diskutil unmountDisk /dev/disk4;
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FEX3oPScX4xKq6vrDw5lO%2Funmount.png?alt=media&#x26;token=8ce5628a-3be5-4789-a7c4-7bb2f47f2124" alt=""><figcaption><p>unmountDisk command</p></figcaption></figure>

5. Write the image to the USB drive using this command:

```bash
sudo dd if=mikopbx-2024.1.114-x86_64.raw of=/dev/disk4 bs=1m;
```

Wait for the writing process to complete. Then proceed to the section ["Booting from USB drive"](#booting-from-usb-drive).

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fd60dGn4WL91IAcwyeoro%2FddWriteRaw.png?alt=media&#x26;token=10414a81-b909-447c-8da6-81af38eb446c" alt=""><figcaption><p>Successfully writed image</p></figcaption></figure>

### Linux

In this example, the image writing process will be demonstrated on Ubuntu 24.04.

1. Connect your USB drive and open the Terminal.

{% hint style="danger" %}
The USB drive must be at least 1 GB in size. **All data on the USB drive will be deleted!**
{% endhint %}

2. Run the following command:

```bash
lsblk
```

This command displays information about all connected disks. Find your USB drive in the list and note its name. In our case, it is **sdb**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fs1BOv4nfoTO7gloDkc2J%2FlsblkCommand.png?alt=media&#x26;token=21fb55bc-00b6-44c5-9cb9-cc14c1bfa152" alt=""><figcaption><p>"lsblk" command</p></figcaption></figure>

3. Next, format the USB drive using this command:

```bash
sudo mkfs.vfat -F 32 -n NONAME /dev/sdb
```

{% hint style="danger" %}
**All data on the disk will be deleted!** Double-check the disk name before formatting!
{% endhint %}

Enter your administrator password when prompted and wait for the formatting to complete.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FNuUFOaLo5KpxQoXVDY6t%2FformatDisk(mkfs.vfat).png?alt=media&#x26;token=dc51ff4c-4aa8-4ddf-8e12-ed2d27ccc055" alt=""><figcaption><p>Formatting the disk</p></figcaption></figure>

4. Unmount (disconnect) the disk using this command:

```bash
sudo umount /dev/sdb*
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FRVi5Jt2QBkevPNInfHuS%2FumountCommand.png?alt=media&#x26;token=3d9b9294-d631-432f-87c1-e953d4486d84" alt=""><figcaption><p>"umount" command</p></figcaption></figure>

5. Write the image to the USB drive using this command:

```bash
sudo dd if=mikopbx-2024.1.114-x86_64.raw of=/dev/sdb bs=1M
```

Wait for the process to complete. Then proceed to the section ["Booting from USB drive"](#booting-from-usb-drive).

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FDmLahcJImbg73peMBV1e%2FsuccessfulWritedImage(Ubuntu)raw.png?alt=media&#x26;token=bda3b607-133f-4fd6-a4be-cd039055c752" alt=""><figcaption><p>Successfully writed image</p></figcaption></figure>

## Booting from USB drive

1. Boot from the USB drive. If errors occur (black screen), make sure that:

* **Secure Boot** - Disabled
* **CSM (Compatibility Support Module)** - Enabled

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FkX09kjBEATkc3Fv5iKLA%2FmikopbxStorageNotConnected.jpg?alt=media&#x26;token=53c34163-4d14-4590-8c6d-eefed2320863" alt=""><figcaption><p>Booting from USB drive</p></figcaption></figure>

2. The system has successfully booted, but no drive is connected for storing call recordings. To connect it, use the arrow keys to navigate to "**\[6] Data storage**" and press **Enter**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FjlRkO7qGPcH7tZZWNLy0%2FDataStorageSection.jpg?alt=media&#x26;token=a7065dde-efea-43f7-9bf8-bd7fb2c20dfb" alt=""><figcaption><p>"<strong>[6] Data Storage</strong>" section</p></figcaption></figure>

3. Then select "**Mount drive as data storage**" to connect the disk.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FJSw6EAdWRSmqt9lHRR2R%2FchooseAnActionDisk.jpg?alt=media&#x26;token=18f9988c-7324-4117-b721-894863f18109" alt=""><figcaption><p>"<strong>Mount drive as data storage</strong>" option</p></figcaption></figure>

4. Select the disk that will be used to store call recordings. Enter its ID (name), for example **sdc** in our case, and press **Enter**.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fr1bRjKhmODolnxi08Xfb%2FchooseTheDisk.jpg?alt=media&#x26;token=82de202b-3e60-42b1-8a88-be7749cff3ba" alt=""><figcaption><p>Selecting the disk</p></figcaption></figure>

5. After this, the system will reboot and will be ready for use and for the first login to the Web interface.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fa50PZjYalYDeKHdaw6CN%2FMikoPBXSystemReady.jpg?alt=media&#x26;token=2c7cd4f0-1bec-4fe8-8832-11fd3305b6b2" alt=""><figcaption><p>Successfully installed MikoPBX system</p></figcaption></figure>

To open the Web interface, enter your MikoPBX IP address in your browser’s address bar.\
Use the default login credentials.

{% hint style="success" %}
Default credentials for first login to the Web interface:

Login: admin\
Password: admin
{% endhint %}

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FiX2NwOulUj1jV0IjDFpW%2FMikoPBXweb.jpg?alt=media&#x26;token=263b7061-e0d2-4e15-88e6-a29cf5653c96" alt=""><figcaption></figcaption></figure>
