Whenever I get a new Raspberry PI to setup I have to go through the same motions every time. Time for a post to remind myself exactly what steps I go through to get that perfect setup.
Disclaimer: This is MY idea of a good setup, if you like it follow along, if not. Go have a soda pop!
Tasks
- Install Raspbian on SD Card
- Configure headless options
- Login
- Configure pi with built in utility
- Upgrade and Upgrade
- Install Packages
Install Raspbian on SD Card
- Grab Rasbian image from raspberrypi.org
- Download Etcher (if you don’t have it)
- Follow etcher directions to write image from raspberrypi.org to your SD card.
Configure headless options
In this section we need to create a couple of files on the boot partition of the SD card we just created. The first file called ssh will enable ssh, the second file wpa_supplicant.conf will configure wifi.
- Open the boot filesystem on your computer
- Create an EMPTY file called ‘ssh’. Do not allow any file extensions. If you are unsure how to do that, google ‘show file extensions’
- Create another file called wpa_supplicant.conf and put the following in it.
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK-NAME"
psk="NETWORK-PASSWORD"
}
- Save that file
- Eject SD Card
- Cram it in Raspberry PI
- Boot the pi.
- You should be able to find the IP address by rooting around through your router.
Login
If that all went well, we can now log into the raspberry pi.
- Use your favorite ssh client / terminal. On windows mine is Putty. For mac os and linux (or any unix variant) you can most likely just use a a terminal for this. Google “how to ssh into a linux computer”
- Default user name is: pi
- Default password is: raspberry
Configure pi with built in utility
We will use the raspi-config utility to configure some basic options.
- Run sudo raspi-config
- Change User Password
- Network Options -> Hostname
- Localization Options -> Change Locale (Dont forget to deselect the default en GB setting
- Localization Options -> Change Timezone
- Localization Options -> Keyboard Layout
- Advanced Options -> Expand Filesystem
- Finish (A reboot will be required)
Upgrade and Upgrade
Here we make sure that the pi is as up to date as possible before starting a project.
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Install Packages
Install basic packages that I use all the time.
- Build Essentials
- sudo apt-get install build-essential
- GIT
- sudo apt-get install git
- VIM
- sudo apt-get install vim
- SMASH (this is my own custom setting BS that I have had on every unix type box I have worked on for decades.
- git clone https://github.com/KalebClark/smash.git ~/.smash
- cd ~/.smash
- ./install.sh