# Generate instanceid without loading the site

**URL:** <https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789>\
**Category:** ℹ️ Support\
**Created:** [July 20, 2020, 3:14pm UTC](https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789 "2020-07-20T15:14:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rojz](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rojz/32/14849_2.png) [@rojz](https://help.nextcloud.com/u/rojz)\
**Post date:** [July 20, 2020, 3:14pm UTC](https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789/1 "2020-07-20T15:14:23Z")

</div>

Nextcloud version _(eg, 18.0.2)_: 19.0.0  
Operating system and version _(eg, Ubuntu 20.04)_: Ubuntu 20:04  
Apache or nginx version _(eg, Apache 2.4.25)_: Apache  
PHP version _(eg, 7.1)_: 7.4

Hello!

I am wondering if you somehow can generate the instanceid without loading the site for example script making.

I’m trying to make an automatic Nextcloud installation script where it will install all necessary packages and installations, then run  
sudo -u www-data php /var/www/html/nextcloud/occ maintenance:install

I have seen that the instanceid only generates when you first load the site and not when the netcloud is installed, and that makes the config.php changes hard to do with the script without loading hte site first…

Anyone have any ideas what I can do to combat this?

Another note that I can add is… Is it possible to make the instanceid manually? for example add them yourself in the script with something like this (ofcourse change them per installation)

‘instanceid’ =\> ‘thisismymanuallyaddedinstanceid’,

Would that work in the long run?

---

<div class="post-metadata">

**Author:** ![mritzmann](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mritzmann/32/43763_2.png) [@mritzmann](https://help.nextcloud.com/u/mritzmann)\
**Post date:** [July 20, 2020, 3:27pm UTC](https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789/2 "2020-07-20T15:27:36Z")

</div>

A curl request to the site is not sufficient?

---

<div class="post-metadata">

**Author:** ![rojz](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rojz/32/14849_2.png) [@rojz](https://help.nextcloud.com/u/rojz)\
**Post date:** [July 20, 2020, 6:00pm UTC](https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789/3 "2020-07-20T18:00:28Z")

</div>

Didn’t think about that… it worked with a simple curl.

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![cibericius](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cibericius/32/52026_2.png) [@cibericius](https://help.nextcloud.com/u/cibericius)\
**Post date:** [August 4, 2023, 12:28pm UTC](https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789/4 "2023-08-04T12:28:34Z")

</div>

Can you please elaborate how it works?

## Error

- The required instanceid config variable is not configured in the config.php file.Please ask your server administrator to check the Nextcloud configuration.

Thanks.

Update: in the meantime I tried something and that helped!

docker exec -it -u www-data nextcloud bash  
www-data@b8ce717d69f9:~/html$ php /var/www/html/occ config:system:delete instanceid  
System config value instanceid deleted

It created a new instanceid in the config.php.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 3:55pm UTC](https://help.nextcloud.com/t/generate-instanceid-without-loading-the-site/87789/5 "2024-12-14T15:55:45Z")

</div>


