Your server's IP address is needed to manage your website, set up remote access, troubleshoot connections, and more. Whether you're using a Windows, Linux, or MacOS system, there are a variety of easy ways to quickly find your server's IP address. This guide will cover the different methods you can use.
What is a Server IP Address?
A server's IP address is a unique identifier that allows devices to connect over a network. It can be public (for communicating over the Internet) or private (for use within a local network).
Knowing your server's IP address helps configure DNS settings, manage security rules, and access your server remotely.
Find Your Server's Public IP Address
Your public IP address is what the rest of the Internet sees when your server communicates externally.
This is the address you use for things like pointing domain names to your server, setting up firewall rules, or remote connections like SSH or RDP.
Here are a few ways to find your server's public IP address:
Use a search engine
This is one of the quickest and most user-friendly ways to discover your public IP address:
Open any web browser on your server or a device connected to the same Internet connection.
Go to a search engine like Google or Bing.
Type: what is my ip address
The public IP will appear at the top of the results page.
This method is particularly useful for quickly checking your IP without technical commands or tools.
Check your hosting dashboard
If your server is hosted by a web hosting company, the server's public IP address should be displayed in their management interface:
Log in to your hosting account.
Navigate to the control panel or server/instance section.
Look under the network settings or instance details.
The public IP is usually clearly listed next to the server name or configuration settings.
This is a reliable method because it will show the correct address even if your server setup has multiple interfaces or IPs.
Using the command line
If you prefer to use the command line interface (CLI), there are a few simple commands to get your public IP address.
On Linux or MacOS:
Option 1:
curl ifconfig.me
This command sends a request to the service that returns your public IP.
Option 2:
curl -s checkip.dyndns.org | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+'
This can get the IP from the HTML response provided by Checkip.dyndns.org.
On Windows (PowerShell):
(Invoke-WebRequest ifconfig.me/ip).Content.Trim()
This pulls the IP address using PowerShell. It's similar to the Linux command above, but tailored for Windows users.
Finding Your Server's Private IP Address
Private IP addresses are used in private networks (for example, between your server and a local router or other internal machine).
In a Virtual Private Cloud (VPC), when configuring an internal firewall, or for troubleshooting local connections, it's good to know your private IP address.
On Windows:
Press WIN+R, type CMD, and then press Enter to open a command prompt.
In the command prompt, type:
ipconfig
Look for the line labeled IPv4 address under the appropriate network adapter. This is the private IP of your server.
On Linux:
Option 1:
Open a terminal session.
Run the following command:
ip a
Find your active network interface (usually named ETH0, ENS33, or WLAN0). The private IP address is usually listed after INET and will look like 192.168.x.x or 10.x.x.x.
Option 2:
hostname -I
This will return the internal IP address assigned to the server.
On MacOS:
Open Terminal.
Type the following command and press Enter:
ipconfig getifaddr en0
Tip: If you are on a wired connection and this does not return anything, try substituting EN1 or another interface name depending on your setup.
Other ways to find your server's IP address
CPANEL: If your hosting provider uses CPANEL, you can find your server's IP under the Server Information section.
Network Settings: On cloud platforms like AWS, Google Cloud, or Azure, you can find your server's IP in the network settings of the management console.
Remote Desktop or SSH: If you have remote access, logging into the server and running network commands will display the IP configuration.