I run rails servers at ports 3000 and 5000.
What do I use (or how do I find) the IP address of my Mac?
Not the one used for web browsing which is my companies host supplied IP but rather my local machine one.
I imagine it would be 192.168.x.x?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
I can't believe nobody has suggested the simplest method of all, only 2 clicks (or 3 if your adapter isn't at the top of the list).
Click System Preferences, click Network.
It will display the IP address of the adapter under Status to the right of the network adapters. If your device isn't at the top (which will be the default selected) then simply click on the one with the green status. It's going to be either Wi-Fi or Ethernet.
...but some methods give different kinds of IP addresses. Make sure you know which kind of IP address you need. For many (most?) purposes, the public IP address is what's required.
Note: in certain situations, your local IP address may be the same as your public IP address.
Hold option and click on the WiFi icon in the menubar at the top-right corner of your screen. You will see a special menu that lists, among many other things, your IP Address.
There are two ways to get to Network Preferences:
Fire up your favorite terminal (e.g. Mac OS X comes with one called Terminal), and type the following:
ipconfig getifaddr en0if connected via a wireless connection.
ipconfig getifaddr en1if connected via ethernet.
ipconfig getifaddr en3if connected via a Thunderbolt-to-ethernet adaptor.
Fire up your favorite terminal (e.g. Mac OS X comes with one called Terminal), and type
curl http://ipecho.net/plain; echo.
There are many websites you can use that will tell you your public IP address. The simplest is probably a Google search for "what is my ip address".
Alternatively, you could try running
in the terminal. It will show a list of interfaces with IPs by default, along with many many other details such as physical addresses. It can also be used to configure network adapter settings, the man page is here: http://linux.die.net/man/8/ifconfig
or you can run
man ifconfig on the terminal.
In your case you're probably looking for
en1, look under
inet for the IP address.
I installed iStat Menues. Now I can see all the IPs, the one from my provieder is called "public ip" and the in the WiFi network is called "private ip" in iStat Menues.
It could also work with the iStat Nano Widget. Only tried the full version. I only need to click on the menu bar item to get the info.
All these answers are good... I'd like to add one thing. If you're trying to get your Mac's IP so you can access the server you're running locally on the same Mac, you can use
http://127.0.0.1/ (the local loopback IP) or
http://localhost/. It is always the same and you can use it without even being connected to any network.
If you're trying to let others connect to the server on your Mac it would likely be easier to give them your hostname which you can set from the Sharing System Preferences pane (at least as long as they are using a Bonjour-enabled system). Then you can access something like