How to Setup a Raspberry Pi Without a Monitor or Keyboard

How to Setup a Raspberry Pi Without a Monitor or Keyboard

Anyone that’s interested in learning about computers or the internet will love experimenting with a Raspberry Pi. The only issue is that it doesn’t come with a monitor or keyboard. This actually isn’t a problem though, because there’s a way to setup and work on the Pi without ever connecting it to a monitor or keyboard. It’s known as running the Pi “headless”.

In this tutorial, I’ll walk you through the steps of setting up a Raspberry Pi without a monitor and keyboard on a new installation of Raspbian. All you need is another computer with internet access, an SD card adapter, ethernet cable, and access to the internet router on the network you want to connect to.

BONUS: I made a quick start guide for this tutorial that you can download and go back to later if you can’t set this up right now. It covers all of the steps, diagrams, and code you need to get started.

Here’s a video showing the steps, but read below for the details:

Gather all the Pieces

The first step is to download the Raspberry Pi’s operating system. I’ll be using Raspbian Jessie Lite in this tutorial. You can download it here from the Raspberry Pi Foundation.

Raspberry Pi ORG Raspberian

Just download the ZIP file and Extract it to a new folder. Then you’ll have a single .img image file that contains the operating system:

Raspbian Inage File

Next we’ll need a program that can write the operating system image file onto a microSD card. We’ll use Win32DiskImager to do that, so download and install it:

Win32Disk Imager

Now we need a way to access the Raspberry Pi’s command prompt. We can do this with a remote SSH client called PuTTY. PuTTY establishes an SSH connection between the Raspberry Pi and another computer. It opens up a window that gives you access to the Raspberry Pi’s command prompt. Download and install PuTTY to your PC.

If you’re using a Mac, you can SSH into the Pi with Terminal. Click here for good tutorial on SSHing via Terminal.

PuTTY

We’ll also need a way to find the local IP address of your Raspberry Pi when it’s connected to your router via the ethernet cable. There are lots of ways to do this, but Advanced IP Scanner is pretty easy to use. It will scan your home network and list all connected devices and their local IP addresses.

Advanced IP Scanner

Another way to find your Pi’s local IP address is to log into your router’s configuration page and get a list of the connected devices. But you need to know your router’s username and password to access it. If you want to do it this way, find the router’s product number on the back, then search online for the user manual. There should be instructions on how to access the router’s configuration page and how to view the connected devices.

Write the Raspian Operating System to the microSD Card

Now that we have everything we need, let’s write the operating system image to the microSD card.

Insert a blank microSD card into your computer using the SD card adapter. Then open Win32DiskImager, and select the operating system image file that was extracted earlier by clicking on the little folder icon:

Win32DiskImager Write

Next, select the drive that has the microSD card from the drop-down list below “Device”:

Win32Disk Write 2

Now click “Write” on the bottom of the window. This will take from 1 to 15 minutes depending on your computer and the size of your microSD card:

Win32Disk Write 3

Wait for the process to complete:

Win32Disk Write 4

If you’re using a version of Raspbian released after November 2016, there is one extra step:

SSH was disabled by default in Raspbian versions released after November 2016. One way to enable it is to access the raspi-config menu and turn it on. However, we’re setting it up headless so we don’t have access to the command prompt yet. Luckily there’s another way to turn on SSH…

All you need to do is create an empty file called “SSH” and place it in the root partition of the SD card. The file should have no extensions like “.txt” or “.doc”. The easiest way to do this is to open up a text editor like Notepad and save the blank page as “SSH.txt”. Close the text editor, then rename the file to delete the “.txt” extension. After that, move the file to the top level folder of the SD card (the root partition).

Now you can eject the SD card from your computer and insert it into your Pi.

Establish an SSH Connection to your Raspberry Pi

Connect the Pi to your internet router with an ethernet cable, then plug in the power cord so it boots up.

Now we need to find out the local IP address your router has assigned to the Pi. Open up Advanced IP Scanner and click “Scan” in the upper left hand area of the window. A list of the connected devices and their local IP addresses will be generated:

Advanced Ip scanner scan

Write down the IP address for the device that says Raspberry Pi Foundation in the “Manufacturer” column. In my case it’s 10.0.0.105.

Now it’s time to connect to the Pi. Open up PuTTY, and enter the local IP address into the “Host Name” field:

Raspberry Pi PuTTY Warning

