Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lutkabe's avatar

How to Access My Laravel App With the Host Server's IP Address?

When I use the host server's IP address in a browser the default Forge site is loaded. How to access my app using the server's IP address?

0 likes
4 replies
Snapey's avatar

The server will be using virtual host so relies on the domain name being present in the headers of the request.

For you to access the server by name, create an entry in your local hosts file.

x.x.x.x sitename.tld

obviously put the forge IP address as x.x.x.x and your website url as sitename.tld

lutkabe's avatar

Using a domain name is not an option. As stated in the question, needed to access the site by IP address.

The Forge "default" site is accessible by IP address. In other words, the server's IP address points to the Forge "default" site which brings up a simple informational page. Is it possible or is there any easy way to replace the "default" site with my Laravel app?

Thanks for you time.

nigelhv's avatar

I may be trying to accomplish something similar, with a similar set of problems, so I'm interested to hear if you've made progress.

In my case I'm trying to set up a fresh server with and upgraded version of an existing site that is in use. My idea was to set up the server with the updated code (particularly latest Laravel, MySQL, etc), test it using its IP address then switch the DNS when everything is working nicely.

I'm using Digital Ocean and Forge for the new site, I've removed the "default" site that Forge sets up and deployed the code to a folder with the site's ultimate domain name.

At the moment the new site just responds with a 444 page.

Please or to participate in this conversation.