How to give your Raspberry Pi a Static IP Address

By Bradly Spicer •  Updated: 11/03/19 •  2 min read

This small guide is mostly to accompany my other guide on how to turn your Raspberry Pi into an Alexa Smart Device, however, this may come of use to you if you’re falling upon this blog post!

I’ll try and make this as easy as possible to follow, generally speaking, the configuration for this will be the same across all Raspberry Pi versions in the future, but I will update this should I need to in the future.

To start with, you’ll want to open “Terminal”, or SSH (On a remote computer). Run the following command:

sudo nano /etc/dhcpcd.conf

From here, scroll to the bottom (Hold down on the Keyboard). The last line may say “nohook lookup-hostname”.

Copy and Paste the following, changing the details of the bolded numbers to the static IP you wish to keep:

interface eth0
static ip_address=
static routers=
static domain_name_servers=
interface wlan0
static ip_address=
static routers=
static domain_name_servers=

The routers= and domain_name_servers= would both equal the IP of your router if you live at home. Otherwise, the name_servers is the IP of your DNS records and the routers are the IP of your gateway.
You will need to keep the /24 at the end of the ip_address.

From here, press ctrl + x and then press Y to save changes. Simply reboot your Pi after and your Static IP will be done!

If you wish to check this, open Terminal again and type the following:


Bradly Spicer

I'm a Smart Home and IT Enthusiast that loves to check out new technology and gadgets! I enjoy reading your experiences and news, so if you want to share anything or chat smart homes, definitely send me an email!