Now click “Open” to initiate the connection.

On the first connection attempt, a security warning will appear. Just press “Yes” since you’re connecting to your own Pi:

Raspberry Pi PuTTY Warning

If the SSH connection is successful you’ll be greeted with the login prompt of your Raspberry Pi:

raspi login

If this is your first login and you haven’t changed the username or password yet, enter pi for the username, and raspberry as the password.

Now you’re logged in to your Raspberry Pi via SSH:

raspi after entering password, before sudo raspi-config

At this point, it’s a good idea to configure your Raspberry Pi by entering sudo raspi-config to enter the configuration settings menu:

raspi config

This is where you can change all of the default settings for Raspbian, and do other useful tasks like expand the file system and overclock the processor.

Now that SSH is set up, the next step is setting up WiFi and establishing a remote desktop connection so you can access the Pi’s desktop environment. This tutorial will walk you through that:

How to Set Up WiFi on the Raspberry Pi

If you have any questions about this post, or are having issues setting up your Raspberry Pi over SSH, please leave a comment below and I’ll try to answer it! And don’t forget to subscribe to get an email when we publish new tutorials. Thanks for reading!

  • manmeet says:

    So to summarize all
    1. Download Raspbian
    2. Download Disk32Imager
    3. Download Putty
    4. Download advanced IP scanner.

    5. Write Raspbian OS on SD card using diskimager
    6. Connect Pi with router using Ethernet cable
    7. Power up the Pi
    8. Use advanced IP scanner to find IP of Pi
    9. Open Putty and enter IP
    10. Enter username and password
    11. Configure Raspbian.

    Done.

    Thank You for great write up. Will comeback once I actually start doing it.

  • Aubrey says:

    whoah this blog is wonderful i love reading your articles. Keep up the good work! You know, lots of people are looking around for this information, you could help them greatly.

  • video games says:

    Hey! Do you use Twitter? I’d like to follow you if that would be ok. I’m definitely enjoying your blog and look forward to new posts.

  • Sheelbrat says:

    I followed your instructions and was able to connect my Pi. But when I tried to do the same the next day, I couldn’t connect through PuTTY. The error says connection timed out. Please help.

  • Thanks. Great guide. But could I do this in any way without a SD card reader on my computer?

    • StarCrasher says:

      If you have an old MP3 player or other device that uses an sd card and acts as USB storage when connected to a PC, you may try using that as your sd card reader. I used to use an old mobile phone for that, and sometimes used an MP3 player. It may not work because you need block device access to the sd card to write the disk image, which most modern media devices don’t expose to the host pc but some do.

    • drgeoff says:

      If you need to put an OS on a card you need a card reader. No exceptions.

      USB card readers are a few $/£/€.

      You might be able to use a digital camera or Android tablet as a USB card reader.

  • Simon says:

    Hi folks, great site, and a lot of useful information.

    I was wondering if anybody knows of a good breath sensors for the Raspberry Pi. I came a cross a lot of options on the internet, but not sure which one will suite me better.

    What I am trying to do is basically use the breath sensor to breath into via mouth, then take that signal (using Raspberry Pi) and generate MIDI messages to control a sound module.

    Like I said, I came a cross multiple sites, just to name a few like:
    https://moderndevice.com/product/pressure-sensor-mpxv/#tab-additional_information

    and
    https://www.cooking-hacks.com/airflow-sensor-breathing-ehealth-medical

    But still not sure the accuracy and resolution of the sensor.

    Any help is greatly appreciate it. Hope to hear from you folks.

  • Marc says:

    If anyone else was having SSH problems, this guide explains how you can set an IP for your OS. It solved my “Connection refused” errors. http://www.dexterindustries.com/howto/connecting-raspberry-pi-without-monitor-beginners/

    • The issue you might be having is that this tutorial shows how to SSH with a dynamic IP. This means that your local IP may change from time to time. To get around connection refused errors, you can either set up a static IP, or just run Advanced IP Scanner again to find the new local IP…

  • tomasreynoso says:

    Thank you, very usefull!!

  • deffo says:

    Hi,
    I like your posts a lot.
    I have a question that what to do if you have no Internet router. Just a wifi dongle.
    please reply.

  • sangam says:

    I am trying to set up my raspberry pi in headless mode. I got the OS raspbian wheezy on the SD card. Initially when i powered it on with the ethernet cable connected to my laptop and ran the advanced ip scanner, it successfully detected the pi and i was able to access the terminal with putty using pi’s IP. I logged into the device.

    When i again tried it later doing everything same as above advanced IP scanner is not able to detect pi. Pi is powered on and connected to the laptop via the ethernet cable. What am i doing wrong ?

    • Is your Pi connected to your laptop with the ethernet cable, or connected to your router? The Pi needs to be connected to your router with the ethernet cable. If it is connected to your router, powered up, and the IP scanner still doesn’t recognize your Pi, it could be the OS image on the SD card is corrupted. I would try burning a fresh image to the SD

  • G Chang says:

    is there a good instructions on setting it up from linux platform, rather than from windows?, very clear but no windows PC at home…

  • Dani says:

    is it possible to connect directly whit a ethernet cable from the pc to the Pi ?
    do the same, but whit out the router?

  • pelleullberg says:

    Works like a charm! TY

  • jimi says:

    i connect my Rpi ethrrnet cable to my laptop, but when scan for the ip address, it did not detect the RPi ip address….

    • Mario says:

      You should connect your Raspi to your router. Otherwhise you need a running DHCP server on your laptop because your Raspi needs to retrieve an IP address from somewhere.

  • Mario says:

    Great description. I used it to set up my Raspi with Centos 7. It works 1:1. You can download the OS on that page:
    http://linux.softpedia.com/dyn-postdownload.php/233a98784de95dcacfc184bfeeb95dbb/56cf5b7c/38a/0/a?tsf=0
    Be aware that you have to expand the root partition to full extend after installing the image on the SD card. I used tuxboot/gparted.

  • Leandro says:

    I have successfully connected to the Raspberry Pi using SSH, but it does not provide an Internet connection to the Raspberry. I am using now the March 2016 release of Raspbian, in a previous version I was able to connect using SSH and having Internet access simultaneously. Any ideas? Thank you.

  • Amani says:

    hi , i cannot find the ip address ! actually there is no raspbian device on the router page , even we i did the Ethernet connection between router and raspberry. what about the computer connection ? should it connected by cable to router? .. i do not know where is the problem ! any one help me please ..

    • The PC doesn’t need to be physically connected to the router. It just needs to be connected to the network via WiFi or any other way. It sounds like your SD image may be corrupted. Have you tried re writing the image to the SD card?

    • Tim says:

      @Amani Just hook up an USB keyboard and a monitor(for testing purposes and troubleshooting it is very usefull to have) and run ifconfig (like ipconfig for windows). if it comes up with nothing your software configuration or hardware is broken.

  • Arun Kumar Balachandran says:

    This was one really good article on running the raspberry pi running headless. infact this is the only one that helped me out all the way through to get my rasp up and running. Thanks lot.
    Once again I really appreciate the effort you have take in explaining the steps clear and precise .

    Regards
    Arun

  • hossein says:

    hi evry one
    my problem is a i install ububntu mate in my sd card for raspberry pi 3 but i dont have monitor and linux os in my laptop i can conact to raspbian with my laptop to monitor os but i can not conact to ubuntu mate with my ethernet cable but ssh in ububntu mate not runing someone help me to solve my problem i have tablet but i dont any hdmi or hdmi to vga cable evry thin i have laptop with windows 10 (dont have linux os) and ethernet cable and tablet..please help

  • Squirrel says:

    Brilliant explanation, thank you, works first time

  • I get the IP with Wireshark, connecting and seeing what ARP protocol messages were interchange, in one of the messages is the Raspberry PI IP

  • WireHog says:

    i have the problem that after i enter my pi”s ip in putty and click open putty opens but nothing comes on it. what am i doing wrong? Pls help me solve it

  • John says:

    Nice, worked a treat. Many thanks :-)

  • Karthikeyan says:

    Ip scanner ain’t showing raspberryPi what possibly could have gone wrong

    • If your Pi is connected to your router with an ethernet cable and powered on, and Advanced IP Scanner still doesn’t recognize the Pi, it could be something is corrupted on your SD card. Try re writing the image to the SD card, that will probably fix it.

  • This guide is really helpful! Thank you!

  • vegu says:

    Hi,

    I have followed all steps mentioned above to boot my RPi for the first time, I am able to ping my RPi also, but issue is I am not able to do ssh to it, tried all possible options,

    please let me know what could be the solution.

    thanks

  • mine1111 says:

    Thank you for your detail tutorial
    ive followed all the steps..and now can ping the ip,
    however when i tried ssh through putty, it came up with “Network error: connection refuse”
    i am losing hope and gonna find a keyboard and monitor ..

    • SSH is disabled by default in Raspbian versions released after Nov. 2016. To enable SSH without accessing the command prompt, add an empty file named “SSH” (without extensions) to the root partition of the SD. I’ve updated the post, check it out for more details…

      • John McGraw says:

        All you need to do is create an empty file called “SSH” and place it in the root partition of the SD card. The file should have no extensions like “.txt” or “.doc”. The easiest way to do this is to open up a text editor like Notepad and save the blank page as “SSH.txt”. Close the text editor, then rename the file to delete the “.txt” extension. After that, move the file to the top level folder of the SD card (the root partition).

        Currently using Win 7 on desktop and Win 10 on HP Pavilion and removing the file extension “.txt” has me at a standstill.

        • After you save the empty .txt file and go to rename it, are you able to see the “.txt” extension in the file name? If so, you can just delete that part. If you can’t see the file extension when you rename it, you probably just need to enable viewing file extensions in your windows browser. To do that, click on “View”, then select the check box for “file name extensions”. That should fix it. Here’s an article that explains it: http://kb.winzip.com/kb/entry/26/

  • John McGraw says:

    I battled the “Connect to PC” for days, tried the SSH file in the root with no luck so I connected to Vizio with just a mouse and HDMI, enabled SSH and now my connections are solid. Have noticed the IP found has not changed after multiple connections so I will assume mine is static!

  • Rakesh Gupta says:

    I am not able to connect with laptop. IP config error. Please help me.I am using puTTy & SSH. All done just network connection error.

  • Santosh says:

    Whatever I do, I am able to access my Raspberry Pi 3 after connecting to my TV only through HDMI. However I can’t connect through the ethernet. it never detects raspberry in my advanced IP scanner and can’t connect through putty.

    Santosh

  • You can pause the scene in any video and ask students to circle the names of the
    colors they see on a printed list you deliver.

  • Harry says:

    the file ‘ssh’ needs to be created in /boot/ directory and not in the root directory.

  • youtube.com says:

    Property for Fisher-Cost Toys & Additional Use of this web site signifies your acceptance of the terms and conditions of use.

  • Karthikeyan says:

    I’m not able to find RaspberryPi’s IP adress

  • Nissim says:

    Thank you for your great information tutorial.

    I downloaded ” 2017-09-07-raspbian-stretch-lite”
    I created a new file SHH and copied the empty file to SD card root
    I connected straight network cable between my laptop and the Pi
    I powered up the pi

    I cannot find the IP address of the pi

    I set my (win 8.1) laptop Ethernet adapter to static IP 192.168.137.1 , Allowed sharing – still I cannot see the pi IP
    I also tried to set the Ethernet adapter to DHCP – using ipconfig /all , I can see the assigned IP address of my laptop adapter
    But I cannot see the Raspberry pi IP

    I disabled Windows firewall

    Can you please try to assist me to find out the PIs IP so I can use Putty SSH to establish a connection to my PI?

    Many thanks

    Please try to advise me what I do wrong .

  • Anna says:

    Hello,
    I have connected my rpi and my computer to my router. When I put the rpi’s IP address on putty it says Network error: Connection timed out. But then I disconnected my rpi from the router and used IP scanner again and it still find the rpi’s IP address even though it is disconnected. I also used ping raspberrypi on command prompt and it says: ping request cannot find host raspberrypi.Could you please help me? I have been trying for days and can’t seem to find the problem.

  • Millions of men and women around the world are hooked onto game
    titles these days. Once you might be knowledgeable about the terms
    in the game, you’re set to experience the overall game towards the fullest.
    Even though Xbox systems and Wii games took plenty share from the gaming market, Play – Station games are nevertheless some of the best games available.

  • MISLEADIN says:

    You still need a keyboard and a monitor, no?

  • nam nguyen says:

    “After that, move the file to the top level folder of the SD card (the root partition).” Can you show me what folder? cuz i tried every folder in the SD card but i still couldn’t get the IP of the Pi

  • Amare says:

    Thank you very much.. but I still do not understand it very well. I am doing a project to detect motion an object around an area using machine learning algorithms ( specifically YOLO detector).. My question is I write the python script on my computer then setup the raspberry pi ( I install opencv , python on the raspberry pi).

    1. to use the raspberry pi where should I store the codeon the raspberry pi? I am not supposed to take the computer to the area where I detect motion..
    2. How the code run automatically? if it is on my computer I have to click the run button to run a code.

  • Damremo says:

    Item was DOA. Returned and purchased a different brand. Tried from multiple displayports to multiple monitors. Even tried on different workstations as well as multiple video cards. Nothing worked.
    Regards
    Damremo

  • David Marsh says:

    After numerous attempts to boot the Rasp 3 B+ with both a 32 Gb and a 16 Gb micro-SD card I still have a dead board!!
    I have downloaded the latest update of Raspian stretch, un zipped it and copied a SSH file with no .txt suffix.
    All were image copied to each card and inserted in turn, both were new cards.
    powered up and red led on green led flashed twice then off.
    PCB`s setup with an Ethernet cable to my modem / router with the desktop pc running in Wi-Fi mode to reach the Raspian in an headless setup.
    Tested the cable in PC works fine.
    I used the PUTTY app the read network IP`s got one for Rasp 192.168.0.8 plus the manufactures name so I believe the router works fine.

    Frankly I`m baffled is the Rasp dead or have I forgotten something?

    Any suggestions much appreciated.

    David Marsh.

  • jrrobb says:

    I have tried many instructions to connect my Raspberry Pi 3 to my PC and yours is definitely the best until I get to the part ” insert the ssh file into the boot or top, section of the software. I have downloaded the Raspian Stretch Lite version. I have zipped the software into the micro SD card and it appears as SD Boot G: I have no idea where the top level of the boot file is., so I opened the SD card and pasted the ssh file into the card. After entering the IP address into Putty the Putty command appears but it is blank and soon times out. This is obviously an ssh issue but where do I go from here?

    • jrrobb says:

      Reference my last post. Happy days I have at last connected with my Raspberry Pi on my computer. But this happiness did not last. When I tried to login a second time the keyboard goes dead after I enter the Pi and go to the password . It asks for the password but the keyboard will no make any entries just nothing. I have tried the Raspberry Pi connected by HDMI to my YV but the same thing happens.

  • Abdul says:

    Thank you so much…. It’s working after several attempts.

  • Matt says:

    Hi, could someone update this article?

    Specifically, in the headless setup section, the filename should be ‘ssh’ lowercase, and on the boot partition – not the root partition.

    Source: https://www.raspberrypi.org/documentation/remote-access/ssh/

    Otherwise, great tutorial – thanks!

  • Senthil says:

    Sir,

    i am newbie, I am using Raspberry pi 2 Model B, i have loaded image Raspbian Jessy Image.

    i followed steps before “ESTABLISH AN SSH CONNECTION TO YOUR RASPBERRY PI” , I am getting Error ” Network Error : Connection Refused”,
    and i couldnot find my raspbian ip in “Advance Ip Scanner ” Also.

    Can you help me to Resolve this issue

  • blue says:

    Very good article. I absolutely appreciate this site.
    Thanks!

  • sb says:

    Funny I found your tutorial before the official documentation via duckduckgo. Thanks for your work.

    Little Error:
    >All you need to do is create an empty file called “SSH” and place it in the root partition of the SD card. The file should have no extensions like “.txt” or “.doc”.
    It’s the **boot** partition, not **root** and the documentation wants the file to be lowercase. Chapter 3 in https://www.raspberrypi.org/documentation/remote-access/ssh/

  • frank says:

    Thanks for this… a great help.

    For Linux people wanting to set up a headless RPi, the SSH file goes into the boot partition, not the rootfs partition.

  • Lahcene says:

    Hi,
    I do not have a router at home. How could I proceed.
    Many thanks.

  • Yes, you are right, thanks for bringing that to my attention. I’ve updated the post to skip this step…

  • Yes, you are right. There is no reason for the second formatting as the disk is re-partitioned after the image is written to it.

  • Leave a Comment

    Your email address will not be published. Required fields are marked *

    Quick Start Guide for Setting Up a Raspberry Pi Without a Monitor or Keyboard

    Quick Start Guide for Setting Up a Raspberry Pi Without a Monitor or Keyboard

    Enter your name and email and it will be sent to your inbox:

    Consent to store personal information:

    Email me new tutorials and (very) occasional promotional stuff:

    Check your email to get the PDF!