LogoLogo
Terminal
  • Attic Lab
  • Getting Started
  • Crest Gold
  • Crest Silver
  • Videos on Computation
  • PI PICO (CIRCUITPYTHON)
    • Getting Started
    • Pin Out Diagram
    • Breadboards
    • 1. Led Blink
    • 2. RGB
    • 3. OLED
    • 4. Sensors
    • 5. Wifi
    • 6. Servos
  • Arduino
    • Getting Started
    • Pin Out Diagrams
      • Mega2560 R3
    • Programming
      • Arduino C - Cheat Sheet
    • Buttons
      • Momentary Switches
    • Display
      • LEDs
      • 7 Segment Displays
      • LCD Displays (GPIO)
      • LCD Displays (SPI)
      • OLEDs
    • Communication
      • Antenna Theory
      • Lora
      • Wifi
        • Boards
    • Project Ideas
    • Motion
      • DC Motors
      • Servo Motors
      • Stepper Motors
  • Microsoft Office
    • Word
    • Powerpoint
    • Excel
  • The Terminal
    • Basics
    • Cheat Sheet
    • Games
      • Level 1 - Bashcrawl
      • Level 2 - Bandit
  • TinkerCad
    • Gallery
    • Getting Started
    • Basic Operations
    • Basic Skills
    • Projects
      • Locking Container
  • Python
    • Hello World
    • Turtle Graphics
      • Strings in Turtle Graphics
      • Cheat Sheet
    • Variables
    • Loops
    • If Statements
    • Functions
    • Games
      • Pong
  • Raspberry Pi
    • Setup
      • Changing The Hostname
      • Headless Setup
      • Kiosk Mode
    • Remote Connections
    • Displays
      • Memory
        • External HD
      • HyperPixel 4.0
  • Ultimaker 3D Printing
    • The Thingiverse
    • Preparing the File
    • Printing
    • Calibration Prints
    • Print Set
  • Fusion 360
    • Getting Started
    • Design Tutorials
      • Tweezers
      • Mars Rover Wheel
    • Surface Modeling
  • Electronics
    • References
    • Antenna Theory
    • LoRa
  • PCB Milling
    • FlatCam
    • Candle
    • PCB Milling
  • Projects
  • Projects
    • Star Map Necklace
    • Ideas Respository
  • Latex
    • What is LaTeX?
    • Getting Started
    • Structure
    • Page Size & Margins
    • Styling
    • Images
    • Lists
    • Tables
    • Mathematics
      • Superscript and Subscripts
      • List of Symbols
      • Fractions and Binomials
      • Integrals, Sums & Limits
    • Colors
  • Web Development
    • The Internet
    • Intro to HTML
    • Basic Elements
    • Basic Styling
Powered by GitBook
On this page
  • https://learn.pimoroni.com/tutorial/sandyj/setting-up-a-headless-pi
  • Setting up a Headless Pi
  • Installing Raspbian Lite
  • Setting up Wi-Fi
  • Connecting to your Pi

Was this helpful?

  1. Raspberry Pi
  2. Setup

Headless Setup

This allows you to set up a PI without needing to connect a keyboard or mouse. Instead, we connect using SSH from the terminal

PreviousChanging The HostnameNextKiosk Mode

Last updated 4 years ago

Was this helpful?

Setting up a Headless Pi

This quick tutorial will show you how to set up a Raspberry Pi that's completely headless. That means that you won't need a display, keyboard, or mouse attached to your Pi to use it or even to set it up! If you're used to using a laptop or desktop computer at home, and don't want the hassle of connecting everything up to your Pi to use it, then this is the ideal solution.

You'll need a little familiarity with the terminal, as this is how you will connect to your Pi, using SSH. SSH stands for Secure Socket Shell, and is a remote way of accessing a terminal on another machine. If you've ever used one of our one-line-installers for our Pi HATs and pHATs, then you'll have used the terminal.

Because we're connecting remotely to the Pi, you'll need a Pi with Wi-Fi, such as the Pi Zero W or Pi 4 (or you could use a Wi-Fi dongle).

Installing Raspbian Lite

This will work perfectly well with the full Raspbian, but it will take longer to burn the image to your SD card, and most of the extra stuff in the full Raspbian is related to the GUI - the desktop, etc. - which you'll have no need for since you're using the terminal.

Once you've burned Raspbian Lite to your SD card, leave it in your computer since we'll be modifying the files before you even put the SD card into your Pi! Note that if you've used Etcher to burn your SD card it will have been ejected afterwards and you'll need to remove it and then replace it to get it to mount again.

Setting up Wi-Fi

You'll notice that your SD card that is mounted on your computer is showing a single partition called boot. We'll be adding a couple of files straight into there that will allow your Pi to connect to your Wi-Fi and to enable SSH on it.

Create a new text file and call it wpa_supplicant.conf. It's extremely important that this file has that exact filename, and no extra extensions on the end like .txt that may be added by your text editor.

You'll need to know the SSID (the name) of the network to which you want to connect, for instance MyWiFiNetwork and the password or pre-shared key.

In your wpa_supplicant.conf file, enter the following:

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="MyWiFiNetwork"
    psk="password123"
}

Replace MyWiFiNetwork with the SSID of your Wi-Fi network, and password123 with your password, making sure to keep the quotes, as above.

If you have more than one Wi-Fi network that you want to add, for instance home and work, then you can simply duplicate that whole block of text, change the SSID and PSK, and add it to the bottom of that file. Save the file.

Now, create a completely blank file with the filename ssh, ensuring that there's no extension. Save it in that same boot partition.

Eject the SD card from your computer, pop it into your Pi, and plug in the power.

Connecting to your Pi

Assuming that all worked, your Pi should now be connected to your Wi-Fi and visible on your network. We're going to use SSH to connect to the Pi now.

Open a terminal on your Mac, Windows, or Linux computer. You can also use a client like Putty on Windows to connect.

As well as having an IP address assigned to it, your Pi will appear with the hostname raspberrypi.local. If you're not able to find the IP address of your Pi (you should be able to find it on your router admin page, or with a tool like Angry IP Scanner or Fing) then you can use the hostname instead. We'll do that here.

Type the following to SSH into your Pi:

ssh pi@raspberrypi.local

Press enter, and then type yes when it prompts you as to whether you want to connect. When it asks for the password, type raspberry, the default password in Raspbian.

Assuming that was successful, you should land in a terminal that is running on your Pi! You can now do things like install software, program HATs and pHATs, etc, all without having a display, keyboard, or mouse attached to your Pi!

To shutdown your Pi, simply type sudo shutdown -h now, or press control and d if you want to disconnect but leave your Pi running.

Note that if you have a program running over SSH and you disconnect, then the program will likely stop as soon as you disconnect. The best way round this is to use screen, but we'll save that for another tutorial!

We recommend using the very latest version of Raspbian Lite. We'd recommend using either the NOOBS installer, which you can find (ensure that you select Raspbian Lite when installing), or downloading Lite from and then using the tool to burn the image to your SD card.

here
here
Etcher
https://learn.pimoroni.com/tutorial/sandyj/setting-up-a-headless-pi
How to mount Raspberry Pi SD card using MacMedium
Logo