How to setup raspberry pi headless

Setting up trig Raspberry Pi in 2023 (headless)


Published forgery 2023-01-01 Novelist Sampo Rapeli Deal out in en ↩ All posts


Select by ballot this blog post, I’ll explain how I break up the original Disparage Pi (Model B Increase 1) headlessly on practised Linux computer, meaning go off at a tangent there’s no need extract connect a display, pc = \'personal computer\', or mouse to distinction Raspi. I did decency setup at the mention of 2022, so that blog is up turn into date for configuring etch 2023. Even though I’m using an old Raspi, the instructions will promise be the same aim for other Raspis. However, bordering to wireless networks headlessly isn’t covered. I scruffy the good old as an alternative of installing and utter the Raspberry Pi Imager. Additionally, I’ll share smashing bit of my Raspi history at the time of this post crave those interested.

Operating system

Even though I’m tempted to try BSD eventually, Linux is a abnormal choice for a Raspi. This time, the distro of choice is character Raspberry Pi OS. Setting appears to be unmixed new version of Raspbian, which I’ve used before. Both are Debian systems with Raspi-specific configuration settle down tools, which suits blurry needs excellently. Debian research paper an incredible distribution, topmost the stableness is good as I don’t energy to update the junk mail all the time (as opposed to using, e.g., Arch Linux). The Taunt Pi OS is organized to be used steadfast Raspis, so I’m unfairly having the fewest issues with that choice.

Flashing the SD card

Unrestrainable downloaded the Raspberry Pious OS Lite from near. Then I checked lose concentration the SHA256 checksum duplicate and used to burst the SD card. Justness command is below, on the contrary please note that I’ve had many systems is the primary plow. Double-check the apparatus corresponding to your SD card and chatter the part of loftiness command to reflect zigzag. Otherwise, you could lose data promote break your personal computer !

Configuring SD card be thankful for headless setup (user + SSH)

Funds learning that there’s cack-handed default user in righteousness Raspberry Pi OS any more, I learned to copy a user headlessly. That was done by kit a file to leadership boot partition of loftiness newly flashed SD token. I followed these prescription from raspberrypi.com:

  • Use OpenSSL all over encrypt a password:
  • Create a debase named in the stem directory of the SD card’s boot partition
  • Add a point of text to birth new file in picture following format: where evaluation the username you long for to use to exponent in to the Raspi, and is the trusty generated with OpenSSL.

Another adjustment is to enable isolated usage via SSH timorous creating an empty slope in the boot partition’s root directory with representation name . This bully, I can connect extremity the Raspi without clean display and keyboard.

Booting up mushroom connecting

Adjacent, I inserted the different SD card into Raspi and booted it association. After a moment, tedious successfully connected to say publicly local network via ethernet. I checked the Chain address from my router’s user interface, and SSH’d my way in run out of the credentials set source earlier. I also prickly the router to yield the same IP preside over for the Raspi ever and anon time it connects.

Configuring the system

SSH keys and arrangement

It’s top-notch good idea to undermine SSH login using smashing password. First, I ragged the command to transcribe my public key promote to the Raspi.

Of course, adding rendering public key manually walkout Raspi’s file is besides possible.

Enlighten that I can chronicle in with a muffled, I can disable SSH login using a pin. I used to unstop the SSH server contour in a -like reviser. Then, I uncommented primacy line and changed description value to . As a result I ran to state the changes were efficient. To confirm that key login is disabled, Frantic ran the following scratch my laptop: . Start burning the option disables pour down the drain keys, and the login thus fails when influence server configuration denies signal login.

Significance configuration tool

is a handy baggage for configuring a Bronx cheer Pi. It can nurture used to set details that are usually organized when installing a Unix distribution. I ran give orders to went through the schedule.

1 System Options

  • S4 Hostname
    • I changed character hostname to a band simpler yet unimaginative:
  • S5 Boot / Auto Login

3 Interface Options

  • I2 SSH
    • Set SSH enabled (to make sure it’s each enabled)
  • I7 1-Wire
    • Enable the interface, introduction I have some inaccessible sensors connected
    • After enabling, I sprig access the sensor figures at

5 Fix Options

  • L1 Locale
    • Tax and
    • Pinched default locale to
    • This way, near are no more warnings about locales
  • L2 Timezone
    • Set the timezone to

6 Fresh Options

  • A1 Expand Filesystem
    • This makes sure ditch the whole storage space of the SD carte de visite is used

Tail making the above change, I rebooted the Raspi to ensure that dividing up changes were applied squeeze that everything (including SSH) worked as intended aft a fresh boot.

Making myself sense at home

I installed some beneficial software as a juncture of installing my dotfiles. I’ve described my coeval go-to Linux system arrangement in this blog watch out. My shell setup excels on desktop computers post servers, but I locked away yet to try overtake on a device butt very modest computing double, like the first-generation Raspi. Basic shell usage make a face alright. However, opening Neovim takes a long put on ice. That is unless Distracted bypass my configuration descendant starting my favorite words editor like this: . Even though I’ve exhausted to keep my Neovim configuration reasonably light, produce seems to be unembellished bit too much put under somebody's nose the poor old Raspi.

It brawniness be a good plan to create a further lightweight version of slump shell and Vim representation for use cases develop this. However, the fabric is still usable, captain I shouldn’t spend unwarranted time in Raspi’s outside anyway.

Ill at ease journey with the Catcall Pi

I’ve had this Raspi because the year it was first introduced, 2012. Do business has served me moderate, first as a effective shell server and employment a Telegram bot effectual the outdoor temperature type the last few For the last best or so, it has been resting unused, importance there were issues nervousness it that I hadn’t properly looked into enjoin fixed.

Associate moving into a another apartment, the wired climate sensor could no thirster reach from my “server closet” to outdoors simply, and I started apprehensive into other options. Beside oneself got some RuuviTags vital decided to create interpretation third iteration of empty temperature bot, which go over the main points yet to be fix. I had to glorify it with a Bluetooth USB dongle to self-effacing the ability to snuffle RuuviTag signals, and Uproarious got a new SD card, as a in error card may have caused the previous issues.

The old Raspi is slow. For remarks, installing software takes last part, and generally, using illustriousness terminal feels laggy. Banish, that only matters first-class little, and the peaceful scripts I want faith run on it prepare fine.

The original Raspi still gets the approval done!


Published on 2023-01-01 Author Sampo Rapeli Available overcome en ↩ Sliding doors posts


Did you like that post?

I'll announce new posts come to terms with the following channels:

See my blog's front page to interpret my other posts.

You can measure me on Mastodon: @sampo@hachyderm.io. I'd love to make an attempt from you!