HomeServiceContact
Drupal
min read
February 9, 2023
January 24, 2023

How to access a local Lando site on other devices

How to access a local Lando site on other devices
Table of contents

While working on one of the sites, I was facing responsive issues on mobile devices. It was annoying to deploy smaller changes to check on the actual device.

So I was looking for some tool/solution using which I could check the changes done on a local site immediately on the mobile device. 

I was using Lando on my local. So I searched for making Lando’s local site accessible on mobile devices within the same network. 

I found that there is a command, lando share, using which we can share our local site not only on the same network but over other networks as well (to your client too). But it is no longer functional though you can sponsor to make it functional again.

I continued searching if there was any other alternative solution, and found one. Please go through the explanation below for detailed steps. 


Make changes to access your site on mobile devices in the same network

First, we will need to change the bindAddress in the config.yml file. This file specifies the core configuration options for Lando. And it has nothing to do with your .lando.yml file. (Changing the Bind)

Then run the lando config command to check the location of the config.yml file on your machine.

Open the config.yml in your desired code editor. Initially, this file will be blank, with just opening and closing curly brackets.

Access Local Lando Site-1

Then add the following code in the same file and save it.


{
# Bind my exposes services to all interfaces
bindAddress: "0.0.0.0"
}
Access Local Lando Site-2

Go to your project directory and run the lando rebuild command so that these changes will take effect. 

After running lando rebuild, this file will look like this: 

Access Local Lando Site-3

As soon as you are done with it, find your IPv4 address.


Links to find your private IP address (IPv4 address)

Mac: How to Find Your IP Address on a Mac

Linux: How to Find your IP Address in Linux

Windows: How to Find an IP Address in Command Prompt or Find your IP address in Windows 


Access your site on the devices connected on the same network with: https://<ip_address>:<port_number>

Access Local Lando Site-4

So, if your IP address is 198.168.0.1 and your site’s port address is 59061, then hit the following URL in your device’s browser: https://198.168.0.1:59061 

Here's a screenshot of my local Lando site:

Desktop

Access Local Lando Site-5

iPhone and iPad

Access Local Lando Site-iPhone and iPad

Remove the bindAddress from config after use to avoid any security issues. 

Here is a link for quick Drupal site installation guide using Lando: Getting Started

Other References:

  1. Accessing Lando from Other Devices on Your Local Network
  2. Security
  3. Global Config


By following the steps mentioned above, you can access your local Lando site on any device within the same network with a few changes in the Lando's config file.

Written by
Artwork by
No art workers.
We'd love to talk about your business objectives