The Raspberry Pi is a great thing: it is real computer, it is cheap ($40), it can interface with electronics, talk to the web and has full HDMI support.

However it runs on Linux, which I have a love-hate relationship with. I love the idea of Linux, but when I start messing around the command line and downloading packages and installing things, I often get lost.

I've assembled bits and pieces from various online posts and guides into this Instructable, which is what I call the "Ultimate Raspberry Pi Configuration Guide".

What this Instructable does is to set up a wireless Raspberry Pi that allows you to:
  • ssh into from the Terminal window on the Mac (or equivalent on another machine).
  • run wirelessly with a static IP for each SD card.
  • automatically startup, no log in
  • set your the time zone
  • skip the GUI of the Raspberry Pi, which bogs things down and is unnecessary for most tasks
  • minimize any external monitor use, specifically never having to lug a monitor over to where the ethernet router lives
  • clone a "basic settings" SD card so that we can have as many base-level installations as we want.

Right now, I have 3 Raspberry Pis running in my closet, each with a different purpose: one runs 7 Twitterbots, one is a Git server and one is an experimentation device for electronics. I plan to add more. 

I wrote this Instructable for someone who has a secure home newtwork. You should have a router that can accept a direct ethernet cable. If you are working at an office, the network configuration settings I've outlined here might have to be adapted for your specific company's network/firewall.

Step 1: Gather Materials

We need the following:
  • The Raspberry Pi itself
  • A power supply with a micro USB cable to power the Pi. Get a 2A one if at all possible
  • An 4gb SD card. For most cases, there isn't a need for anything larger.
  • A USB wifi dongle. There are many of these that are Pi-compatible on the market
  • An ethernet cable to go into your home router
