Skip to content
Aasif Versi

Set up RaspberryPi with static ip

1 min read


When setting up a RaspberryPi on your local network it is probably convenient to have the RaspberryPi located at a memorable ip address. One way to do this is to have your RaspberryPi request the same ip address on startup. You must ensure that no other host on your network already has this ip address.


Check your router's configuration, for me this was done through a web ui at By default my router allocates ip addresses in the range to This means that I can safely assign to my RaspberryPi. From your RaspberryPi, you need to edit the /etc/dhcpcd.conf. I personally did this using sudo vi /etc/dhcpcd.conf. At the bottom you should see a section that looks like the follwing:

interface eth0
static ip_address= # EDIT THIS LINE
static routers=

Here you can change the static ip_address to be whatever you like. After you have saved the file, you can reboot the RaspberryPi with sudo shutdown -r now and then verify your changes have worked by running hotname -I, which should show the ip address you specified in the command above.