DEV Community


Posted on

Sharing Your Localhost with Other Devices Easily

Want to show your local website to others on your network, like a co-worker or on your phone? It's simple if you're using Ruby on Rails. Here's how:

Set Up Rails Server for Network Access

By default, the Rails server is only visible to your own computer. To let other devices see it, start the server with this command:

rails server -b
Enter fullscreen mode Exit fullscreen mode

This makes your server accessible to any device on your network.

Find Your Computer's Network IP Address

Open your terminal and type:

ifconfig | grep 'inet'

You'll see a list. Look for an entry like inet netmask .... Here, is your IP address.

Share Your Site

Now, other devices can access your site using your IP address followed by :3000 (the default Rails server port). For example:


That's it! Your site should now be accessible from other devices on the same network.

Top comments (0)