When working with Raspberry Pi on local networks, the device’s IP address can often change after every reboot or network change. This creates problems while accessing your Pi remotely or connecting it to services. To solve this, assigning a Static IP address ensures your Pi always stays at the same address on your network.
In this guide, you'll learn how to configure a static IP on Raspberry Pi OS using a simple configuration file method. This is useful for IoT projects, web servers, or remote SSH access, where a consistent IP is required.
Steps to Set a Static IP
- Check your current IP using
hostname -I
- Edit the DHCP configuration:
- Use
sudo nano /etc/dhcpcd.conf
- Add static IP settings
- Save and reboot using
sudo reboot
Why Use a Static IP on Raspberry Pi?
- Easy remote access via SSH or VNC
- Ensures consistent device identification in home automation
- Helps when assigning port forwarding on your router
- Ideal for Raspberry Pi running servers or cloud services
Setting a static IP is a small but crucial step for a stable Raspberry Pi network setup. It prevents connection errors and is especially handy in larger home or lab networks. Just make sure the IP address you assign doesn’t conflict with other devices.