How to Find Your IP Address in Ubuntu
Knowing your IP address in Ubuntu is one of those fundamental networking tasks that comes up constantly — whether you're configuring a server, troubleshooting a connection, setting up SSH access, or just trying to understand your network. Ubuntu gives you several ways to find it, and which method works best depends on your setup, your comfort with the terminal, and whether you need a local or public-facing address.
What "IP Address" Actually Means in This Context
Before diving into methods, it's worth clarifying the distinction — because Ubuntu systems often have more than one IP address, and people frequently confuse them.
- Private (local) IP address — the address assigned to your machine within your home or office network. Typically starts with
192.168.x.x,10.x.x.x, or172.16.x.x. This is what other devices on the same network use to reach you. - Public IP address — the address your internet traffic appears to come from, as seen by external servers. This is assigned by your ISP and shared across your router.
- Loopback address — always
127.0.0.1, used internally for the machine to communicate with itself. Not relevant for actual networking tasks.
Most of the time when people ask how to find their IP address in Ubuntu, they mean the private/local IP — the one used within their network.
Finding Your IP Address Using the Terminal 💻
The terminal is the fastest and most reliable route, and it works across all Ubuntu versions, including server editions with no desktop environment.
Using ip addr (Recommended)
The ip command is the modern standard for network configuration in Linux. Run:
ip addr show Or the shorter version:
ip a This outputs a list of all network interfaces on your system. You're looking for your active interface — typically named eth0 or enp3s0 for wired connections, or wlan0 or wlp2s0 for wireless. The IP address appears after the label inet, followed by a subnet mask in CIDR notation (e.g., 192.168.1.45/24).
Using hostname -I
For a quick, no-frills output of just the IP address:
hostname -I This prints all IP addresses currently assigned to the machine, separated by spaces. It's especially useful in scripts or when you just need the number without parsing through interface details.
Using ifconfig (Older Method)
On older Ubuntu installations, ifconfig was the standard tool:
ifconfig Note that ifconfig is part of the net-tools package, which is not installed by default on Ubuntu 18.04 and later. If the command isn't found, you'd need to install it with sudo apt install net-tools — or simply use ip addr instead, which is pre-installed.
Finding Your IP Address Through the GUI 🖥️
If you're running Ubuntu Desktop and prefer a graphical approach:
- Open Settings
- Navigate to Network (for wired) or Wi-Fi
- Click the gear icon next to your active connection
- Your IP address appears under the Details tab
Alternatively, clicking the network icon in the top-right system tray and selecting connection details often displays the address directly.
Finding Your Public IP Address
Your public IP is not visible through standard local networking commands — those only show the address assigned within your network. To find your public-facing IP from the terminal:
curl ifconfig.me Or:
curl icanhazip.com Both services return your public IP address as seen from the outside. This requires an active internet connection and the curl utility (installed by default on most Ubuntu systems).
Key Variables That Affect What You See
| Variable | What It Changes |
|---|---|
| Wired vs. Wi-Fi | Different interface names and sometimes different IPs |
| Static vs. DHCP | Static IPs don't change; DHCP-assigned IPs may rotate |
| Virtual machines / Docker | Additional virtual interfaces appear in ip addr output |
| Multiple network adapters | Multiple inet entries, one per active interface |
| VPN connections | A VPN adds its own tunnel interface with a separate IP |
Static vs. Dynamic Assignment
If your IP address changes unexpectedly between sessions, your router is likely assigning it dynamically via DHCP. A static IP is manually configured and stays fixed — common for servers, NAS devices, or any machine others need to reliably reach. Ubuntu lets you set a static address either through the GUI network settings or by editing the Netplan configuration files in /etc/netplan/.
Interface Naming Conventions
Ubuntu uses predictable network interface names by default — meaning instead of the old eth0 and wlan0 naming, you'll often see names like enp3s0 (Ethernet on PCI bus 3, slot 0) or wlp2s0 (wireless on PCI bus 2). This naming scheme is more stable across hardware changes but can look unfamiliar at first.
If you're unsure which interface is active, look for the one where state UP appears in the ip addr output, or check which interface has a valid inet address assigned.
When Multiple IP Addresses Appear
It's entirely normal for an Ubuntu system to show several IP addresses at once. A machine running Docker will show virtual bridge interfaces. A VPN client adds a tunnel interface. A system with both wired and wireless connections active will show both. Each serves a different purpose, and none of them are "wrong" — understanding which one you need depends on what you're actually trying to accomplish.
Whether you're configuring a local service, opening a firewall rule, setting up remote access, or simply checking your connection, the right address to use — and whether local or public matters — is determined entirely by what's on the other end of that connection.