How to Check Your IP Address on Linux
Knowing your IP address on Linux is one of those fundamental networking tasks that comes up constantly — whether you're configuring a server, troubleshooting a connection, setting up SSH, or just getting oriented on a new machine. The good news: Linux gives you multiple ways to find it, and understanding which method fits your situation makes the process significantly faster.
What "IP Address" Actually Means in This Context
Before running any commands, it's worth clarifying what you're looking for, because Linux machines often have more than one IP address.
- Loopback address (127.0.0.1) — This is a self-referencing address every Linux system has. It's used internally and not useful for network identification.
- Private (local) IP address — The address your machine has on your local network (home, office, or data center LAN). Typically starts with 192.168.x.x, 10.x.x.x, or 172.16–31.x.x.
- Public IP address — The address the outside internet sees. This is assigned by your ISP or cloud provider, and it sits at the router or gateway level — not directly on your machine in most home setups.
Most day-to-day tasks (SSH, local file sharing, internal server config) need your private IP. Publicly accessible services need your public IP.
Checking Your Private IP Address 🖥️
The Modern Method: ip addr
The most current and widely supported command is: