DEV Community

Will Ceolin
Will Ceolin

Posted on

1

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay