Raspberry Pi 3 headless setup


I wanted to setup a small server on my network for a few applications.

I wanted something fanless and low-power. As such, my original plan was to use a mini x86 PC, like the Intel NUC or Gigabyte Brix. However, the prices start at around $100, and that’s before adding storage (SSD) and memory. Looking around, I decided to use a single-board ARM computer.


The elephant in the room here is the Raspberry Pi 3. However, I was originally planning to purchase an ODROID-C2, since it has more RAM, gigabit ethernet, and support for EMMC. In the end, I chose to go with the Pi3, since it has better community and software support. Below are the parts I ordered.


For simplicity’s sake, I decided to use Raspbian, a port of Debian for the Raspberry Pi. I opted not to use NOOBS, as outlined below.

  • Download Raspbian (I used the lite version, since this will be a headless machine)
  • Format your MicroSD card as EXT4 (I used gparted for this)
  • Extract the .img file from the .zip file and use dd to write the image to the MicroSD card (sudo dd status=progress bs=4M if=2016-03-18-raspbian-jessie.img of=/dev/sdX)
  • Insert the MicroSD card into the Pi3, connect all the cables, and boot

If you don’t want to use Raspbian, there are many more options available.


I highly recommend running through the automated configuration tool, raspi-config, immediately after booting in Raspbian.

sudo raspi-config

I changed the following options:

  • Expand filesystem (otherwise you won’t be using your entire MicroSD card)
  • All internationalization options (pay attention to the keyboard layout)
  • Password
  • Hostname
  • Memory split to 16MB (since this server is headless)

Change your locale and keyboard layout before you change your password, as your keystrokes might be incorrect with the wrong keyboard layout.

Change your password

In case you missed it above, change the default password using the command below (or raspi-config).


Setup wireless

Next, you’ll need to get online. I’m currently using ethernet, as I found that the performance of the internal WiFi antenna wasn’t great. However, if you’d like to use WiFi, it can be setup using the command line. Edit the /etc/wpa_supplicant/wpa_supplicant.conf file to include the following information.


Then, restart the Pi3 to verify your network is up.

sudo reboot

Note – I already setup a DHCP reservation on my OpenWrt router for the Pi3, so I didn’t have to set a static IP manually on the Pi3 itself.

Install updates

Next, I’m going to install updates and remove unneeded packages.

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoclean && sudo apt-get autoremove

Update firmware (optional)

Optionally, you can update the Pi3 firmware using the command below. This is equivalent to updating your PC’s BIOS, and thus, does not need run often.

sudo apt-get install rpi-update && sudo rpi-update
sudo reboot

Disable unnecessary services (optional)

If you’d like, you can see which services are running and disable anything that you’re not using.

sudo service --status-all

Disable swap (optional)

I’m choosing to disable swap, since excessive read/writes can corrupt a SD card.

sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt-get remove dphys-swapfile
sudo reboot

Filesystem check (optional)

Here, I’m telling the filesystems to automatically repair inconsistencies during boot. This will slightly increase startup time.

sudo sed -i "s/#FSCKFIX=no/FSCKFIX=yes/g" /etc/default/rcS

Then, set it to check every three mounts.

sudo tune2fs -c 3 /dev/mmcblk0p2


That’s it! Let me know how you use your Raspberry Pi!



11 thoughts on “Raspberry Pi 3 headless setup

  1. Great post, I learned a lot and will refer to it again when I get my Pi 3. Headless really means no dedicated keyboard and monitor right? I mean you need both to set the Pi up and get access to it later.

    Thanks again, good stuff.

    • Yep! Headless means you set it up with a keyboard/mouse/monitor, then remove all that and let it run. Mine sits behind my TV, only power and ethernet plugged in. When I need to access it, I can SSH in.

  2. Excellent and very useful for a Newbie (NOOBIE??). I did all that, except disabling swap which I will get around to after a while. But I was looking for help on how exactly does one use the Pi in SSH mode. I have enabled SSH, pulled out the display, ethernet , keyboard and mouse. How can I access / control the Pi from machines running Ubuntu 16.04 and Windows10? My aim is to provide access to to the printer connected to the Pi to all my tablets, mobile phones desktop and laptops. Thanks in advance.

  3. I know my way around debian, but expected some rasberry specifics and you gave me and excellent overview. Thanks!

  4. I am very new to all this and want to set up an RPi3 as a Pi-Hole.
    How exactly does one setup a DHCP reservation on a router?
    How do I find the mac address of the ethernet port before I load anything?

    • The setup of a DHCP reservation is different for each router. You’ll have to Google it.
      As far as finding your Pi MAC address, check out this page.

Leave a Comment