Open a terminal and run one command to see your IP address
The fastest way to find your IP address in Ubuntu is to open a terminal and type hostname -I, then press Enter. This shows your local IP address — the one your router assigned to your Ubuntu machine — in a single line. If you have multiple network connections, you may see more than one address listed.
You can open a terminal by pressing Ctrl+Alt+T on most Ubuntu versions, or by clicking the Activities menu and typing "terminal". Once the terminal window appears, type the command exactly as shown and press Enter. The address that appears is what you need if you're setting up port forwarding, connecting to your machine remotely from another device on your network, or troubleshooting a connection problem.
Key Takeaways
- The command hostname -I shows your local IP address in one line and works on any Ubuntu version.
- The ip addr command displays all network interfaces and their addresses, useful if you have multiple connections.
- The Settings app under Network shows your IP address with a graphical interface if you prefer not to use the terminal.
- Your local IP address (usually starting with 192.168 or 10.0) is different from your public IP, which is what websites see.
Using the ip addr command for detailed network information
If you want to see more detail about your network setup, type ip addr in the terminal. This command lists every network interface on your machine — Ethernet, WiFi, and loopback — along with each one's IP address, subnet mask, and broadcast address. The information is organized by interface number, so you can see which address belongs to which connection.
Look for the interface you're actually using. If you're connected by Ethernet cable, find the line that starts with a number followed by a name like eth0 or enp0s3. If you're on WiFi, look for wlan0 or wlp3s0. Under that interface, the line starting with inet shows your local IP address. Ignore the line starting with inet6 — that's your IPv6 address, which is different and less commonly needed for home networks.
Finding your IP address through the Settings app
If you prefer a graphical interface, Ubuntu's Settings app shows your IP address without opening a terminal. Click the Activities menu in the top left, type "Settings", and open the Settings process. Then click "Network" in the left sidebar to see all your network connections.
Click on the connection you're using — either "Wired" if you're plugged in with an Ethernet cable, or your WiFi network name if you're wireless. A details panel opens on the right side showing your IP address, gateway, DNS servers, and other network information. This method is slower than typing a command, but it's useful if you want to see your full network setup at a glance or if you're not comfortable with the terminal.
Understanding the difference between local and public IP addresses
The address you find with these methods is your local IP address — the one your home router assigned to your Ubuntu machine. It usually starts with 192.168, 10.0, or 172.16. This address only works on your home network. If you try to use it from outside your home, it won't reach your machine.
Your public IP address is different. It's assigned by your internet service provider and is what websites see when you visit them. To find your public IP, you can visit a website like whatismyipaddress.com from your Ubuntu browser, or type curl ifconfig.me in the terminal. Your public IP changes periodically unless you pay for a static IP from your provider. For most home network tasks — like setting up a printer, accessing files from another device at home, or troubleshooting a connection — you need your local IP, not your public one.
Checking your IP address on WiFi versus Ethernet
Your Ubuntu machine may have both a WiFi connection and an Ethernet port, and each one gets its own IP address. If you're troubleshooting a connection problem, make sure you're looking at the address for the connection you're actually using. The ip addr command shows which interfaces are active — look for the word UP next to the interface name. Inactive connections show DOWN instead.
If you switch from WiFi to Ethernet (or vice versa), your IP address will change because your router assigns a new one for each connection. This is normal. If you need your machine to always have the same local IP address — for example, if you're setting up port forwarding or a static DNS entry — you can configure a static IP in the Settings app under Network, or ask your router to reserve an IP for your machine's hardware address.
Troubleshooting when you don't see an IP address
If hostname -I returns nothing, or if ip addr shows your interface as DOWN, your machine isn't connected to the network. Check that your Ethernet cable is plugged in, or that you're connected to your WiFi network. In the Settings app, click Network and make sure your connection is toggled on. If WiFi is on but you're not connected to your network, click your network name and enter your WiFi password.
If you see an address starting with 169.254, your machine is connected to the network hardware but didn't receive an address from your router's DHCP server. Restart your router by unplugging it for 30 seconds, then plug it back in. Wait a minute for it to boot up, then check your IP address again. If the problem persists, restart your Ubuntu machine and check once more.
Frequently Asked Questions
What does the number after the IP address mean (like /24)?
That number is the subnet mask in CIDR notation. It tells your machine which other addresses are on the same local network. For home networks, /24 is standard and means your machine can talk directly to any other device with an address in the same range (usually 192.168.1.0 to 192.168.1.255). You don't need to change this unless you're setting up an advanced network configuration.
Can I use my IP address to access my Ubuntu machine from another computer?
Yes, if both machines are on the same network. You can use SSH (find Shell) to connect remotely. Open a terminal on the other computer and type ssh username@192.168.1.100, replacing the IP address with your Ubuntu machine's address and username with your actual login name. You'll be prompted for your password. This only works if SSH is enabled on your Ubuntu machine.
Why does my IP address change sometimes?
Your router assigns IP addresses temporarily using DHCP (Dynamic Host Configuration Protocol). When your machine reconnects to the network, or after a set period of time, your router may assign a different address. If you need the same address every time, configure a static IP in Settings under Network, or set up a DHCP reservation in your router's admin panel using your machine's hardware address.
Is my local IP address private and safe to share?
Your local IP address only works on your home network, so sharing it online is not a security risk. However, don't share your public IP address or your router's admin password. Your local address is safe to give to someone if they need to connect to your machine from home, like a family member accessing a shared printer or file.