The following instructions are for browsing your DevKinsta-created site on another device on the same network.
- This tutorial includes advanced topics, including editing firewall rules and configuration. If you’re not comfortable making these changes or have any trouble loading your local site, we recommend working with a developer or IT professional to set this up.
- All involved devices must be connected to the same private network.
- This can only work on one site at a time.
- Site loading order is based on the site names and configuration files in /etc/nginx/sites in the devkinsta_nginx container. To change which site loads, rename it in DevKinsta or rename its configuration file to be first alphabetically.
- Network Firewall exceptions for the HTTP/HTTPS ports (usually 80/443) may need to be made on the host machine.
Find the Host Device’s Network IP Address
You can find the host device’s IP address using several methods.
Opening this IP address in your browser on any device on the network should load the first site listed alphabetically in DevKinsta.
If the site doesn’t load, there is likely a firewall blocking access to HTTP/HTTPS. In this case, new firewall rules will need to be added to open the ports. Here are links to instructions on doing that in Windows, macOS, and Ubuntu.
- How To Open a Port in Windows Firewall
- Set firewall access for services and apps (macOS)
- Enable or block firewall access (Ubuntu)
Update wp-config.php to Allow Normal Navigation Using the IP Address
Once the page is loaded, you may notice broken stylesheets/assets or non-working links. This is due to accessing the site with the IP address instead of the .local domain. A quick way to get around this is by adding the following snippet in your site’s wp-config.php file above the “That’s all, stop editing” line:
define( 'WP_HOME', 'https://'.$_SERVER['HTTP_HOST'] );
define( 'WP_SITEURL', 'https://'.$_SERVER['HTTP_HOST'] );
In each value, you can replace https with http if needed, depending on how your local development environment is configured. Remember that if you try to access the IP Address using HTTPS, the site will show as insecure.
Now you should be able to view your local site on another device on the same network.