Skip to content

Raspberry Pi Configuration Command: raspi-config Commands for Trixie (2026)

Run sudo raspi-config to configure Raspberry Pi OS from a terminal. It is the supported menu for Raspberry Pi OS Lite and headless systems, and it also provides non-interactive commands for repeatable setup. This guide covers current Trixie paths and commands without relying on menu numbers that can change between releases.

Need the configuration command only? Run:

sudo raspi-config

Use sudo raspi-config nonint <command> [value] for automation. Read the current value first, keep an SSH recovery session open for remote changes, and do not assume that 0 always means enable for every subcommand.

raspi-config quick reference

Task Command
Open the menu sudo raspi-config
Update the tool sudo raspi-config nonint do_update
Show non-interactive command help sudo raspi-config nonint
Enable SSH sudo raspi-config nonint do_ssh 0
Disable SSH sudo raspi-config nonint do_ssh 1
Enable I2C sudo raspi-config nonint do_i2c 0
Enable SPI sudo raspi-config nonint do_spi 0
Enable 1-Wire sudo raspi-config nonint do_onewire 0
Set hostname sudo raspi-config nonint do_hostname <name>
Boot to console, require login sudo raspi-config nonint do_boot_behaviour B1
Boot to desktop, require login sudo raspi-config nonint do_boot_behaviour B3
Select Chromium sudo raspi-config nonint do_browser chromium-browser
Select Firefox sudo raspi-config nonint do_browser firefox

For many raspi-config interface options, 0 means enable and 1 means disable. This convention is not universal. Check the official non-interactive raspi-config reference before automating an unfamiliar option.

Find the current command for any setting

Use the built-in command list on the Raspberry Pi you are configuring. This avoids copied menu numbers and commands removed or renamed by a later Raspberry Pi OS release:

sudo raspi-config nonint

For a setting that has a get_ command, read its current value before changing it. For example, check SSH first, enable it, then confirm the service is actually running:

1
2
3
sudo raspi-config nonint get_ssh
sudo raspi-config nonint do_ssh 0
systemctl is-active ssh

Keep an existing SSH session open until a second login succeeds. This is especially important when changing network, SSH, boot, or serial-console settings remotely.

Before changing settings

Update Raspberry Pi OS and capture the current state:

1
2
3
4
5
6
7
8
sudo apt update
sudo apt full-upgrade

cat /etc/os-release
uname -a
sudo raspi-config nonint get_ssh
sudo raspi-config nonint get_i2c
sudo raspi-config nonint get_spi

Back up files before direct edits:

1
2
3
4
sudo cp -a /boot/firmware/config.txt \
  /boot/firmware/config.txt.backup-$(date +%F)
sudo cp -a /boot/firmware/cmdline.txt \
  /boot/firmware/cmdline.txt.backup-$(date +%F)

Current Raspberry Pi OS uses /boot/firmware/config.txt. Old instructions that edit /boot/config.txt target a previous layout. Keep cmdline.txt on one line when editing it manually.

Interactive menu or direct command?

Method Best use Limitation
Desktop Control Centre Local desktop and occasional changes Unavailable on Lite/headless systems
sudo raspi-config Guided local or SSH configuration Requires interaction
raspi-config nonint Imaging, scripts, fleet provisioning Options can vary by model/release
Direct file or system tool Advanced settings and auditing Easier to make an invalid configuration

Use Imager customization for the first user, hostname, Wi-Fi, locale, and SSH whenever preparing a new card. Use raspi-config after first boot or when working over SSH.

Configure hostname

Validate the current hostname and addresses:

hostnamectl hostname
hostname -I

Set a lowercase hostname containing letters, numbers, and hyphens:

sudo raspi-config nonint do_hostname pi-kitchen
sudo reboot

After reboot, test mDNS from another computer:

ssh <username>@pi-kitchen.local

If .local does not resolve, use the address reported by the router or hostname -I; do not assume hostname failure before checking mDNS support on the client.

Enable SSH safely

Enable the server:

sudo raspi-config nonint do_ssh 0
systemctl status ssh --no-pager

Use a key from the client computer:

1
2
3
ssh-keygen -t ed25519
ssh-copy-id <username>@<pi-address>
ssh <username>@<pi-address>

Confirm key login in a second terminal before disabling password authentication. Follow the security hardening guide for SSH policy, firewall, and recovery planning.

Configure Wi-Fi with NetworkManager

From Raspberry Pi OS Bookworm onward, NetworkManager is the default network manager. Inspect connections with:

1
2
3
nmcli device status
nmcli connection show
nmcli device wifi list

Connect to a visible network without placing its password in shell history:

sudo nmcli --ask device wifi connect "<SSID>"

Set the correct WLAN regulatory country through the interactive menu:

sudo raspi-config

Choose the localisation/WLAN country option shown on the current system. The available Wi-Fi channels and power depend on this setting. For static addresses, priorities, hidden networks, and recovery, use the NetworkManager guide.

Configure locale, keyboard, and time zone

Inspect the current values:

localectl status
timedatectl status

Use the interactive localisation section for locale and keyboard. A time zone can also be set directly:

sudo timedatectl set-timezone Asia/Tokyo
timedatectl status

Do not confuse locale with time zone: locale controls language and formatting, while time zone controls local clock representation.

Configure boot target and login

Current non-interactive boot choices include:

