RPI SETUP headless
Posted by kll on January 29 2026 10:48:08
every time i play with Raspberry Pi
i need to do 'my default ' setup first
and that changes over time ( OS version.. board version )
also on what system i do the OS burn from ( to what media )

so with too many options it is always confusing to make a
clean tutorial / manual
esp the here most complicating thing is my need to use
fixIP
as i often use that RPI remotely ( or as server )
if you not need can skip that part and it gets much more easy..
Extended Blog


Media


i run RPI's on
* uSD
* USB stick
* USB adapter M2 SSD

and can burn uSD
from PC with
* * SD card reader
from laptop with
* * SD uSD adapter
from 'other' RPI RPIOS desktop on USB
* * free uSD slot

and can burn USB
from PC / Laptop / RPI
* * free USB port

now using the
Raspberry Pi Imager v2.0.6



System OS


depending what i want try i setup
Raspberry Pi OS 64 bit
* Lite ( .5GB )
* desktop ( 1.2GB for the reduced desktop / optional 1.9GB for the FULL desktop with all preinstalled apps )

currently the
port of Debian Trixie
Released 2025-12-04


as i work headless
( power and ethernet cable only )
* i not use other desktop OS on RPI unless
* * it allows for VNC ( RPI free VNC server lic and free VNC viewer on PC / .AppImage in Ubuntu 25.10 PC )
* * or i do a extra setup with mouse / keyboard / HDMI cable to TV..



Burn it


using the RPI Imager
* selecting
* * Lite
* * desktop

