Problem
You want to completely automate the installation of Ghost including creation of the admin user?
You search on Google and land on this exactly worded forum post from 2019 with no ready-to-use answer.
Solution
You can do it using curl:
curl 'http://localhost:2368/ghost/api/admin/authentication/setup/