Owncloud and nextcloud error after trusted domain

Hi, im a utter and total noob, but the only way to get away from my current state is to get help so. i have installed the rockon for nextcloud earlier. it worked fine until i changed the config.php to add trusted domain for the secound time. Then i was told nextcloud didnt have the right permissions to change the config.php file. i serched for hours but i didnt get anywhere.(for other noobs, how to access config.php? make the share you installed owncloud or nextcloud in accessable by samba). so i decided to delete the rockon and try with owncloud. installed it, copied the original config.php file to my desktop, added to trusted domain first time, that worked as last time. then i was told to update and that i had to change the config.php file to put owncoud in service mode. so i did, and i set service mode to false and what happened?

Cannot write into “config” directory!

This can usually be fixed by giving the webserver write access to the config directory.

anyone please help a noob out ?

also i have problems finding out how or where to run occ (terminal?)? should i somehow run it inside rockstor, on my windows computer? in terminal on my linux ubuntu laptop? in google chrome? or do i access it from my url field because its a file i should run inside the rockstor server? please help, i know this might be annoyingly stupid, so try to laugh at me and tell me what to do so i can get on learning.

Hello @Jonas_Vinge, and welcome to the community!

I haven’t use Nextcloud / Owncloud in a little while so I may be rusty on the details, but I’ll try to help as best as I can for now.

Nextcloud or Owncloud?

I would personally highly recommend using the Nextcloud rock-on over the Owncloud one. Indeed, the former is fully up-to-date and will get you up and running in a much safer way. I will thus assume we are talking about Nextcloud below–although most of what I’ll write would apply to both.

Editing config.php

The docker container (that the rock-on uses) sets on purpose a user that doesn’t exist (33, for security purpose, I believe) and gives ownership of config.php to that user. When accessing the file using a samba export, you may thus have issue with trying to edit this file (I’ve never tried it that way myself, though). What you can easily try, however, is to use the command line.

To do so, you can either connect to Rockstor using SSH (you will find tons of tutorials on how to connect to a linux server online if needed), or use the “Shell In A Box” feature in Rockstor:

  1. Go to System > Services
  2. Click on the little orange wrench icon next to “Shell In A Box”, and change the Shell connection service from LOGIN to SSH. Click submit and the Shell In A Box service should now be ON (toggle the ON/OFF switch if it isn’t the case).
  3. You can now click on System Shell in the UI’s header and you will be prompted to enter login credentials. Although usually not recommended, let’s login as the root user.
  4. The config.php file is located in the share you used to bind Nextcloud data (next-data in the example below:
[root@rocktest ~]# ls -lhtr /mnt2/next-data/config/config.php                                                                                                                                    
-rw-r----- 1 33 33 821 Jan 10 10:47 /mnt2/next-data/config/config.php                                                                                                                            
  1. You can thus simply edit it using nano, for instance, which is rather simple to use:
[root@rocktest ~]# nano /mnt2/next-data/config/config.php
  1. Make your changes as needed (make sure to follow the appropriate syntax):

  2. To save your changes, type Ctrl + O, press Enter.

  3. To exit, press Ctrl + X.

  4. Verify your changes were correctly saved:

[root@rocktest ~]# cat /mnt2/next-data/config/config.php

You can now close the Shell In A Box session by opening any page of the Rockstor UI. I would also suggest you turn off the Shell In A Box service if you don’t need it anymore.

How to run the occ commands

As Nextcloud is run inside a docker container (this is what rock-ons use, see our documentation), all its commands are isolated inside the container and thus invisible from the host’s (Rockstor server) system. You can still access them, however. You can find a lot of resources online on what docker containers actually are and see that they could be (over) simplified to being a system running inside another system.

To do so, you just need to run the commands from inside the nextcloud docker container. I found a quick and nice description in Nextcloud’s forums:

In our case, these would thus be:

[root@rocktest ~]# docker exec --user www-data nextcloud-official php occ --help

I know this doesn’t include everything but I hope it’ll at least help you get on the right track.

In any case, let us know how it goes!



Hello there, I’m also a NOOB in Rockstor/CentOS.
I have tried the command line you have given (and edited the share name) and here what I get :
ls -lhtr /mnt2/nextcloud_data/config/config.php

ls: cannot access /mnt2/nextcloud_data/config/config.php: No such file or directory


That was unexpected, and leads me to wonder whether something went wrong with your nextcloud install. In this context, would you be able to share a screenshot of your Rock-ons page?

Alternatively, I would try to start over and delete all shares you used for the Nextcloud rock-on (as I believe you do not have any of your personal data on them anyway, so nothing to loose there) and then re-create them. This way, you start with fresh, clean, and empty shares and would thus make sure everything is set for the Nextcloud rock-on to install successfully.
Then, re-install the Nextcloud rock-on, and verify that you have the folder structure as it should be:

ls -lhtr /mnt2/nextcloud_data/config/

Sorry I’m a little short on time here, but that should help situating where the problem is.



Thanks, after reinstalling it did work great!
Now, I have to switch form SQLlite to Mysql… is it as easy as does few lines of code?

Glad it’s worked out!

Unfortunately, I’ve never tried that myself but I doubt it would indeed be as easy as a few lines of code. Would you mind expanding on the reasons you would like to switch to a MySQL database? It may not be necessary for your needs.

As a side note, you will see in the Github discussion that led to this rock-on that, this point was indeed debated and a much more “powerful”–but also complex from a user-friendliness perspective–offering will be developed in the future. See below for more details:

1 Like

Well, I guess I could keep SQLlite for now as I am learning and I am not ready to deploy to my family the hole system. But since I work on it from outside my network, I guess the most logical step would be to implement the HTTPS /443 port instead of http /8xxx

thank you very much! it helped me a lot and i am now running nextcloud!

1 Like