Headless Setup: Running a Pi Without a Monitor

Walks through pre-setting credentials, enabling SSH, configuring wireless at image write, finding the device on your network, and recovering a failed boot.

Laptop terminal window, photographed for a technology article.

Setting up a Raspberry Pi with no screen, keyboard, or mouse attached is the normal way to run one as a small server, yet the first boot is where most people get stuck. Nearly every problem traces back to something that should have been arranged before the card ever went into the board. This walkthrough covers baking in a username and password, switching on SSH ahead of time, adding Wi-Fi details while the image is written, tracking the board down on your network, and getting out of trouble when the first boot fails to answer.

Why headless is the normal choice

A board tucked behind a router or inside a cupboard rarely has a monitor near it, so administering it over the network is simply how these machines are used day to day. The catch is that it gives you no login prompt to fix things at, so the configuration has to be right before power goes on. Many people run one this way as a quiet always-on box, the sort of role the guide on what these boards are used for lays out.

Setting credentials before first boot

Older guides tell you to log in with a built-in default account, but that default was removed in late 2022 for security, so a freshly written card now has no login at all unless you create one. The Raspberry Pi Imager handles this in its settings dialog, where you set a hostname, a username, and a password before the card is written. Skip that step and the board boots to something you cannot reach.

Choose a username you will remember and a password worth using, since this account carries administrative rights from the start. If you prefer keys to passwords, the same dialog accepts a public key, the stronger choice for a board that will sit on a busy or exposed network. Decide it now, because changing it later needs the very access you are trying to set up.

Enabling SSH ahead of time

SSH is the remote door into a headless board, and it is switched off by default, so it has to be turned on before the first boot rather than after. The Imager settings include a switch for exactly this, with a choice between password and public-key authentication.

The manual method still works if you write an image without the customization dialog. An empty file named ssh, with no extension, placed in the small boot partition that appears on the card tells the system to enable the service on startup and then delete the file. It is a handy fallback when reflashing quickly or scripting the process.

Wireless configuration while writing the image

Wi-Fi details entered at write time let the board join your network the moment it boots. The Imager asks for the network name, the passphrase, and a two-letter country code that sets the radio’s regulatory rules; leave the country blank and the Wi-Fi may stay switched off entirely. A wrong or missing country code is one of the most common reasons a board never appears.

The manual equivalent is a wpa_supplicant file dropped into the boot partition with the network block and country line filled in. Wired Ethernet sidesteps all of this and is more dependable for a first boot when a socket is within reach. A board meant to stream video is happier on Ethernet or strong 5 GHz Wi-Fi, one of the demands the guide on what a media server needs details.

The steps in order

The whole sequence from download to first login runs like this:

  1. Open the Raspberry Pi Imager and choose your board model, the operating system image, and the memory card as the target.
  2. Open the settings dialog and set a hostname, a username, and a strong password so the board has an account to log in to.
  3. Enable SSH in that same dialog, picking either password or public-key authentication.
  4. Enter your Wi-Fi name, passphrase, and the correct two-letter country code, or plan to plug in Ethernet instead.
  5. Write the image, insert the card, apply power, and wait two to three minutes while the first boot expands and reboots.
  6. Connect with an SSH client to the hostname followed by .local, or to the address shown on your router.

Finding the board on your network

With SSH on and the network joined, the board still has to be located. The friendly route is its hostname followed by .local, so a board named piserver answers at piserver.local through the mDNS service most home machines already run. When that name does not resolve, the router’s list of connected devices shows the address it handed out, usually under a DHCP or client section.

A network scan is the fallback, listing live addresses on the subnet so you can spot the new arrival. Once you can reach it, the board is ready for its real work, whether that is logging figures from attached sensors, the kind of build the guide on collecting sensor data walks through, or quietly serving files.

Recovering from a failed first boot

When nothing answers after a few minutes, put the card back in your computer and check the settings you entered. A mistyped Wi-Fi passphrase, a missing country code, or SSH left switched off accounts for most silent failures, and all three are fixable from the boot partition. Reflashing with the Imager and re-entering the details clears the majority of cases.

If the board still refuses, watch its activity light for irregular blink patterns that signal a boot problem, try a different card since flaky storage is common, and rule out a weak supply that leaves the board under-volted. Ethernet removes Wi-Fi from the equation and is worth trying as a test. Once a board boots cleanly, imaging its card early saves repeating all of this, a habit the guide on copying a working card encourages.

What a clean first boot looks like

A successful headless start is undramatic: you write the card with credentials, SSH, and Wi-Fi already set, apply power, wait a couple of minutes, and connect by hostname. Everything that feels difficult happens when a preparation is missing, because a headless board offers no screen to report what went wrong.

Treat the first connection as the finish line of setup, not the start, and note the hostname, username, and address you settled on. With those in hand the board becomes just another machine on the network, and the lack of a monitor stops mattering at all.

Frequently asked questions

How do I set up a Pi without a monitor?

Write the card with the Raspberry Pi Imager and open its settings dialog first. There you set a hostname, username, and password, switch on SSH, and enter your Wi-Fi name, passphrase, and country code. Insert the card, apply power, wait two to three minutes, then connect over SSH to the hostname followed by .local. No screen or keyboard is needed at any point.

How do I find my Pi’s IP address?

Try the hostname with .local first, such as piserver.local, which works through the mDNS service most home networks run. If that fails, open your router’s admin page and look at the list of connected or DHCP clients for the board’s name and address. A network scanning tool listing live addresses on your subnet is a reliable third option when the others come up empty.

Why can I not SSH into my Pi?

The usual causes are SSH never being enabled before first boot, a wrong Wi-Fi passphrase or missing country code keeping the board off the network, or connecting to the wrong address. Put the card back in your computer to confirm the settings, or reflash with the Imager and re-enter them. Trying wired Ethernet quickly shows whether Wi-Fi is the problem.