* include pre settings
* * name: rpi4 ( pls use small letters and i use n= 1 2 3 4 for the RPI's i have in my network )
* * user: pi
* * YOURpiPASSWORD

* * enable SSH

BURN

optional remove / insert drive
and
edit cmdline.txt
sudo nano /boot/cmdline.txt
add inside first line
ip=192.168.1.104
( pls check have [space] before and after )

now remove / insert drive to target RPI
( and wait long time for setup partitions ... )
login via PC terminal:

if preset fixIP already
ssh pi@192.168.1.104
YOURpiPASSWORD

sudo nano /boot/firmware/cmdline.txt
now in different directory! and change back the fix IP there
and make fix IP a better way later


or use nmap to find the IP of the new RPI ( given by your router )
nmap -sP 192.168.1.0/24

ssh pi@192.168.1.xxx
YOURpiPASSWORD


Setup



so again deal with that fixIP issue ( the better way )

sudo nmcli c show
if it shows for eth0
'Wired connection 1'
or new?
'netplan-eth0'

and i use
104
for ethernet for RPI4
204
for wifi RPI4

x03 for RPI3 ...

sudo nmcli c mod 'netplan-eth0' ipv4.addresses 192.168.1.104/24 ipv4.method manual
sudo nmcli con mod 'netplan-eth0' ipv4.gateway 192.168.1.1
sudo nmcli con mod 'netplan-eth0' ipv4.dns "10.10.30.1 8.8.8.8 8.8.4.4"

( if used Raspberry Pi Imager and configured WiFi connection there, that's entry-name will be 'preconfigured' or your SSID)
sudo nmcli c mod 'preconfigured' ipv4.addresses 192.168.1.204/24 ipv4.method manual
sudo nmcli con mod 'preconfigured' ipv4.gateway 192.168.1.1
sudo nmcli con mod 'preconfigured' ipv4.dns "10.10.30.1 8.8.8.8 8.8.4.4"

or instead nmcli can use
nmtui

now
sudo reboot



as new burned system is from 12 / 2025
need a update:
sudo apt update && sudo apt upgrade -y


optional: ( my default tools )
sudo apt install -y mc tree fastfetch nmap hdparm
for install fresh editor see https://getfresh.dev/
curl https://raw.githubusercontent.com/sinelaw/fresh/refs/heads/master/scripts/install.sh | sh



also usually
mkdir Projects

if desktop version:

with
sudo raspi-config
3. Interface Options
I3 VNC [enable]
from PC use (install free) VNC Viewer

and in Desktop taskbar enable [CPU][CPU temp]

also adjust the terminal inthere ( edit Preferences )
* Style * Monospace BOLD size 14
* Display * 132 * 32
* Advanced * disable on F10 ( for use it like in mc )



check

drive speed ( in RPI4 )


see
df
with
sudo hdparm -t --direct /dev/sda2
/dev/sda2:
Timing O_DIRECT disk reads: 386 MB in 3.01 seconds = 128.40 MB/sec
( on RPI4 USB 3 )
for my new USB3 Sandisk 64GB ULTRA FLAIR 150MB/s
( on my PC i see 140 MB/sec )
these are READ SPEED, the write speed from a win laptop with 'H2testw' was only 30 MB/sec
( shop 'Advice Lamphun' 250 THB / 6.78 EUR // 5-year warranty) ( update: they raised the price to 290 THB ! in the last 2 weeks )

compare to a :
uSD: ( 32GB SanDisk Ultra (10) A1 )
sudo hdparm -t --direct /dev/mmcblk0p2
/dev/mmcblk0p2:
Timing O_DIRECT disk reads: 128 MB in 3.01 seconds = 42.50 MB/sec

USB3 ORICO adapter M2 SSD (HS-SSD-E3000 256G)
sudo hdparm -t --direct /dev/sdb1
/dev/sdb1:
Timing O_DIRECT disk reads: 512 MB in 1.55 seconds = 330.64 MB/sec



Alias


a basic feature of Linux is that you can declare a alias
alias
will show you the declared aliases
you can 'overwrite' existing names or create new ones

alias ls='ls --color=auto'
alias bye='sudo shutdown now'


that is started already in the file
/home/pi/.bashrc
and you could edit / add there...
but better use a new file:
nano .bash_aliases
for this
alias newname='full command'
also i use it even further
at every terminal start
* show some info about the system
* list some alias
* and prepare easy editing and using to go to your current subdir you play in
using the alias 'work' and 'workedit'

! pls replace [backslash] with backslash character ( can not print that inhere )


.bash_aliases

#!/bin/bash
#.bash_aliases for user pi
# KLL 30.12.2014 // last rev 28.1.2026 rpi4

# user password: pi
USER='pi'
# terminal colors
WHTE='echo -e [backslash]E[37;44m' # white on blue background
BLUE='echo -e [backslash]E[47;34m' # blue on white background
MAGE='echo -e [backslash]E[47;35m' # magenta on white background
GRNE='echo -e [backslash]E[0;32m' # green on NO background
REDE='echo -e [backslash]E[47;31m' # red on white background
BLKE='echo -e [backslash]E[47;30m' # black on white background
BOLD='[backslash]033[1m' # and BOLD
END2='[backslash]033[0m' # end bold

alias di='ls -lh'
alias bye='sudo shutdown now'
alias restart='sudo reboot'

#alias work='echo "goto work:"; cd /home/'$USER'/ && ls'
alias work='cd /home/'$USER'/Projects/ && ls'
alias workedit='nano /home/'$USER'/.bash_aliases'

alias up='cd .. && ls'
alias back='cd $OLDPWD'
alias dh='lsblk -o NAME,FSTYPE,FSSIZE,FSUSED,LABEL,MOUNTPOINT,MODEL'
alias syslog='journalctl'
alias syssetup='sudo raspi-config'
#alias bench='sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash'
alias treesize='tree --du -h'
alias fastnmap='nmap -sP 192.168.1.0/24'

# for use with MC only
alias mc='. /usr/lib/mc/mc-wrapper.sh'

alias update='sudo apt update && sudo apt -y dist-upgrade && sudo apt -y autoremove'

alias show_service='service --status-all'

alias RPI1='ssh pi@192.168.1.101'
alias RPI2='ssh pi@192.168.1.102'
alias RPI3='ssh pi@192.168.1.103'
#alias RPI4='ssh pi@192.168.1.104'

alias dinfo='echo "___ INFO" && docker info && echo "___ CONTAINER" && docker ps --all && echo "___ IMAGES" && docker images && echo "___ NETWORKS" && docker network ls && echo "___ VOLUMES" && docker volume ls'

alias again='. ~/.bashrc'

alias ?='echo "use: work, workedit, again, restart, bye"'

function printhelp {
INFO1='use: di, dh, up, back, mc, '
INFO2='use: update, syssetup, show_service, syslog, treesize, fastfetch, fastnmap, fresh'
INFO3='use: for docker: dinfo'
INFO5='use: ?, work, workedit, again, restart, bye'
$BLKE$INFO1$END2
$BLKE$INFO2$END2
$MAGE$INFO3$END2
$BLKE$INFO5$END2
}

echo ""
#hostnamectl
hostname -I
echo -n 'date: ' && date +"%a %Y-%m-%d %H:%M:%S"

printhelp

work





RPIO OS with SSH enabled has default SFTP for file-transfer
but for usual file-manager better use

Samba


allow local network file-transfer
* PC
* RPI4 /home/pi/Projects/

mkdir ~/Projects
sudo apt install -y samba

sudo nano /etc/samba/smb.conf


#add at end:
[rpi4_share]
path = /home/pi/Projects
writeable = yes
browseable = yes
public = no

save with [ctrl][s][ctrl][x]

sudo smbpasswd -a pi
YOURpiPASSWORD
YOURpiPASSWORD

sudo systemctl restart smbd

and check from PC filemanager / network
login / remember
pi YOURpiPASSWORD


Backup



above RPI setup takes about an hour,
esp. burn and OS update ( and use of uSD or USB2 drives )
so better:

with a Raspberry Pi ( and desktop version OS )
there is a easy backup way:
[menu]
Accessories
SD Card Copier
* Copy From Device ( like uSD ) !! and while this RPI is BOOTED from this uSD !!
* Copy To Device ( like USB drive )

so like after setup, but before install whatever you want to test
burn that 'current master' ( to a min 8GB drive )
and if all goes wrong just burn back to this good situation.


here was originally a Docker setup i moved to new BLOG: RPI Docker


RPIx


RPI OS compatibility

i use RPI1 RPI2 RPI3 RPI4

when use the new Raspberry Pi imager you are first asked for what board you need a system
what is good, but hides the question what OS is for what board behind a smart menu selection code in the imager.

if you look at raspberrypi.com/software/
like for
Raspberry Pi OS (64-bit)
Compatible with: 3B 3B+ 3A+ 4B 400 5 500 500+ CM3 CM3+ CM4 CM4S CM5 Zero_2_W

but can i setup my system on a RPI4 ( because it is the fastest )
and then use it in RPI3? but NOT in a RPI2

sort of

but not recommended.

above i mention in Backup that burning a OS copy is fast and easy
and / if chose a good installation status / creates a current master

again same question, can i use it for an other board?

and if, what i have to change?
i made a system unusable by several tries of renaming
hostname
so i visit that question here again first: like from rpi4 to rpi3
( only small character recommended )
sudo hostnamectl set-hostname < new_hostname>
or
sudo nano /etc/hostname
or
sudo raspi-config
1 System Options
S4 Hostname
< new_hostname>

and then need to edit
sudo nano /etc/hosts

___________
in my case i also want to change the fixIP .104 to .103 for use in a RPI3 ( same wifi .204 to .203 )
sudo nmcli c mod 'Wired connection 1' ipv4.addresses 192.168.1.103/24 ipv4.method manual
___________

and better
sudo reboot

i use above big setup ( on a the new USB3 stick )
make Backup to uSD again
and do these changes and boot USB stick in the RPI3
( knowing that RPI3 can not use the speed of this stick )

ok boot and looks good
* drivespeed only 40MB/sec ( RPI3 has only USB2 )

terminal still pi@rpi4
so hostname rename did not work??


try again
sudo raspi-config
and
sudo reboot
same

* docker and
* * portainer RUN
but to need update environment RPI3 and .103
* * nginx
edit index.html some manual .104 to .103
* * file manager
* * Cockpit
still think it's rpi4

next:
try:
sudo nano /boot/firmware/user-data
hostname: rpi4 to rpi3

OR: delete that line completely!!

sudo reboot
worked!
so it has to do with using
- - RaspberryPi Imager 2.0.6
and cloud config enabled by it somewhere...
actually i did not even know about that file.


also the RPI3 system lags unusually,
possibly because too many container running for that little RAM?



for that problems with new RPI imager ....
* on Linux PC need to run v2.0.6 .AppImage from command line
* renames eth and wifi using 'netplan...'
* creates above hostname change problems

try a older version but not lucky