Not pictured, but needed: an HDMI monitor with an HDMI cable, a keyboard and some sort of ethernet router than lets you plug an ethernet cable directly into the back of it.
<p>I typed the wif page on step 12 exactly like it is in your thing but using all my ip info, and it didn't work for me, and now all my wifi settings are lost. </p>
<p>Also, be aware that wifi support is going to be dependent on your dongle. For a lot of hardware, the vendors don't supply support so it takes volunteers to add that support. Other times, that support does exist but not in a &quot;plug'n'play&quot; type fashion i.e. it may require manual compiling of modules (well outside of scope if this is your first time playing with Linux) or installation of a dkms package (this gets complex as well but no where near as complex as compiling your own).<br><br>Linux does support more hardware out of the box BUT it's often slower to get the support to make newer (and/or troublesome) hardware work.</p>
In step 12, after changes are made and before you pull the power, do this.<br>1. Press 'crtl + x' to close nano, 'y' for yes to save, and enter for same filename.<br>2.type 'sudo shutdown now -h' to shutdown and halt. <br>Now proceed with removal of the power....<br>
<p>I doubled checked and I have it right and no dice. The one thing I hate about Linux stuff, crap never works for everyone. </p>
<p>good guide. but I have a problem with Raspberry pi, when I use sudo apt-get install in LXTerminal I get the error E: Sub-process /usr/bin/dpkg returned an error code (1) Do you have any tips.</p>
Hmmm....I'm not familiar with this error, but this post seems to cover some possibilities:<br>http://superuser.com/questions/600010/raspberry-pi-apt-get-upgrade-failed<br><br>Some things to check:<br>1. I'm not sure what sudo apt-get install is supposed to do. Try sudo apt-get update then sudo apt-get upgrade<br><br>2. Try: sudo apt-get clean<br><br>3. The post suggests that the SD Card could be damaged, maybe try a different one.<br><br>Beyond that, I'm not too sure &mdash; you can always ask in the Raspberry Pi forums to get some more seasoned Linux folks to jump in.
<p>It's down to 1 of 3 things (I think).<br><br>1. dpkg is broken because:<br>1.1 it has broken packages (dependencies not met?). For this run:</p><p> sudo apt-get install --fix-missing<br>1.2 Something has gone wrong while installing a package. Quick fix (hopefully this works):</p><p> sudo dpkg --configure -a</p><p>Otherwise, try to remove the offending package using:</p><p> sudo dpkg --purge [package name]<br>2. Something else is using dpkg. You can't run multiple copies of dpkg at the same time. either wait a while, or, if that doesn't work, reboot.</p>
<p>I'm a mac user too, and I found, through all my searching for ways to do it, Apple Pi baker - <a href="http://www.tweaking4all.com/hardware/raspberry-pi/macosx-apple-pi-baker/" rel="nofollow">http://www.tweaking4all.com/hardware/raspberry-pi/...</a></p><p>Its a nice easy GUI way to format an sd card in preparation for flashing an img onto, flashing imgs to sd cards, and cloning them for backups.</p><p>Flashing a NOOBS image takes only a few minutes, and works perfectly every time.</p>
<p>Thanks for sharing! Looks like NOOBS is a solid, useful GUI solution.</p><p>My guide is definitely all about the command line, which is good...if you want to get in deep and learn more about the command line.</p>
This will flash any img to an sd card, not just noobs. But it only works on mac<br><br>I'm pretty much a noob myself at all things pi, and I recently ordered an lcd touch screen for mine, and the instructions given aren't particularly in-depth for installing it onto an existing build, so I was practicing on a new build.<br>There is an img with the lcd driver already, but being a noob, each tweak I made changed something that stopped the screen working properly, so I reflashed the sd card a lot. Not something I'd want to be doing if it took 45 minutes each time!<br><br>I'm all for learning to get to grips with the command line - in fact, I've just installed debian onto an old vista laptop so I can practice - but when you're new to something, you want quick and easy successes which encourage you to learn more, rather than drawn out boring processes...
<p>:) My introduction to Linux has a long one full of dial up speeds and wanting to learn it *all* now! I ended up playing with Linux from Scratch and <br><br>Best tips for your situation:-<br>* If you're doing things like compiling modules and mucking around with the kernel. This is really hard and chances are you're going to find yourself often more frustrated than not. In this scenario, once you've imaged one SD Card, image a second one... So while you're mucking around, you're also creating a whole new SD Card which means your mucking around need never stop!<br>* If you are compiling modules.... chances are someone's already gone through all the pain. Look for ppa's (personal package archives) and the like.<br>* Otherwise, keep a pen a paper handy and take note of your changes. Since 90% of Linux can be configured via text files, reversing changes is also fairly trivial.</p>
<p>If you are going to hook a monitor up at the beginning, why not do all of your configuration that is possible through the monitor? <br><br>If you do not have an HDMI monitor, then simply connect to the Pi with a serial cable, use Putty to connect to it, and then configure it from there. I just do not see the point of using the monitor for one step, and then resorting to command line configuration for everything else, particularly for new users.</p><p>Is this instructable meant to be more of a lesson in linux command line configuration than an actual Raspberry Pi configuration guide? I just cannot wrap my head around doing things the hard way. Configuring wifi when you have a monitor attached takes about 15 seconds and shows you the assigned ip address, eliminating the need for additional software, an ethernet cable, and &quot;treasure hunting&quot; for the ip.<br><br>Please enlighten me as to why this instructable takes the most difficult route to accomplish it's task, adding onion-like layers to what can truly be a simple task.</p>
It would be helpful if you were to actually provide the specific steps to accomplish this, rather than just critiquing the Instructable itself.<br><br>Do realize this: I am no expert.<br><br>I would like to help others make Pi-based projects and will suggest alternatives, as needed.<br><br>Remember, be nice. We're all on the same side here.
<p>He's saying to just use a monitor. If you've had to use a monitor, then use it a little bit longer. When you're connected to a monitor for example, finding the IP address being used is as simple as running &quot;ifconfig&quot;. No port scanning needed. No mucking around with routers etc.<br><br>If you don't have a monitor with HDMI input, look for something with DVI input. You can find relatively (around $6? I think I paid for one) cheap DVI-HDMI convertors (They both use the same signal so there's no processing involved).<br><br>As for the serial cable suggestion - I'd say that's a fail. If you want to use the onboard serial port, you'd need a signal shifter or a USB-Serial cable with 3.3V signal levels on hand (few inexperienced users will have this on hand - you'd usually use these with embedded applications i.e. network switches). It should be possible to do it with 2 usb-serial convertors though I've never done it this way (They're small enough to unplug, move somewhere with a monitor, check, put back for applications without a screen).</p>
<p>That's right you can grab the ip address from ifconfig. Now, I remember why I used the IP scanner. My wifi router is in the other room with a short ethernet cable and lugging the monitor over is unwieldy. I'll adjust the Instructable accordingly and provide 2 different options. Thanks!</p>
<p>Hi, I recently bought a Raspberry Pi and sd card preinstalled with NOOBS,I plugged it in to a TV via HDMI and plugged a 5v micro USB in and it does not boot up, I have tried everything on the Raspberry PI website.<br> <br> Please Help,</p>
<p>While the voltage will be correct, the amperage of your power supply probably isn't high enough. Also note, earlier pi's had some serious issues where power was concerned which necessitated the use of a powered USB HUB. There's a couple of tricks to get around this (I discovered that it could be powered via the USB port - which bypassed the fuses meaning that the one remaining USB port could supply as much current as required... which didn't really help as I still needed a powered hub... it's just that I could remove the power supply cable).<br><br>The other issue you may have (try a different distribution i.e. load up a new SD card with something different) is a corrupt installation. The question is, what do you mean by &quot;does not boot up&quot;? i.e. at what point does it fail? Does it show the colours? Does it get to showing you boot messages? Does it seem to boot and then get stuck? Does it seem to boot and then just seem to reboot?</p>
what is the power output rating of your micro USB? or are you trying to get power from a TV?
Only once everything is plugged in and powered up should you plug in the keyboard USB. I found that with mine, it was drawing too much power from being plugged in initially thereby preventing the Pi feom powering up
Interesting. I saw this problem but only when I was using the HDMI camera and a bunch of other peripherals of the USB. I found that the Pi would reboot when the camera module was activated. Ended up running the USB off a separate power supply, which solves the problem.
<p>When you power it on, cycle through keys: 1 -&gt; 4 and F1 -&gt; F4</p>
Hi Jack,<br><br>This guide is for a blank SD card, starting from scratch so that you can do command line work with Python.<br><br>I've never used NOOBS, but I think you probably want to check out the forums on the Raspberry Pi ssite:<br>http://www.raspberrypi.org/forums/<br><br>Good luck,<br>Scott
<p>Worked perfectly for me.</p><p>Thanks for the tips</p>
<p>You don't need to run a scanner to find the dynamic address for the Pi. Log onto the web management interface for your router and have a look at the DHCP lease list. Plug your Pi into the router and spot the new MAC address and the IP it has been assigned. Whilst you are in there, have a look at the range of the DHCP IP pool. Any static address you assign to the Pi should be outside this range to avoid possible IP conflicts with other DHCP clients.</p><p>Raspian Wheezy uses the WPA-Supplicant for wifi configuration. Your interfaces file should look like this:</p><p>auto wlan0<br>allow-hotplug wlan0<br>iface wlan0 inet manual<br>address 192.168.XX.XX &lt;- Use your own IP address choice<br>netmask<br>wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf</p><p>Your wpa-supplicant file should look like this (a VERY basic config)</p><p>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev<br>update_config=1<br>network={<br> ssid=&quot;MyWifiNetworkSSID&quot;<br> psk=&quot;MySuperSecretPassphrase&quot;<br>}</p><p>Of course, if you are using a Mac or have a Linux box, you can set this all up before you even boot the Pi by directly editing the various files on the mounted SD card partition.</p>
<p>ok. I think I see re: the interfaces file, and the wpa_supplicant.conf file.</p><p>I can still have multiple networks in the wpa_supplicant file, all using that static ip address in the interfaces file?</p>
<p>Thanks for sharing!</p>
<p>make that known hosts file (not unknown hosts)</p>
You are correct.<br><br>For those out there way to do this, in the Terminal window:<br><br>cd ~/.ssh<br>nano known_hosts<br><br>ctrl-K deletes a specific IP + key.<br>ctrl-X + Y + Return will save the file<br><br>This will leave the known hosts file intact and is a better way to handle the RSA/Fingerprint error. It's slightly more steps and can be confusing for the beginner.
<p>by the way, on the mac, you don't have to delete the unknown hosts file. that is like taking a sledgehammer to kill a gnat.</p><p>Just search for and delete the offending line. leave the rest in there.</p>
<p>Getting your IP address this way is going to make you cry...<br><br>This is because the IP address that your Raspberry Pi is assigned is going to be dependant on configuration of whatever is providing that address. i.e. it's *VERY* common for your address to be in the range 192.168.*.* (where * can be any value between 1 and 255) OR in 10.*.*.*. Less common is an address within the range -</p><p>So... get on another computer on the same network, find it's IP address (in Linux and Mac you'd run ifconfig in a terminal. In windows, it's ipconfig in the command prompt) and use that range i.e. if your desktop computer gets an IP address of, it's reasonable to assume that the address your raspberry pi has been given is within the range to Likewise, if your computer has an address of, it's reasonable to scan to<br><br>If you know how, it's worthwhile setting a &quot;static lease&quot; for the raspbery pi in your DHCP server - this gives it the same address EVERY time, and makes it easy to change that address if you ever need to. Otherwise, you can set a static address (in /etc/network/interfaces) on the Raspberry Pi itself.</p>
<p>Can you outline the steps for setting a &quot;static lease&quot;? Thanks!</p>
<p>The problem here is that the way to get set up a static lease is going to be completely reliant on the DHCP server - usually part of your router/modem which means that the interface (and ability to do so - I'm surprised by the number of vendors that don't include an interface to set static leases) to do it can be different for every piece of kit. If you do this, assign the Raspberry Pi an address OUTSIDE of the range that the DHCP server is serving up (but within the same subnet).<br><br>If you are able to see the leases your DHCP server has served up though, it's a hell of a lot quicker getting an IP address that way rather than scanning the network.</p>
<p>if you do want to set a password, change your keyboard settings (if necessary) first. otherwise you'll set your password using a UK keyboard which could make entering it difficult if you change the settings later</p>
Good point! Hadn't thought of that one.
<p>Darn your download does not work!!</p><p>Great article, you share things I have been looking for.</p>
<p>This technique works for *most* networks, but there may be some peculiarities. I'd double-check the steps in the Instructable again. You may have to redo the steps, which is, not uncommon with the Pi. </p><p>If that doesn't work and you have the same problem with the wifi not working, I'd suggest posting the specifics to the Raspberry Pi forums, where some folks might be able to track down your specific situation:</p><p><a href="https://www.raspberrypi.org/forums/" rel="nofollow">https://www.raspberrypi.org/forums/</a></p><p>Good luck!</p>
thanks for sharing. what else have you done with your Pi?
<p>I'm working on a project called &quot;Bot Collective&quot; &mdash; series of Twitterbots with the Raspberry Pi, that have physical &quot;bodies&quot;. Some of which will be mobile with electronics. Website (under development) is www.botcollective.com</p>
<p>Raspian SSH is enabled as standard.For Headless configuration I plug my Raspberry Pi into the Router with an Ethernet cable and use my routers control panel (web interface) to get the dynamic IP address for the Pi. </p><p>I can then SSH to the IP address and log in. (You might have to press [enter] to make the login prompt appear)</p><p>Once logged in the rest of the customisation here can be done.</p><p>For my personal setup where I have my laptop next to my Raspberry Pi I do static IP on a different subnet for my laptop Ethernet port and the Raspberry Pi Ethernet Port and then DHCP for wifi on the laptop and the Pi. </p><p>In this way I connect to the Pi over 100Mbs connection rather than wifi (I know shares the same USB bus on the PI, but should make a little bit faster) and both my computer and the Pi can use their wifi to connect to the Internet.</p><p>Example:</p><p>Laptop.<br>----------</p><p>Ethernet Port IP: Do not set Broadcast or Gateway otherwise the computer thinks it can use this IP address to connect out.</p><p>Wifi (DHCP): in the range: 192.168.1-100</p><p>Raspberry Pi:<br>----------------</p><p>Ethernet Port IP: Do not set Broadcast or Gateway.<br>Actually you only need address and subnet</p><p>Wifi (DHCP) in the range 192.168.1-100</p>
<p>Thanks, you know more about network settings that I do.</p><p>Q: I have two scenarios for my Raspberry Pi setups:</p><p>(1) A Pi which is a Twitterbot, and needs to connect to the larger world<br>(2) A Pi which is a GitPi server and needs to connect just to my home network</p><p>What would you advise for network, broadcast and gateway settings for each?</p><p>Currently, I have these &mdash; which are working fine:</p><p>network<br>broadcast<br>gateway</p>
Hi Scott,<br><br>Maybe a little, but only from tinkering.<br><br>Scenario (1)<br>Maybe add the netmask (usually<br>Then your adaptor knows for IP addresses outside of and it needs to use the gateway<br><br>Scenario (2)<br>You should be able to remove the gateway and broadcast assuming the Pi doesn't need to connect externally.<br>It doesn't really make a difference as the Pi with the static IP is still listed on the router, so computers can connect to it.<br>If this Pi doesn't request external (Internet) traffic then the extra settings aren't doing anything.<br><br>Personally I'd leave the settings as they are and add the netmask.<br>For Scenario 2 if you want to do a sudo apt-get update &amp;&amp; sudo apt-get upgrade or a sudo apt-get install you can do it without messing with your settings.<br><br>have fun with the Pi.<br><br>Albert.<br><br><br>
I thought they were .img files. Did they change? good compilation!
<p>Good catch, fixed!</p>
fantastic instructable, people need to link to this in all their RaspberryPi projects.
Thank you for sharing.

About This Instructable


1,491 favorites


Bio: Scott Kildall is an artist who indulges in network performances and creative coding. He currently is an artist-in-residence at Autodesk.
More by scottkildall: Guide to the T-962A Reflow Oven Water Works: 3D prints of the San Francisco Water System with Map 3D Printing the San Francisco Sewers
Add instructable to: