How do I edit the config.php file on a nextcloud box?

What is snap?? I searched for it in Apps but did not find it. I am running on a mac so I suppose I can ssh into it, but I don’t know what credentials to use. Do I have to sudo to gain write access to these files?

I’m a complete noob to Linux, although I have worked extensively with the mac and windows CLI.

Bob S

did you work with the terminal app too in os x? Its basically a BSD but there are much similarities. Yes you need to ssh to it, sudo and snap is a cli command on the box.

OK, I was able to connect a monitor and keyboard, figure out the user and password, which is ubuntu:ubuntu and I was able to edit the config.php file using sudo vi. But the problem was NOT that my windows domains were not trusted. The problem was that the FQDN being used for the name of the device, (nextcloud.local) is a bonjour address, and is not discernable to a windows network! What I had to do was add a new zone to my DNS called local, and create an A record for nextcloud.local. The only way for this to really be plug and play for Windows is to register a netBIOS name with the current wins server, or master browser if there isn’t one.

Anyway, I was able to get Windows workstations to talk to it.

I attempted to ssh into it but logins fail. I am using ssh -i -u ubuntu. I set the password when I had a monitor and keyboard set up on it, and I used the password multiple times successfully, and it is a standard password I use for such things on a regular basis so I know it is correct. Yet it fails the login attempts. Any ideas?

Actually I am using ssh nextcloud.local -i -u ubuntu.

Hi, Newbie here :slight_smile:
I have Next Cloud installed on a Pi3 and i need to add a trusted_domain.
However despite searching the entire file structure i cannot find a config.php file :frowning:
Any suggestions welcome.

T.J.

You may use nextcloud-snaps included occ-command sudo nextcloud.occ and add a trusted domain like described here:
https://docs.nextcloud.com/server/13/admin_manual/configuration_server/occ_command.html#setting-an-array-configuration-value

EDIT: sorry @johnsoap, I just realised that you might not use nextcloud-snap - thought you are because you posted in this snap related thread. How did you install Nextcloud?

Hello!

I am a new user of Nextcloud and its the first time i installed Ubuntu Server 18 (latest version) I installed Ubuntu server 18 and chosed Nextcloud. Now it is installed like a “snap”. It is impossible for me to edit this document via MC or jed using sudo mc or any other editing tool in ubuntu 18 server environment.

I tried with Nano, Jed, MC but this folder is “Read-Only”? Having this problem helped me developing my Ubuntu skills so i guess there is always some positive when there is a problem because then we learn, right! :slight_smile:

I reinstalled Ubuntu Server 18 with the same results. Anyone know how to make the folder “writeable”

I do not want to use CHMOD 777 to that directory. I really would like to get some help with this. Thanks!!

MC= Midnight Commander (great tool for edit files via Ubuntu server environment)

1 Like

What exactly do you want to change in config.php?

With nextcloud-snap this folder is not writeable, but nextcloud-snap comes with included cli-utilities which may be a help for you:

2 Likes

Thanks for your answer! :slight_smile:

I need to add my public IP to Domain Trust so i can reach it external. I have port forward from my Router to my external ip and now it is locked and it says i need to change the php config file.

Watch this Print Screen, it says in swedish, i need to add it to trusted domains.

1aaaa

Have a look at your trusted_domains with:

sudo nextcloud.occ config:system:get trusted_domains

And add a new trusted_domain with:

sudo nextcloud.occ config:system:set trusted_domains X
--value=subdomain.example.com

As X use (amount of trusted_domains +1). Have a look here:
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#setting-an-array-configuration-value

2 Likes

Thank you, i will try this asap and get back to you with results.

Best regards
Jim Larsson

Hello!

That worked excellent. :slight_smile:

Thank you so much for your help!

FYI, if you want to edit the config by hand, the writable version is located in /var/snap/nextcloud/current/nextcloud/config/config.php.

6 Likes

Thank you, :slight_smile:

1 Like

Hi Guys… I Installed nextcloud on my RPI 3 via Snappy. My problem is, I can’t enter past /var/snap/nextcloud/common. I see there’s a directory called “nextcloud” but it doesn’t let me in.

-bash: cd: nextcloud: Permission denied

is what I get. I also am not getting the web interface via localhost/nextcloud at all, nor do any of the commands work. I cant get nextcloud.occ, or anything up.

I simply installed via snappy by using

sudo snap install nextcloud
and later
sudo snap start nextcloud

Anyone have any ideas??

You need to be root. The config.php isn’t in there though, try /var/snap/nextcloud/current/nextcloud/config/config.php (again edit as root).

Try /snap/bin/nextcloud.occ, does that work?

Hi kyrofa

Thanks for your snap! After 2 days of many failed methods, different lynx versions and a few CP’s, I came across snap version and managed to install nextcloud last night at 3 am in a breeze. Thank you for that!

I am trying to edit the config file to remove remove link “Get your own free account” but it says access denied. Any idea how to access it and edit ?

Thanks for your patience and help (newbie here)

Any solution?

You’re editing /var/snap/nextcloud/current/nextcloud/config/config.php as root? That should definitely be writable.