Logo

dev-resources.site

for different kinds of informations.

How to run a local Phoenix app on another machine

Published at
5/8/2024
Categories
phoenix
elixir
Author
wceolin
Categories
2 categories in total
phoenix
open
elixir
open
Author
7 person written this
wceolin
open
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.

phoenix Article's
30 articles in total
Favicon
Pseudolocalization in Phoenix with gettext_pseudolocalize
Favicon
Unlocking the Power of Elixir Phoenix and Rust: A Match Made for High-Performance Web Applications
Favicon
Sql commenter with postgrex
Favicon
Phoenix LiveView is slot empty?
Favicon
Bridging the Gap: Simplifying Live Component Invocation in Phoenix LiveView
Favicon
Find and Fix N+1 Queries Using AppSignal for a Phoenix App in Elixir
Favicon
Managing Distributed State with GenServers in Phoenix and Elixir
Favicon
Complete Guide: Setting up VS Code for Elixir and Phoenix Development
Favicon
A Complete Guide to Phoenix for Elixir Monitoring with AppSignal
Favicon
Better LiveView Hooks with Typescript
Favicon
Scaling Your Phoenix App in Elixir with FLAME
Favicon
Running Elixir Phoenix on Windows
Favicon
How to use gettext in phoenix?
Favicon
Custom Instrumentation for a Phoenix App in Elixir with AppSignal
Favicon
Building a Table of Contents Component for a Phoenix Blog
Favicon
Mastering Phoenix Framework - Part 2
Favicon
Mobile app development with LiveView Native and Elixir. Part - 3
Favicon
How to integrate Tabler Icons into your Phoenix project
Favicon
Mobile app development with LiveView Native and Elixir. Part - 2
Favicon
Mobile app development with LiveView Native and Elixir
Favicon
(Unofficial) Getting Started with Elixir Phoenix Guide
Favicon
Using Ecto (without Db) for validating Phoenix form
Favicon
API Prototypes with dbb: Another step to better prototypes
Favicon
Adding stream_async() to Phoenix LiveView
Favicon
SaladUI - Implement avatar component for Phoenix LiveView
Favicon
Connectivity status with Phoenix LiveView
Favicon
Taming data with Ecto.Enum and Ecto.Type
Favicon
ecto's cast/4 function explained
Favicon
Phoenix Liveview components for Shadcn UI
Favicon
How to run a local Phoenix app on another machine

Featured ones: