How-to: Set Up MikroTik Back To Home via RouterOS

In this guide, you'll set up MikroTik Back To Home from WinBox, WebFig or the RouterOS CLI, create a user and connect your phone with a QR code.

Note: Back To Home only runs on MikroTik devices with an ARM, ARM64 or TILE CPU, on RouterOS 7.12 or later. Such architecture can be found in most of the recent Mikrotik devices, or older higher-end devices. The commands below use the current names: the Back To Home users manager arrived in 7.14, the command was called back-to-home-users until 7.17 and became back-to-home-user in 7.18, and file access also needs 7.18 or later.

Everything below can be done in WinBox, WebFig or the terminal. Each step shows the WinBox path first and the CLI commands after it. Prefer the phone app for the whole setup? See How-to: Set Up MikroTik Back To Home via the BTH App.

1
Enable Back To Home on the router

Go to IP > Cloud and enable DDNS.

Note: RouterOS 7.16 and older need DDNS enabled by hand before Back To Home will work. From 7.17 the DDNS setting defaults to auto and DDNS switches on when you enable Back To Home, so you can skip this step there. Setting it to yes does no harm on any version.

WinBox IP > Cloud window with DDNS enabled

Open the BTH VPN tab, enable Back To Home VPN and click Apply. Give the router a moment to finish the DDNS and Back To Home configuration: it's ready when vpn-status shows running.

WinBox IP > Cloud window, BTH VPN tab with Back To Home VPN enabled

Or do the same in the terminal:

ROUTEROS CLIip cloud set ddns-enabled=yes
ip cloud set back-to-home-vpn=enabled
# check the status, wait until vpn-status shows running
ip cloud print

2
Create a Back To Home user

Every device you connect needs its own user, because one user's configuration works on one device at a time. In the Cloud window, open Back To Home Users from the side menu and click New. Tick Allow LAN if you want this user to reach your home network too. Name the user and click Apply.

WinBox Back To Home user dialog with the name field and the Allow LAN optionIn the terminal, the same user with LAN access looks like this:

ROUTEROS CLI# allow-lan=yes lets the user reach the local network
ip cloud back-to-home-user add name="user1" allow-lan=yes

3
Give the user file access (optional)

If the user needs to reach files on the router, or to have a way to share files with you, open the File Access tab, choose Full or Read-only (or disable it), enter the folder path and click Apply. Use a folder that exists: the router accepts a path that doesn't exist without complaining, and the share then points at nothing.

WinBox Back To Home user dialog, File Access tab with the access level and folder path fields

Important: Pick a dedicated folder for file sharing, never the router root (/). Root exposes system files and lets whoever uses the tunnel see any backup files and any other critical files. it is also possible to install malicious scripts.

In the terminal, add file access when you create the user:

ROUTEROS CLI# file-access sets Full or Read-only, file-access-path is the folder
ip cloud back-to-home-user add name="user1" allow-lan=yes file-access=full file-access-path=<Path in Mikrotik Files>

To give file access to a user that already exists, print the users, note the user number and set it:

ROUTEROS CLI# list all Back To Home users and their numbers
ip cloud back-to-home-user print
# <usernum> is the number of the user
ip cloud back-to-home-user set <usernum> file-access=full file-access-path=<Path in Mikrotik Files>

4
Import the user on your phone

After you apply the user settings, a configuration menu opens. Scroll down to the QR code, which you scan with the phone.

WinBox Back To Home user configuration with the QR code

In the terminal, this prints the user's configuration and the QR code:

ROUTEROS CLI# <usernum> is the number of the user
ip cloud back-to-home-user show-client-config <usernum>
Note: If the QR code won't scan, switch your terminal or WinBox to light mode, resize the code, or adjust the screen brightness.

On the phone, open the Back to Home app, tap Join Shared, then Scan QR Code.

Back To Home app home screen with the Join Shared option and the Scan QR Code button

Scan the QR code, name the tunnel and tap Import.

Back To Home app import screen with the tunnel name field and the Import button

The imported tunnel now shows on the app's home screen, ready to connect.

Back To Home app home screen with the imported tunnel ready to connect

Note: The app imports the tunnel with management privileges, which needs a RouterOS user account with full management. it is only needed when creating, managing or sharing other tunnels via the Back To Home App.

To add more users, change their access or set an expiry date, see How-to: Create and share users in MikroTik Back To Home.

No MikroTik router at home? BGOCloud's MikroTik VPS plans give you a CHR with a public IP, a good fit for a WireGuard or OpenVPN server you can reach from any device, as well as have the power for hosting containers and apps inside your CHR.

You can also browse our full MikroTik CHR knowledge base for more guides on getting the most out of your router.

Discover the simplicity of MikroTik VPS with our automatic setup process - your network operational in under one minute!

Get Started!
icon knowledge

Related Articles

Connecting Android and IOS to WireGuard VPN hosted in MikroTik

This guide covers connecting your Android or iPhone to a WireGuard VPN server running on a...

Troubleshooting OpenVPN Server issues on a MikroTik CHR

Fix the most common OpenVPN server errors on a MikroTik CHR. Each one below has the error text...

How-to: Set Up MikroTik Back To Home via the BTH APP

In this guide, you'll set up MikroTik Back To Home from the BTH app: create a WireGuard tunnel...

How-to: Create and share users in MikroTIk Back To Home

Back To Home users let you share your home network with family, friends and your own devices,...