So, you have just flashed your Raspberry Pi OS image to your SD-card. Now, you need to make some basic configuration settings.

This is typically done by entering

sudo raspi-config

which will give you a main and several sub menus to enter your display settings for your Pi.

These menus are slightly different depending on the Pi Model that you have and may evolve with a major Raspberry Pi OS update. Older instructions may, therefore, point to the wrong number and confuse beginners – and sometimes advanced users alike.

While clicking the menu option is not hard at all, it’s faster and easier doing it via the command line.

In this article, I will show you the key commands that you typically need when setting up your software for a digital picture frame.

Where the configuration settings are stored

The configuration setting are not stored in one place but spread across various files, symbolic links, and systemd services.

Only the display settings are stored in a config.txt. Since Bookworm that file lives in /boot/firmware/, not in /boot/ — older instructions (including earlier versions of this page) point at the old location, and editing a config.txt that is not the one being read is a frustrating way to spend an evening.

You can call it up with

cd /boot/firmware && nano config.txt

This command opens the file in a read-only mode. If you want to modify it, you have to add “sudo” before the “nano”.

Close the file with CTRL+X.

The terminal commands for frequently used settings

So here are the commands that I use most often. The general syntax is

sudo raspi-config nonint

followed by the command. As you can probably guess, “noint” stands for “non interactive” which means that there is no menu.

This applies to all commands, except for the password change.

Change User Password

Enter

passwd

on the command line to change your own password, or

sudo passwd yourusername

to change somebody else's.

Note that there is no pi user any more. Raspberry Pi OS stopped shipping the default pi/raspberry account in 2022 — you choose the user name yourself in Raspberry Pi Imager, or the Pi asks you on first boot. Every instruction on the internet that says pi@ or /home/pi/, this blog's older articles included, means "your user", not literally pi.

Enter your new password and confirm it.

Change your hostname

After a fresh installation, the hostname of every Raspberry Pi is “raspberrypi”. Most people probably want something a bit more customized.

So if you want to change your host name to e.g. “pictureframe” enter

sudo raspi-config nonint do_hostname pictureframe

You will have to reboot after this change.

Change your boot options

You can instruct your Pi to either boot into the text-based console or the graphical user interface desktop. Additionally, you can ask for a password at boot, but I assume here that you would want an automatic login.

To choose the Console Autologin enter

sudo raspi-config nonint do_boot_behaviour B2

To choose the Desktop (GUI) Autologin enter

sudo raspi-config nonint do_boot_behaviour B4

Which one you want depends on the software. The Pi3D route needs a graphical session, so it needs one of these; picframe3 needs neither, because it renders straight onto the screen and starts before anybody logs in.

Wait for network at boot

I recommend activating this setting to make sure that your network is properly mounted and the Internet connection established before the boot process is completed. You specify a timeout in seconds, so if the network cannot be found, it will still boot, albeit slower.

The command for a 30 seconds timeout is

sudo raspi-config nonint do_boot_wait 30

Disable Overscan

If the display on your screen is not completely filled, you will need to disable Overscan.

This is done by typing

sudo raspi-config nonint do_overscan 1

Putting a “0” instead of the “1” add the end, will enable it again.

Only on older boards and older images. Overscan was an HDMI-era workaround, and the full KMS driver on a Pi 4 or Pi 5 handles the screen's mode itself, so this switch does nothing useful there. If you have a black border on a modern Pi, the mode is the thing to look at, not overscan.

Specify GPU Memory

This one is history. The memory split belonged to the old closed graphics stack. With the full KMS driver the GPU takes memory as it needs it, so gpu_mem is ignored on a Pi 4, and a Pi 5 has no such setting at all. Setting it to 128 or 256 MB for Pi3D, as I used to recommend here, changes nothing today.

I am leaving the commands on the page because they still turn up in old tutorials and you may want to know what they were:

sudo raspi-config nonint get_config_var gpu_mem /boot/firmware/config.txt
sudo raspi-config nonint do_memory_split 128

(Note the path: /boot/firmware/config.txt since Bookworm. Passing /boot/config.txt reads a file that is not there.)

Set the Timezone

You should always set the correct time zone, as timer triggered event like those defined in crontab or systemd depend on it.

The command for Sidney would be

sudo timedatectl set-timezone Australia/Sydney

Input your region (Africa, America, Asia, Australia, Europe, Indian, Pacific, UTC) followed by the capital of your country or state.

Other examples are

sudo timedatectl set-timezone Europe/Berlin
sudo timedatectl set-timezone Europe/Paris
sudo timedatectl set-timezone Europe/London
sudo timedatectl set-timezone America/New_York
sudo timedatectl set-timezone America/Los_Angeles
sudo timedatectl set-timezone Pacific/Auckland

For a full list of available time zones enter

timedatectl list-timezones

I wonder what the logic behind these timezones exactly is. Sometimes, the capital of the country is used, sometimes the largest city (e.g., for Nigeria, Lagos is shown instead of Abuja. And not to mention “Sacramento”…). But I am sure that hours of valuable committee discussions at the United Nations went in the process of determining them.

Specify Locale

Locale specifies language, country, characters, and sorting order. It is an important setting of you want to have e.g. filenames with special characters displayed properly.

Locale is easy to specify. Enter

sudo nano /etc/locale.gen

and you will get a long list that looks like

# en_SC.UTF-8 UTF-8
# en_SG ISO-8859-1
# en_SG.UTF-8 UTF-8
en_US ISO-8859-1
# en_US.ISO-8859-15 ISO-8859-15
# en_US.UTF-8 UTF-8
# en_ZA ISO-8859-1
# en_ZA.UTF-8 UTF-8
# en_ZM UTF-8
# en_ZW ISO-8859-1
# en_ZW.UTF-8 UTF-8
# eo UTF-8

Look for your country and language and remove the “#” (including the space) to add it. I believe you can have as many as you like.

Save the file with CTRL+O and exit with CTRL+X, then actually generate the locales you just ticked:

sudo locale-gen

Without that last step the file is edited but nothing changes.

Always reboot

While a password or time zone change will not require a reboot, most of the other options do, so it’s always safe to

sudo reboot

once you are done.

More information

All these commands are documented in the GTK version of raspi-config which is an application that allows the configuration of Raspberry Pi system settings. It is a great source for finding the terminal command for every raspi-config menu item from the GUI. And you can study the original raspi-config script on Github. If you copy it into a text editor like Sublime it is much easier to read as it shows colors.

Conclusion

While you can always use the “sudo raspi-config” command to enter the menu settings, I found it faster to make changes via the command line.

Especially, if you repeatedly need to make the same changes, you can just combine several commands with “&&” (one space before and after), so you just have one line that you need to copy, e.g.

sudo raspi-config nonint do_hostname pictureframe && sudo raspi-config nonint do_boot_behaviour B4 && sudo raspi-config nonint do_boot_wait 30 && sudo timedatectl set-timezone Europe/Berlin

Just copy & paste a line like the above into the Terminal, and you make four changes in one go. No more climbing around in the menu structure.