How to Set a Static IP on Raspberry Pi?
2025-09-15 | By Rinme Tom
License: General Public License Raspberry Pi SBC
This project tutorial explains how to set a static IP address on a Raspberry Pi using two modern and reliable methods: the NetworkManager command-line tool (nmcli) and the Raspberry Pi OS desktop GUI. It addresses the common issue where the Raspberry Pi frequently changes its IP address due to dynamic DHCP assignment by the router, creating difficulties in reliably accessing the Pi remotely or over the network.
Project Overview
Problem Addressed: The Raspberry Pi obtains a dynamic IP address by default via DHCP, which changes after reboot or router lease renewal, resulting in inconsistent network access.
Why Static IP: A static IP address keeps the Pi accessible with a fixed address, which is crucial for SSH, web servers, IoT projects, home automation, port forwarding, and multi-device networks.
Traditional Method Limitation: Editing /etc/dhcpcd.conf is no longer effective on recent Raspberry Pi OS versions because NetworkManager manages the network, overriding the old configuration.
Preferred Solution: Use NetworkManager’s CLI tool nmcli for a robust, headless-compatible approach to configure static IP for both Wi-Fi and Ethernet. Alternatively, use the Desktop GUI method on Pi OS with a graphical environment
Key Steps in nmcli Method:
Identify current IP, gateway, and network connection profile.
Use nmcli connection modify to assign a manual static IP, gateway, and DNS.
Restart the network connection for changes to take effect.
GUI Method: Change the connection profile from Automatic DHCP to Manual, enter IP address, gateway, subnet mask, and DNS via network settings in the desktop environment.
Static IP Best Practices: Select an IP outside the DHCP pool but within the same subnet to avoid conflicts.
Benefits:
Ensures stable, predictable network presence for the Raspberry Pi, improving usability for remote access and server roles.
Additional Notes:
The tutorial includes troubleshooting tips, FAQs about static IP conflicts, performance impact (none), and suitable use cases for each method.
This Set a Static IP on Raspberry Pi is ideal for anyone needing a persistent IP for Raspberry Pi setups related to IoT, local hosting, or remote administration, reflecting modern networking management on Pi OS. It provides clear commands and GUI instructions to help beginners and advanced users configure a static IP effectively on their Raspberry Pi devices.