If you're setting up a kiosk display, digital signage, or just want your Raspberry Pi to launch Firefox at startup, here's a simple way to do it using the built-in autostart feature of Raspberry Pi OS.
What You Need:
Raspberry Pi with Raspberry Pi OS (with Desktop)
Firefox installed (sudo apt install firefox-esr if not)
Steps to Auto-Start Firefox
Open Terminal
Press Ctrl + Alt + T or access it from the menu.
Create the Autostart Directory (if it doesn’t exist):
mkdir -p ~/.config/AutoStart
Create a Desktop Entry for Firefox:
nano ~/.config/autostart/firefox.desktop
Paste the Following Code:
[Desktop Entry]
Type=Application
Name=Firefox
Exec=firefox https://example.com
X-GNOME-Autostart-enabled=true
Replace https://example.com with the website you want to open automatically.
Save and Exit
Press Ctrl + X, then Y, then Enter.
Reboot Your Pi:
sudo reboot