Colonel Serveur
Installing MikroTik on Ubuntu

Installing MikroTik on Ubuntu is a practical solution for users who want to run MikroTik RouterOS CHR on a VPS ou dedicated server where direct ISO mounting is not available. By using Ubuntu as the base operating system and deploying MikroTik through virtualization, it becomes possible to access advanced routing and firewall features without changing the server’s primary OS.

This guide explains how to install MikroTik on Ubuntu in a step-by-step manner, utilizing an automated script specifically designed for real-world server environments. The process is suitable for network administrators, DevOps engineers, and advanced users who need a reliable MikroTik setup on Linux infrastructure.

Installing MikroTik on an Ubuntu Server

Installing MikroTik on Ubuntu is achieved by running MikroTik CHR inside a virtualized environment powered by QEMU.

“MikroTik Cloud Hosted Router (CHR) is a RouterOS version designed to run as a virtual machine on hypervisors, allowing full routing functionality without dedicated hardware.”_ MikroTik Documentation

This method allows Ubuntu to remain installed while MikroTik RouterOS operates as a dedicated virtual router with full network capabilities. It is especially useful on VPS platforms that restrict ISO attachment or custom boot images.

Before proceeding, it is important to understand that this method modifies disk partitions and network settings. For that reason, the installation should only be performed on a fresh Ubuntu server or a system where all important data has been fully backed up.

Wordpress Hosting

Hébergement Web WordPress

À partir de 3,99 $ / mensuel

Acheter maintenant

Installing MikroTik on an Ubuntu Server

Prerequisites for Installing MikroTik on Ubuntu

Before you install MikroTik on Ubuntu, the server must meet several basic requirements to ensure a stable and predictable deployment. These prerequisites are essential for avoiding data loss and network misconfiguration during the setup process.

The installation environment should meet the following conditions:

  • A VPS or dedicated server running Ubuntu 20.04 or Ubuntu 22.04, both of which have been tested with this method
  • Active internet connectivity to download MikroTik CHR and required packages
  • Root or sudo access to the server
  • No critical data is stored on the server, as disk partitions may be overwritten

This installation approach uses QEMU-based virtualization, allowing MikroTik CHR to run independently while Ubuntu remains the host operating system.

Automated Script Method to Install MikroTik on Ubuntu

The easiest and most reliable way to install MikroTik on Ubuntu is by using an automated installation script. This script handles package installation, virtualization setup, disk preparation, and MikroTik CHR deployment without requiring manual configuration at each step.

This approach is particularly valuable when ISO-based installation is not possible, which is a common limitation on many VPS providers.

Cheap VPS

Serveur VPS pas cher

À partir de 2,99 $/mois

Acheter maintenant

Updating Ubuntu Before Installation

Before running the script, the Ubuntu system must be fully updated to avoid dependency conflicts and ensure compatibility with virtualization packages. This step prepares the operating system for a clean MikroTik installation process.

sudo apt update && sudo apt upgrade -y

Completing this update ensures that all core packages and security components are in a stable state before MikroTik is deployed.

Updating Ubuntu Before MikroTik Installation

Downloading and Running the MikroTik Installation Script

To install MikroTik on Ubuntu automatically, the script must be downloaded, granted execution permission, and then run with administrative privileges. This single command performs all three actions in sequence.

curl -sSL https://dl.hidata.org/scripts/MikrotikUbuntu.sh -o MikrotikUbuntu.sh && chmod +x MikrotikUbuntu.sh && sudo ./MikrotikUbuntu.sh

It is critical to copy and execute the command exactly as written, since partial execution may result in an incomplete installation. During execution, the script installs required dependencies, configures QEMU, downloads MikroTik CHR from official sources, and prepares the virtual router environment.

After the script completes successfully, MikroTik RouterOS will start automatically.

Windows VPS

Hébergement VPS Windows

Remote Access & Full Admin

Acheter maintenant

Default Login Credentials After Installation

Once you install MikroTik on Ubuntu using this method, the router becomes accessible immediately. The default login credentials are intentionally minimal to allow initial access without restrictions.

  • Username: admin
  • Password: empty (no password set)

Pour des raisons de sécurité, changing the password immediately after first login is strongly recommended.

