This is a Bash script to automate the installation of Mikrotik WinBox4 on Linux distributions. The script downloads the official WinBox4 binaries, sets up a symlink for easy access, creates a desktop entry, and attempts to migrate previous WinBox data if available.
- Downloads the official Mikrotik WinBox4 binaries.
- Unpacks the archive and installs it to
/opt/winbox4. - Creates a symlink to
winboxin/usr/local/binfor easy terminal access. - Adds a desktop entry in
/usr/share/applicationsfor launching from the application manager. - Migrates previous
Addresses.cdbdata from older installations (if found). - Automatically checks the Mikrotik download page for updated versions of WinBox4.
- Avoids overwriting existing symlinks, desktop entries, and data.
- Linux distribution.
- Must be run as
rootor withsudoprivileges to modify system directories. wgetandunzipmust be installed on the system.
-
Clone the repository:
git clone https://github.com/edyatl/winbox4-install-helper.git
-
Navigate to the repository directory:
cd winbox4-install-helper -
Make the script executable:
chmod +x winbox4_install.sh
-
Run the script as root:
sudo ./winbox4_install.sh
- Download: It downloads the official Mikrotik WinBox4 archive from the Mikrotik website.
- Install: Unpacks the downloaded archive and moves it to
/opt/winbox4. - Symlink: Creates a symlink from
/opt/winbox4/WinBoxto/usr/local/bin/winboxfor easy command-line access. - Desktop Entry: Adds a
.desktopentry in/usr/share/applications/winbox4.desktopto allow launching WinBox from the application menu. - Data Migration: Attempts to find previous
Addresses.cdbdata in~/.winbox/drive_c/users/<user>/AppData/Roaming/Mikrotik/Winbox/Addresses.cdband copies it to the new installation at~/.local/share/MikroTik/WinBox/Addresses.cdb. - Version Check: Automatically checks the Mikrotik download page for new versions of WinBox4 and updates the installation if a new version is found.
- Avoids Overwriting: If any symlink, desktop file, or address database already exists, the script skips these steps.
To completely uninstall WinBox4, you can use the provided uninstall script winbox4_uninstall.sh:
-
Make the script executable:
chmod +x winbox4_uninstall.sh
-
Run the script as root:
sudo ./winbox4_uninstall.sh
- Removes the symlink: Deletes the symlink
/usr/local/bin/winboxused to launch WinBox from the terminal. - Removes the desktop entry: Deletes the
.desktopfile at/usr/share/applications/winbox4.desktopused to launch WinBox from the application menu. - Removes the installation directory: Deletes the WinBox4 installation folder located at
/opt/winbox4. - Preserves user data: The script does not automatically delete your saved
Addresses.cdbfile. It will notify you if the file is found at$HOME/.local/share/MikroTik/WinBox/Addresses.cdb, allowing you to decide if you want to remove it manually.
If you wish to remove your saved addresses and configuration data, you can manually delete the file:
rm -rf ~/.local/share/MikroTik/WinBoxAfter running the uninstall script and optionally removing user data, WinBox4 will be fully removed from your system.
To uninstall WinBox4 without uninstall script, you can manually remove the following:
-
Remove the symlink:
sudo rm /usr/local/bin/winbox
-
Remove the installation directory:
sudo rm -rf /opt/winbox4
-
Remove the desktop entry:
sudo rm /usr/share/applications/winbox4.desktop
To update WinBox4 to a new version, first run the uninstall script, then reinstall the latest version using the install script:
sudo ./winbox4_uninstall.sh && sudo ./winbox4_install.shThis ensures that the previous installation is completely removed before installing the updated version. The script will automatically download the latest WinBox4 version available from Mikrotik’s official download page.
-
2026-02-03:
- Added automated testing for WinBox4 Linux download link extraction.
- Introduced a GitHub Actions workflow to verify the download link against the Mikrotik website on a daily schedule.
- The test reuses the link extraction logic from the install script to detect upstream page changes early.
- Added automated testing for WinBox4 Linux download link extraction.
-
2026-02-01:
- Updated WinBox4 Linux download link extraction logic after MikroTik page change.
- Adjusted the parsing command to extract the download URL directly from the
hrefattribute. - Improved resilience against changes in the Mikrotik download page structure, including dynamic modal-based markup.
- Adjusted the parsing command to extract the download URL directly from the
- Updated WinBox4 Linux download link extraction logic after MikroTik page change.
-
2024-09-30:
- Updated the command used to fetch the latest WinBox4 Linux download link from the Mikrotik website.
- Adapted the script to handle changes in the Mikrotik download page HTML structure.
- The download link extraction now reliably matches the
<a>tag with the keyword 'Linux' without depending on surrounding text like '64-bit'.
- Updated the command used to fetch the latest WinBox4 Linux download link from the Mikrotik website.
-
2024-09-10:
- Improved handling of
$HOMEand user environment when running the script withsudo:- The script now correctly identifies the original user invoking
sudousing theSUDO_USERenvironment variable. - Updated file paths for downloading WinBox4 and migrating
Addresses.cdbto reflect the original user's home directory, ensuring correct ownership and avoiding root's home. - Adjusted the
xdg-user-dircall to use the original user’s environment by running it withsudo -u $ORIGINAL_USER. - Ensured file operations like
wget,unzip,mkdir, andcpare executed as the original user to avoid permission issues.
- The script now correctly identifies the original user invoking
- Applied similar changes to the uninstall script to handle user-specific data correctly during the uninstallation process.
- Improved handling of
-
2024-09-09:
- Added automatic checking of new WinBox4 versions from the Mikrotik download page.
- Improved script to detect and update the latest download link.
-
2024-09-07:
- Initial release with features to automate WinBox4 installation.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.