Setting up a new Raspberry Pi

So, you’ve downloaded Raspbian, put it on a SD card, maybe with Etcher. What’s next?

You have a few things on hand:

  • USB keyboard
  • USB mouse
  • HDMI monitor
  • mini USB power supply

Hook it all up. When you plug in the power it should boot up. Log in as pi, with the password raspberry.

It’s running, but the keyboard doesn’t work quite right, some of the keys produce different characters than you expect. The time is wrong. Some characters don’t print correctly. You keep running out of disk space, even though you used a big SD card.

Let’s fix some things.

Run sudo raspi-config.

First, change the password for the pi user. This makes your pi a bit more secure.

Next, you might want to change the hostname of your pi, especially if you have multiple Raspberry Pis on your network. Go into the networking options and change the hostname to something that reflects what you are going to use your pi for, or follow some naming convention of your own design.

If you have a Pi 3 or later, or a USB wifi adapter for your older Pi, you can set up Wi-fi in the network options. You’ll need to know the SSID of the network you are connecting to, as raspi-config doesn’t have an ssid browser.

If you can’t remember the SSID of the network, you can scan for wireless networks yourself by exiting raspi-config and using the iwlist command: iwlist scan | grep -i ssid

Next, set up localization options. By default Raspbian is set up as if it were in Great Britain. If you are not in Great Britain, the symbols on your keyboard are likely to produce the wrong characters, dates might be formatted incorrectly, and other such weirdness might happen.

Select Change Locale. You’ll see a long list of things like “en_CA.UTF-8”. Select the locales to generate by picking the ones that apply to you: The letters before the _ of the locale identifier represent the language, e.g. en for English. The letters between the _ and the . represent the country, e.g. CA for Canada, GB for Great Britain, US for United States. Choose locales ending with “.UTF-8” to use Unicode. Of the generated locales, select the default one.

Change the timezone to match yours.

Change your keyboard layout. In English North American, US 101 with no compose key is usually the default.

If you already set up Wi-fi, you don’t need to change the Wi-fi country.

If you are going to be running your Pi headless (without a keyboard and monitor attached) you’ll want to be able to access it over the network. Go into Interfacing Options and select SSH so that you can log in with a text console over the network. If you want a graphical network option, enable VNC as well. The rest of the options will depend on what you want to user your Pi for.

Finally, you should resize the boot partition so that it uses up the full size of the sd card or you will rapidly run out of space.

That’s it! Have fun!