Troubleshooting After Script Execution

In some cases, MikroTik may not load immediately after the script finishes. This behavior is usually related to how the VPS provider handles virtualization and boot processes.

If MikroTik does not start:

  • Power off the server completely from the VPS control panel
  • Start the server again instead of using a soft reboot.

This ensures that all virtualization components initialize correctly.

Alternative Script-Based Installation Method

Another approach to installing MikroTik on Ubuntu involves manually downloading and executing a different installer script. While the core principle remains the same, this method provides users with greater visibility into each step of the process.

Creating and Preparing the Installation Script

The script must first be downloaded directly to the Ubuntu server. This file contains all commands required to deploy MikroTik CHR within the Linux environment.

wget http://dl.xvps.ir/mikrotik-installer.sh

After downloading the script, execution permissions must be assigned. Ubuntu does not allow scripts to run unless explicitly permitted by the administrator.

chmod 755 mikrotik-installer.sh

Once permissions are set, the installation process can begin.

./mikrotik-installer.sh

After execution completes, the server must be restarted to apply all changes and finalize the MikroTik setup.

Accessing MikroTik After Installation

Following the reboot, MikroTik RouterOS becomes available. Login credentials are defined by the script configuration and should be reviewed immediately upon access.

A ce stade, MikroTik operates fully inside the Ubuntu-based virtual environment and can be managed using standard MikroTik tools such as WinBox, SSH, or console access.

Licensing Considerations for MikroTik CHR

When you install MikroTik on Ubuntu, the CHR version runs with limited functionality until a license is applied. MikroTik CHR does not offer unrestricted free usage, and performance limits apply without activation.

Available license levels include:

  • Level 4 for basic routing needs
  • Level 5 for higher throughput
  • Level 6 for maximum performance and full feature access

Selecting the appropriate license depends on traffic volume, routing complexity, and production requirements.

Licensing Considerations for MikroTik CHR

Important Notes Before Running Installation Scripts

Installing MikroTik on Ubuntu using automated scripts involves direct interaction with storage devices and network interfaces. These actions must be performed carefully to avoid unintended consequences.

Keep the following points in mind:

  • The script may overwrite disk data, commonly targeting /dev/sda
  • Existing partitions and files can be permanently removed.
  • Network settings are modified during setup.
  • Scripts should always be reviewed before execution.

Running such scripts on production systems without backups is strongly discouraged.

Conclusion

Installing MikroTik on Ubuntu is a powerful solution for deploying MikroTik RouterOS CHR on VPS and serveurs cloud where traditional installation methods are unavailable. By leveraging virtualization through QEMU and automated scripts, users can achieve a fully functional MikroTik environment with minimal manual intervention.

This method significantly reduces setup complexity, saves time, and enables advanced routing capabilities on Linux-based infrastructure. When performed on a clean Ubuntu server with proper backups, installing MikroTik on Ubuntu becomes a reliable and efficient approach for modern network deployments.

Frequently Asked Questions About Installing MikroTik on Ubuntu

Can I install MikroTik directly on Ubuntu without virtualization?

Non, MikroTik RouterOS cannot be installed natively on Ubuntu because it is a standalone operating system, not a Linux package.

Is installing MikroTik on Ubuntu safe for production servers?

Installing MikroTik on Ubuntu can be safe for production use only if it is performed on a clean server with no critical data.

Which Ubuntu versions are supported for installing MikroTik?

The most reliable results for installing MikroTik on Ubuntu are achieved with Ubuntu 20.04 et Ubuntu 22.04. These versions are widely supported, écurie, and compatible with the required virtualization packages used to run MikroTik CHR.

Do I need a MikroTik license after installation?

Oui, MikroTik CHR requires a valid license to unlock full functionality. Sans permis, the router operates under strict limitations. Depending on your traffic and performance requirements, you can choose between Level 4, Level 5, or Level 6 licence.

What should I do if MikroTik does not start after running the script?

If MikroTik does not load immediately after installation, the issue is usually related to how the VPS initializes virtualization services. Dans de tels cas, powering off the server completely from the VPS control panel and then starting it again often resolves the problem.

Partager cette publication

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *