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:
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:
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:
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:
Back up files before direct edits:
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:
Set a lowercase hostname containing letters, numbers, and hyphens:
After reboot, test mDNS from another computer:
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:
Use a key from the client computer:
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:
Connect to a visible network without placing its password in shell history:
Set the correct WLAN regulatory country through the interactive menu:
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:
Use the interactive localisation section for locale and keyboard. A time zone can also be set directly:
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:
For a locally supervised kiosk, automatic desktop login may be appropriate:
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:
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:
Reboot, then verify devices and kernel messages rather than assuming success:
Choose Chromium or Firefox¶
Install the desired browser first, then select it:
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:
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:
Audit active declarations before adding another:
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:
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:
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:
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:
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:
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.