# How to script the setup wizard?

**URL:** https://meta.discourse.org/t/how-to-script-the-setup-wizard/169288
**Category:** Self-hosting
**Created:** [November 4, 2020, 10:21pm UTC](https://meta.discourse.org/t/how-to-script-the-setup-wizard/169288 "2020-11-04T22:21:14Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![dachary](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dachary/32/119731_2.png) [@dachary](https://meta.discourse.org/u/dachary)
#### Post date: [November 5, 2020, 4:08pm UTC](https://meta.discourse.org/t/how-to-script-the-setup-wizard/169288/12 "2020-11-05T16:08:42Z")

</div>

Assuming a multisite installation, creating an approved admin user and an admin API key can be done with:

- `docker exec app env RAILS_DB=secondsite rake 'api_key:create_master[MYKEY]'`
- `( echo user1@example.com ; echo $pass ; echo $pass ; echo ) | docker exec -i app env RAILS_DB=secondsite rake 'admin:create'`

**Note** : if not on a multisite installation, just remove `env RAILS_DB=secondsite`

And then verify that it works with

```plaintext
curl -X GET https://forum2/admin/backups -H "Accept: application/json" -H "Api-Key: 886171a73dd12759b5d6c1915b0f0d4475e8b3fff3d97954b95171200b6" -H "Api-Username: user1"
[]

```

(special thanks to [Jay Pfaffman for the inspiration](https://meta.discourse.org/t/piping-into-rake-admin-create/73643))

After this is done, discourse no longer requires to run the wizard, although it shows that it should be run.

 ![d](https://global.discourse-cdn.com/meta/original/3X/0/1/019a87260cd7eed9c28c3473c7bab42a96c5e3d9.png)

---

_[View the full topic](https://meta.discourse.org/t/how-to-script-the-setup-wizard/169288)._
