Raspberry Pi – Recommended Initial Configurations

You have just finished installing a fresh instance of Raspberry Pi OS (if you haven’t yet, visit this link). You are about to boot the Pi for the first time. You are not sure what is the best way to start working with the Pi. This article will cover some initial configurations that are very helpful and will make working with the Pi much easier.

Enable SSH

There are several ways to enable SSH on your Pi. Here we will cover two ways, headless mode, and regular mode.

Headless Mode

Headless mode means that the Pi is not connected to a monitor, keyboard, and mouse but rather all communications with the Pi are done over the network. This mode is commonly used and very convenient.

In headless mode, you need to create an empty text file called “ssh” in the root directory of the SD card. This will communicate to the Linux OS that you would like to have ssh enabled by default. The OS will automatically enable SSH and delete the file.

Steps:

  1. Take the SD card from the Pi and insert it into your PC.
  2. Open the card in file explorer
  3. create a file named ssh
  4. remove the card from the PC
  5. insert the SD card back to the Pi
  6. Power the Pi

Make sure to have the Pi connected to the network via LAN cable to your router/switch. We will also cover how to connect to the WiFi automatically and get rid of all the cables.

Normal Mode

The normal mode in this context means having the Pi connected to a monitor, keyboard, and mouse.

Steps:

  1. Click on the Application Menu on the top-right corner
  2. Go to Preferences->Raspberry Pi Configurations
  3. Click on the Interfaces tab
  4. Set SSH to enabled
SSH enabled

Enable VNC Server

VNC server allows you to remotely connect to the desktop environment of the Pi over the network. This is a very powerful tool that helps you enjoy the desktop experience of the Pi without the need to connect a keyboard and mouse directly to the Pi.

Raspberry Pi OS comes equipped with VNC server, you just need to enable it to start automatically on boot. So, to answer the question of how to enable VNC server on Raspberry Pi there is one good answer.

Connect to the Pi via SSH, and use the command line to configure the Pi. If you haven’t set up an SSH server follow the steps above.

On the Pi terminal

sudo raspi-config

This will open a terminal-based GUI

Select option number 3 Interface Options.

Raspberry Pi config

Scroll down to VNC, and press Enter.

Raspberry Pi config

Select <Yes>. and you are done.

Raspberry Pi config

Wi-Fi Auto-connect

It is very much more convenient to have the Raspberry Pi automatically connect to the Wi-Fi network.

Raspberry Pi OS uses a program that runs in the background called wpa_supplicant, this daemon program is responsible for connecting securely to Wi-Fi networks.

We can make use of wpa_supplicant to connect automatically to our network. We can save the credentials of our network in the configurations file of wpa_supplicant. In turn, wpa_supplicant uses this configurations file to search for networks in order to connect to them.

In the terminal open the wpa_supplicant config file with root privileges using a text editor like vim or nano.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add the following block at the end of the file.

network={
   ssid="name of the network"
   psk="SecretPassword"
}

If your SSID is hidden, use the configurations below.

network={
   scan_ssid=1
   ssid="Test Wifi Network"
   psk="SecretPassWord"
}

Leave a Comment