Raspberry Pi: Clean Install to SSH Headless Box

Ever since I got hold of a Raspberry Pi computer, I’ve been singing its praises to anyone unlucky enough to be standing close to me. Not only is it affordable (even after you’ve bought/repurposed all the supporting gear) but it’s cheap to run 24/7 because of the low power consumption of the hardware.

I mostly use my Pi’s headless (no monitor, mouse or keyboard) and then use SSH / Remote desktop to connect to the machines over the network from my Uber desktop machine.

If you want to do the same, you can follow these steps but just tweak them for your own requirements.

Install Raspbian

Follow the instructions here on how to download and install the NOOBS Software onto your SD card. From there you can install a wide range of specialist operating system designed for the Pi. I generally stick to the recommended Raspbian distribution.

Configure Basic System Settings Using “raspi-config”

  • Update raspi-config to the latest in case they’ve made any bug fixes.
  • Set your password.
  • Set your host name. The host name is how your new machine will be identified on the network. Give it a nice, descriptive name because you’ll use it often.
  • Enable SSH. This will allow you to connect to the machine over the network and get to the console.
  • Set locale options : Locale – “en_US.UTF-8 UTF-8″

To get back in to the config program once you’ve quit, enter the following
sudo raspi-config

Change keyboard layout from “UK” to “US”

The keyboard layout is set to the UK by default. If you’re not in the UK, this will cause some issues (e.g.: tying “#” will give you a “£” instead). Let’s fix this.

sudo nano /etc/default/keyboard

Change XKBLAYOUT to “us”


sudo reboot

Configure Networking

By default, your Pi will be configured to use DHCP. I prefer to set up static IP address for my servers. Change these to match your network.
sudo nano /etc/network/interfaces

iface eth0 inet static

Assign a .local domain (Multicast DNS)

Install the Avahi-daemon so that you can refer to your Pi by name rather than use an IP address. There are other ways of doing this but I’ve found that this approach works nicely.

sudo apt-get install avahi-daemon

Now, if you don’t have it already, download and install Bonjour on your Windows machine from here. This will allow windows to be able to discover multicast DNS services like the one published by Avahi.

After you’ve installed Avahi (on the Pi) and Bonjour on your windows machine, you should be able to locate your raspberry pi on the network by its multicast name. (Your host name with a “.local” on the end).

Note: If you get an error from Avahi which mentions an existing unicast .local domain, fix it by doing the following:

sudo nano /etc/default/avahi-daemon


Connect to your Pi remotely via SSH

If you’re on a windows box, download and install Putty.

You should be able to connect via SSH using the default settings.

Enter your username and password and you’ll get to the SSH console.

Install Remote Desktop

sudo apt-get install xrdp
You can now connect to your Pi and get an X desktop environment using remote desktop.

Enter your username and password when prompted and you’ll be treated with a remote X session.


Congratulations, you can unplug your monitor and keyboard and hide your Pi under the desk or in a cupboard.

Now, time to get a second Pi?


Subscribe to our e-mail newsletter to receive updates.

One Response to Raspberry Pi: Clean Install to SSH Headless Box

  1. Andrew January 23, 2016 at 9:49 pm #

    Incredible, I have spent months looking for a way to run X from my windows desktop and there you have it, dead easy, just one line. Thanks you, thanks you, thank you.

Leave a Reply