Value Result
B1 Console, login required
B2 Console, automatic login
B3 Desktop, login required
B4 Desktop, automatic login

For a headless server, requiring login is safer:

sudo raspi-config nonint do_boot_behaviour B1

For a locally supervised kiosk, automatic desktop login may be appropriate:

sudo raspi-config nonint do_boot_behaviour B4

Automatic login weakens local access control. Do not enable it merely to avoid entering a password on an exposed device.

Configure hardware interfaces

Enable only interfaces required by connected hardware:

# I2C sensors and controllers
sudo raspi-config nonint do_i2c 0

# SPI displays, ADCs, and other peripherals
sudo raspi-config nonint do_spi 0

# DS18B20 and other 1-Wire devices
sudo raspi-config nonint do_onewire 0

# UART hardware, without deciding console policy
sudo raspi-config nonint do_serial_hw 0

Serial hardware and the serial login console are separate settings. For an application using UART, enable the hardware and disable the console after confirming you retain another recovery route:

sudo raspi-config nonint do_serial_hw 0
sudo raspi-config nonint do_serial_cons 1

Reboot, then verify devices and kernel messages rather than assuming success:

ls -l /dev/i2c-* /dev/spidev* /dev/serial* 2>/dev/null
sudo dmesg | grep -Ei 'i2c|spi|serial|uart'

Choose Chromium or Firefox

Install the desired browser first, then select it:

1
2
3
4
5
6
sudo apt update
sudo apt install chromium firefox

sudo raspi-config nonint do_browser chromium-browser
# or
sudo raspi-config nonint do_browser firefox

Selecting an uninstalled browser does not install it. For Google Account synchronization and native Chrome ARM64 availability, see the Chrome and Chromium guide.

Configure OverlayFS read-only root

Raspberry Pi OS can place a temporary RAM-backed writable layer over the root filesystem. Changes then disappear on reboot. This is useful for kiosks and appliances but dangerous when service data must persist.

Use the interactive supported path:

sudo raspi-config

Choose Performance Options → Overlay File System, then decide separately whether to protect the boot partition. Before enabling it, follow the OverlayFS preparation and recovery guide.

Edit config.txt only when necessary

Device Tree parameters, overlays, and some firmware settings live in /boot/firmware/config.txt:

sudo nano /boot/firmware/config.txt

Audit active declarations before adding another:

grep -nE '^[[:space:]]*(dtparam|dtoverlay|camera_auto_detect|display_auto_detect)' \
  /boot/firmware/config.txt

Duplicate or conditional entries can make troubleshooting confusing. Use dtoverlay -h <name> and the official config.txt documentation for supported parameters.

Check bootloader settings

Read the current EEPROM bootloader configuration:

sudo rpi-eeprom-update
sudo rpi-eeprom-config

Do not change BOOT_ORDER from a copied value without decoding it and keeping bootable recovery media. Use the interactive boot-order option where possible.

Verify after reboot

Run a consistent post-change check:

cat /etc/os-release
hostnamectl hostname
nmcli device status
systemctl is-active ssh
sudo raspi-config nonint get_ssh
sudo raspi-config nonint get_i2c
sudo raspi-config nonint get_spi
systemctl --failed
journalctl -b -p warning --no-pager
vcgencmd get_throttled

Test the feature itself: connect over SSH, scan the I2C bus, exchange UART data, or reboot the kiosk and confirm its persistent state.

Troubleshooting

sudo raspi-config: command not found

Install or repair the Raspberry Pi OS package:

sudo apt update
sudo apt install raspi-config

If the system is Debian or Ubuntu rather than Raspberry Pi OS, raspi-config may not be the appropriate configuration layer.

A non-interactive option returns an error

Update the package and show its current command list:

sudo raspi-config nonint do_update
sudo raspi-config nonint

Options can differ by board and OS version. Do not fall back to an old menu number or undocumented command without checking the current official reference.

Wi-Fi stopped after an old tutorial

Undo manual edits to legacy dhcpcd or wpa_supplicant configuration if they conflict with NetworkManager, then inspect:

1
2
3
4
nmcli general status
nmcli device status
nmcli connection show
journalctl -b -u NetworkManager --no-pager

The Pi does not boot after editing config.txt

Power down, mount bootfs on another computer, compare the file with its backup, and remove only the last known change. Avoid replacing the whole file because Imager and board-specific sections may be required.

A setting changes but the device does not appear

Check whether a reboot is required, then inspect /dev, dmesg, pin assignments, wiring, voltage, and overlay conflicts. Enabling a controller cannot correct physical wiring or an incompatible peripheral.

FAQ

What is the Raspberry Pi configuration command?

Use sudo raspi-config for the supported terminal menu. Current Raspberry Pi OS also provides a desktop Control Centre and direct system tools.

Where is config.txt on Trixie and Bookworm?

Use /boot/firmware/config.txt. The older /boot/config.txt path appears in outdated guides.

Can raspi-config be automated?

Yes, with sudo raspi-config nonint <command>. Verify every option against the current release because values and availability are not uniform.

Does raspi-config configure static IP addresses?

Use NetworkManager and nmcli, or preferably configure a DHCP reservation on the router. Do not restore obsolete /etc/dhcpcd.conf instructions on a current default installation.

Must every change reboot?

No, but firmware, boot, Device Tree, interface, and OverlayFS changes commonly do. Reboot when the tool requests it, then verify the resulting state.