Login Register



(Reading time: 3 - 6 minutes)
Popular

Initial Setup of a new Raspi

This article will explain how to do an initial setup of your new Raspberry Pi computer.

Items you will need

  1. A Raspberry Pi computer (any model)

  2. A power source (one as specified for your model)

  3. A keyboard & mouse (optional) I will show you later how you can setup your computer without having either these or the monitor. This is known as using it HEADLESS from another computer either your desktop or laptop.

  4. A HDMI monitor (optional)

  5. A case (optional)

  6. A device for burning (loading the software) to a micro-SD card, either internal or external. I have one that looks like a snowman and plugs into a USB port.

  7. If no software is included on a micro-SD then you will need a blank one or one that can be reformatted.

  8. Download Operating System software from the Raspberry Pi download page .

  9. Software for burning the operating system to the micro-SD card. I use a program from https://www.balena.io/etcher/ called Etcher. It is available for Linux and the 2 other unmentionable operating systems.

  10. After the software is loaded on the micro-SD insert in to the Raspi computer with the contacts facing up. Then connect the power supply. If you are using a monitor you will see a lot of lines scroll up on the screen. You will then see a menu if using the Graphical User Interface (GUI) with the Raspian/Buster software.

  11. On the upper left will be a icon of a raspberry.

    1. Click on that and scroll down until you see a menu item called “Raspberry Pi Configuration”.

  1. Dec 23, 19 On the “Localisation tab” you should set all 4 of the items for your local area. Today I discovered a problem with my Raspi is that if you live in any country other than the UK, you should NOT change the password first if you use special characters in your password. You should first change “Location/Keyboard” from the Raspberry Pi Configuration or sudo raspi-config if in the terminal mode, to your current location and then change your password. The reason for this is that the default keyboard is set to a UK location and some of the keys are different on the UK keyboard from keyboards from other countries. I found this out the hard way as I changed my password and then the keyboard location and was NOT able to log in again as I use some special characters in my password. For information on how to do this see: Chapter 14.

  2. The next item you should select is “Change Password” and enter your own secure password.

  3. Another item you will see is “Boot”. This will allow you to select where you want it to boot to when it is turned on. It will be either “Desktop” or CLI which means “Command Line Interface”, or to the terminal. This option will only be available if you install Buster-Full or Buster-Desktop. Buster-Lite does not have a “Desktop” to start, only a CLI.

  4. On the “Interfaces tab” I generally select “SSH Enabled” so I can connect with my laptop to the Raspi. This is required if you plan to use your Raspi in the headless mode. If you have a camera attached to the Raspi you could also check the enabled button for that.

  5. You can go back to this menu option at any time in the future if you need to change any of the items by clicking on the “Raspi Configuration” menu option or from a terminal enter sudo raspi-config.

  6. You might want to check out the other options presented on the menu. After you have made your changes it will ask if you want to reboot. In order for your changes to take effect it will require you to reboot so just select “Yes”.

  7. Also on the top line menu will be a small black box with a “>_” in it and if you mouse over it it should show the word “Terminal”. Click on this and it will open a terminal screen or more than one screen. I close all of the extra ones by clicking on the X in the upper right corner. You should then enter “sudo apt update”. It may ask for your password, if so enter it. It will then display a number of lines of text, which will scroll by too fast to be read so don’t worry about them. It will then show either a number of applications to be upgraded or say “All applications are up to date.”, which means you are good to go. If it shows a number to be upgraded enter “sudo apt upgrade -y”. It will then do the upgrade. If it is the first time this is done there will probably be a lot to upgrade so it will take awhile. These commands should be run on a regular basis as there are generally new upgrades being published on a regular basis. You can then close the terminal window and do whatever you need to do.

As an additional security option you should perform the following in a terminal window

  1. Enter sudo add new user name. You will then be asked for a password. You should then enter sudo adduser new user name sudo. This will add the new user to the sudoers group so you can perform root actions. Then log out and log back in again as the new user. Then enter sudo visudo. The first time you run this command it will ask which editor you want to use. I generally choose “nano”. Scroll to the end of the file and enter new user name ALL=(ALL) NOPASSWD: ALL Press CTL_X, Y and ENTER to close and save the file. When you enter a sudo command it will no longer ask for your password. This is optional as it will lessen security but will increase productivity.

  2. You should now delete the PI user with the following command: sudo userdel pi as this improves security if the bad guys try to log in as pi and it is no longer there.

Summary

You should now have your Raspi up and running with a lot to learn about it and how it can help you with your daily computer tasks. One thing to remember is the Raspi has a limited amount of memory and the processor is not as fast as your laptop or desktop computers. This means it could crash more often if you have a lot of windows open and any action will take longer due to the slower speed. Supposedly the model 4 has eliminated some of these problems.