DEV Community

Will Ceolin
Will Ceolin

Posted on

How to run a local Phoenix app on another machine

When you create a new Phoenix app, it uses the 127.0.0.1 IP address by default. To run it locally on another machine (e.g. your phone), you need to change this on config/dev.exs.

Find the http config on that file. You’ll see something like this:

http: [ip: {127, 0, 0, 1}, port: 4000]
Enter fullscreen mode Exit fullscreen mode

Now, change it to:

http: [ip: {0, 0, 0, 0}, port: 4000]
Enter fullscreen mode Exit fullscreen mode

That’s it! Now you’ll be able to test your Phoenix app locally on other machines by using your network’s IP address.

Top comments (0)