Knowing that ssh can be enabled with the initial flashing of an SD card (with raspbian) (via touch /boot/ssh) and wireless can be configured (via wpa_supplicant.conf) prior to first boot, is there also a way pre-load code (a gitlab repo) on to the pi, and/or run an initial setup script that will install an application (again, specifically asking about a gitlab repo) and configure it to run without any user input.

I know this is possible with provisioning software on Windows/Linux (via unattend.xml, pxe/salt/foreman, etc.) ... surely there must be a way to also do this on a pi (raspbian)?

The goal is to load an application (possibly from a gitlab repo) onto the pi prior to or during first boot such that the pi can just be plugged in for first boot and it will automatically install and run the application for a truly headless setup.

  • 2
    Not without creating your own image that would perform such a task Oct 10, 2020 at 2:36

2 Answers 2


A Raspberry Pi is a small device, made as embedded device. It is not intended to have an installer program available like big distributions have. Embedded devices are usually programmed by flashing an image to them.

The RaspiOS has a bash boot-script available that do essential things like enable the ssh service and move wpa_supplicant.conf to its place but I don't believe that it can do more than that, in particular installing programs from a repository with user interaction. For that you have to program an installer that I haven't seen so far for a Raspberry Pi.

I suggest to use the normal way for embedded devices: create your own master image with your program pre-installed and distribute that image.

  • Won't that have issues like reused keys, random seeds, etc? Oct 10, 2020 at 14:53
  • @user3.1415927 Not more issues than with default Raspberry Pi OS. Haven't seen much trouble with them.
    – Ingo
    Oct 10, 2020 at 16:04

Check out the answers to this question. I'm looking for the same kind of thing, and the highest rated answers look very good to me [1], [2].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.