How to Convert Ubuntu to MikroTik CHR (Step-by-Step Guide)

Important: This process completely replaces Ubuntu with MikroTik Cloud Hosted Router (CHR). All existing data on the server will be erased. Before proceeding, create a backup of any important files and ensure you have access to your VPS provider's VNC, HTML5, or Serial Console.

Prerequisites

Before you begin, make sure you have:

  • An Ubuntu VPS (18.04, 20.04, 22.04, or later)
  • Root or sudo access
  • Console access from your VPS provider
  • A stable internet connection

Step 1: Log in to Your Ubuntu Server

Connect to your server using SSH.

 
ssh root@YOUR_SERVER_IP
 

If you're using a non-root user, switch to root:

 
sudo -i
 

Verify you're logged in as root:

 
whoami
 

Expected output:

 
root
 

Step 2: Identify Your System Disk

Before writing the CHR image, determine which disk Ubuntu is installed on.

Run:

 
lsblk
 

Example:

 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 49G 0 part /
 

Your primary disk may be:

  • /dev/sda
  • /dev/vda
  • /dev/nvme0n1

Note: Remember the correct disk name. Using the wrong disk will erase the wrong storage device.


Step 3: Update Ubuntu

Update package information.

 
apt update
 

(Optional)

 
apt upgrade -y
 

Step 4: Install Required Packages

Install tools needed to download and extract the CHR image.

 
apt install wget unzip -y
 

Step 5: Download MikroTik CHR

Visit the MikroTik download page and choose the latest Stable CHR image.

Example:

 
wget https://download.mikrotik.com/routeros/7.15.3/chr-7.15.3.img.zip
 

You can replace the version number with the latest available release.


Step 6: Extract the Image

 
unzip chr-7.15.3.img.zip
 

After extraction, you should see:

 
chr-7.15.3.img
 

Step 7: Prepare the Disk

Flush pending writes and make the filesystem read-only.

 
echo u > /proc/sysrq-trigger
 

This command helps reduce the risk of filesystem corruption before overwriting the disk.


Step 8: Write the CHR Image to Disk

If your system disk is /dev/sda

 
dd if=chr-7.15.3.img of=/dev/sda bs=4M oflag=sync status=progress
 

If your system disk is /dev/vda

 
dd if=chr-7.15.3.img of=/dev/vda bs=4M oflag=sync status=progress
 

If your system disk is /dev/nvme0n1

 
dd if=chr-7.15.3.img of=/dev/nvme0n1 bs=4M oflag=sync status=progress
 

Wait until the process finishes completely.


Step 9: Sync Data

Ensure all data is written to the disk.

 
sync
 

Step 10: Reboot the Server

 
reboot -f
 

Your SSH connection will disconnect.


Step 11: Access MikroTik CHR

Open your VPS provider's control panel and launch:

  • VNC Console
  • HTML5 Console
  • Serial Console

Depending on your provider.

You should see the MikroTik login prompt.


Step 12: Default Login Credentials

 
Username: admin
Password: (leave blank)
 

Press Enter.

On the first login, MikroTik will prompt you to create a new password.


Step 13: Configure Networking

Check available interfaces

 
/interface print
 

Most providers use ether1.


If Your Provider Uses DHCP

 
/ip dhcp-client add interface=ether1 disabled=no
 

Verify the assigned IP:

 
/ip address print
 

If Your Provider Uses a Static IP

Assign your IP address.

 
/ip address add address=YOUR_IP/PREFIX interface=ether1
 

Add the default gateway.

 
/ip route add gateway=YOUR_GATEWAY
 

Configure DNS.

 
/ip dns set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes
 

Test connectivity.

 
ping 8.8.8.8
 

Step 14: Enable SSH

Check the SSH service.

 
/ip service print
 

Enable it if necessary.

 
/ip service enable ssh
 

Step 15: Access CHR via SSH

Once networking is configured, connect using:

 
ssh admin@YOUR_SERVER_IP
 

Common Issues

SSH Does Not Work

  • Verify your IP configuration.
  • Check the gateway.
  • Ensure SSH is enabled.
  • Use the VPS console for troubleshooting.

No Network Interface Found

Run:

 
/interface print
 

Some virtual environments may use different interface names.


Server Boots Back Into Ubuntu

This usually indicates the disk image was written to the wrong device. Verify the correct disk using:

 
lsblk
 

and repeat the installation.


VPS Does Not Boot

Use your VPS provider's recovery mode or rescue system to reinstall the operating system.


Conclusion

After completing these steps, Ubuntu will be replaced with MikroTik Cloud Hosted Router (CHR). You can now manage your router through SSH or WinBox, configure networking, routing, firewall rules, VPNs, VLANs, and other RouterOS features.

  • 0 Users Found This Useful
Was this answer helpful?