Find the IP address of your Raspberry Pi

Most methods of connecting to your Raspberry Pi from another machine require you to know the local IP address of your Raspberry Pi.

Any device connected to a Local Area Network is assigned an IP address. In order to connect to your Raspberry Pi from another machine using SSH or VNC, you need to know the Raspberry Pi device’s IP address. This is easy if you have a display connected, and there are a number of methods for finding it remotely from another machine on the network.

To find the local IP address of your Raspberry Pi, use one of the following methods.

Desktop

Hover over the network icon in the system tray, and a tooltip will appear. This tooltip displays the name of the network you’re currently connected to and your IP address.

the Network Manager tooltip displaying a Wi-Fi network name and IP address

Command line

Run the following command to output your local IP address to the command line:

$ hostname -I

Boot output

If you use a display with your Raspberry Pi and you boot to the command line instead of the desktop, the boot sequence includes your IP address as one of the last few output messages before your login prompt.

Network Manager

You can use the built-in Network Manager CLI (nmcli) to access details about your network. Run the following command:

$ nmcli device show

You should see output similar to the following:

GENERAL.DEVICE:                         wlan0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         D0:3B:FF:41:AB:8A
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     exampleNetworkName
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/2
IP4.ADDRESS[1]:                         192.168.1.42/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 600
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 600
IP4.DNS[1]:                             192.168.1.3
IP6.ADDRESS[1]:                         ab80::11ab:b1fc:bb7e:a8a5/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = ab80::/64, nh = ::, mt = 1024

GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          100 (connected (externally))
GENERAL.CONNECTION:                     lo
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --

GENERAL.DEVICE:                         p2p-dev-wlan0
GENERAL.TYPE:                           wifi-p2p
GENERAL.HWADDR:                         (unknown)
GENERAL.MTU:                            0
GENERAL.STATE:                          30 (disconnected)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --

GENERAL.DEVICE:                         eth0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         D0:3B:FF:41:AB:89
GENERAL.MTU:                            1500
GENERAL.STATE:                          20 (unavailable)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
WIRED-PROPERTIES.CARRIER:               off
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --

This command outputs information about the various network interfaces accessible on your Raspberry Pi. Check the GENERAL.TYPE row to see which kind of network interface each block describes. For example, "ethernet" is the Ethernet port on your device, and "wifi" refers to the Wi-Fi chip built into some devices. You’ll look at different blocks of output to find your IP address depending on the way your device accesses the internet:

  • if your device connects to the internet using Wi-Fi, check the "wifi" block

  • if your device connects to the internet using the Ethernet port, check the "ethernet" block

When you identify the correct network interface block, look for a field named IP4.ADDRESS[1] for an IPv4 address or IP6.ADDRESS[1] for an IPv6 address. You can ignore the trailing slash and number (for example, /24) in those fields.

In the example above, the Raspberry Pi uses Wi-Fi to access the internet. Check the block where the GENERAL.TYPE field reads "wifi" to find the IP address. In this case, you can access this device using the IPv4 address in the IP4.ADDRESS[1] field: 192.168.1.42.

Resolve raspberrypi.local with mDNS

Raspberry Pi OS supports multicast DNS as part of the Avahi service.

If your device supports mDNS, you can reach your Raspberry Pi by using its hostname and the .local suffix. The default hostname on a fresh Raspberry Pi OS install is raspberrypi, so by default any Raspberry Pi running Raspberry Pi OS responds to:

$ ping raspberrypi.local

If the Raspberry Pi is reachable, ping will show its IP address:

PING raspberrypi.local (192.168.1.131): 56 data bytes
64 bytes from 192.168.1.131: icmp_seq=0 ttl=255 time=2.618 ms
If you change the system hostname of your Raspberry Pi using Control Centre, raspi-config, or /etc/hostname, Avahi updates the .local mDNS address. If you don’t remember the hostname of your Raspberry Pi, you can install Avahi on another device, then use avahi-browse to browse all the hosts and services on your local network.

Check your router’s list of devices

In a web browser, navigate to your router’s IP address. Then, log in using your credentials.

Your router’s IP address is often http://192.168.1.1, but not always. You might find your router’s address and credentials printed on a label on your router.

This will take you to a control panel. Browse to the list of connected devices or similar (all routers are different), and you should see some devices you recognise. Some devices are detected as PCs, tablets, phones, printers, etc. so you should recognise some and rule them out to figure out which is your Raspberry Pi.

If you connect your Raspberry Pi to your network with a wire, try filtering for wired devices in the list. There should be fewer devices to choose from.

Find devices with nmap

The Network Mapper command (nmap) is a free and open source tool for network discovery. It is available for Linux, macOS, and Windows.

  • To install on Linux, install the nmap package, for example, apt install nmap.

  • To install on macOS or Windows, see the nmap.org download page.

To use nmap to scan the devices on your network, you need to know the subnet you are connected to. First, find the local IP address of the computer you’re using:

  • On Linux, type hostname -I into a terminal window

  • On macOS, go to System Settings > Network, select your active network connection, then click the Details…​ button

  • On Windows, go to the Control Panel, then under Network and Sharing Center, click View network connections, select your active network connection and click View status of this connection

Next, scan the whole subnet for other devices. Most local networks use IPv4, which uses four numbers with values between 1 and 255 for each IP address. Devices on your subnet all use the same first three numbers. For example, if your IP address is 192.168.1.5, other devices will use addresses like 192.168.1.2, 192.168.1.6 and 192.168.1.200. To scan this subnet with nmap, pass the string 192.168.1.0/24, which covers the subnet range 192.168.1.0 to 192.168.1.255. Use the -sn flag to run a ping scan on the entire subnet range:

$ sudo nmap -sn 192.168.1.0/24
This can take up to a minute depending on your local network speed.

A ping scan queries all IP addresses in the range for a response. For each device that responds to the ping, the output shows the hostname and IP address as follows:

Starting Nmap 6.40 ( http://nmap.org ) at 2014-03-10 12:46 GMT
Nmap scan report for hpprinter (192.168.1.2)
Host is up (0.00044s latency).
Nmap scan report for Gordons-MBP (192.168.1.4)
Host is up (0.0010s latency).
Nmap scan report for ubuntu (192.168.1.5)
Host is up (0.0010s latency).
Nmap scan report for raspberrypi (192.168.1.8)
Host is up (0.0030s latency).
Nmap done: 256 IP addresses (4 hosts up) scanned in 2.41 seconds

The output above shows a device with hostname raspberrypi has IP address 192.168.1.8.

Find devices with a smartphone app

The Fing app is a free network scanner for smartphones. It is available for Android and iOS.

  1. Connect your phone to the same network as your Raspberry Pi.

  2. When you open the Fing app, touch the refresh button in the upper right-hand corner of the screen.

  3. After a few seconds, you should see a list with all the devices connected to your network.

  4. Scroll down to the entry with the manufacturer "Raspberry Pi". The IP address appears in the bottom left corner, and the MAC address in the bottom right corner of the entry.