I broke my Nextcloud and need some help

Hey all,

Got my Umbrel Pro last month and been tinkering with it ever since.

I set up Nextcloud over the past week, uploaded my files, and was trying to use Tailscale earlier to connect remotely to my Nextcloud. After searching online, I understood that I had to go into Nextcloud’s config.php file and add my phone’s IP address that Tailscale gave it. I edited the php file on my PC with Notepad++, added the IP address under ‘trusted domains’, and thought that was it. I did not change anything else in the php file, and kept a copy of the original too.

I dropped it into the Nextcloud config folder and overwrote the original file, but now my Nextcloud app won’t start. Instead I am getting the following error message:

Cannot write into “config” directory!

This can usually be fixed by giving the web server write access to the config directory. But, if you prefer to keep config.php file read only, set the option “config_is_read_only” to true in it. See Documentation Redirect

I pasted the original php file inside the folder immediately afterwards, but nothing has changed even after restarting the app, and now I don’t seem to be able to launch it. The URL in the error message is not terribly helpful either. I’ve changed the ‘writable’ to ‘true’, but it does not work.

I am at a loss, and any help is appreciated.

OK, I solved it with ChatGPT’s help.
Full discussion below.

This is very likely fixable. The good news is that you almost certainly did not lose your files — the problem is probably just that the config.php file now has incorrect permissions or formatting after being edited in Notepad++ on Windows.

The specific error:

“Cannot write into config directory”

usually means one of these happened:

  • config.php ownership/permissions changed when you copied it back

  • Windows line endings or encoding broke the file

  • the config folder became owned by the wrong user

  • config_is_read_only was added incorrectly

Here are the safest and simplest steps.


Step 1 — SSH into your Umbrel Pro

From your PC terminal:


ssh umbrel@umbrel.local

(or use the Umbrel Pro IP address if .local doesn’t work)


Step 2 — Find the Nextcloud app folder

Run:


cd ~/umbrel/app-data/nextcloud/data/nextcloud/config
ls -l

You should see config.php.

Paste the result here if you want me to verify it.


Step 3 — Fix ownership and permissions

This is the most likely fix.

Run these commands exactly:


sudo chown -R 33:33 ~/umbrel/app-data/nextcloud/data/nextcloud/config
sudo chmod 750 ~/umbrel/app-data/nextcloud/data/nextcloud/config
sudo chmod 640 ~/umbrel/app-data/nextcloud/data/nextcloud/config/config.php

(33:33 is the www-data user inside the container.)


Step 4 — Check if config.php is broken

Run:


cat ~/umbrel/app-data/nextcloud/data/nextcloud/config/config.php

Look for obvious issues like:

  • weird characters at the top

  • missing commas

  • duplicated lines

  • smart quotes instead of normal quotes

The trusted domains section should look roughly like this:


'trusted_domains' =>
array (
  0 => 'umbrel.local',
  1 => '100.x.x.x',
),

Do NOT use semicolons inside the array.


Step 5 — Restart Nextcloud

Run:


sudo ~/umbrel/scripts/app restart nextcloud

Wait about 1–2 minutes.

Then try opening Nextcloud again.


Step 6 — If it still fails

Run:


sudo ~/umbrel/scripts/app logs nextcloud --tail 100

and paste the output here.


Important note about Tailscale + Nextcloud

You usually do not need to add your phone’s temporary Tailscale IP to trusted domains every time.

Instead, the better solution is usually to add either:

  • your Umbrel Tailscale hostname

  • or the Umbrel LAN hostname

  • or configure a proper reverse proxy/domain

Adding device IPs manually can become messy.

Also, editing config.php from Windows can sometimes break permissions. In the future, edit it directly on Umbrel using:


nano config.php

instead of copying files back and forth.

I follow step 1 but powershell asks me for the Umbrel’s password and then I can’t type anything

That’s normal — Linux password prompts in PowerShell/Terminal are invisible for security reasons. Nothing appears on screen while typing.

Just:

  1. Type your Umbrel password carefully

  2. Press Enter

Even though you see no characters, it is accepting input.

If the password is correct, you should then see something like:


umbrel@umbrel:~$

If it says “Permission denied”, try again carefully.

Also:

  • the username is usually:

    
    
    umbrel
    
  • and the password is the one you set during Umbrel setup.

If ssh umbrel@umbrel.local does not connect at all, use the Umbrel Pro IP instead, for example:


ssh umbrel@192.168.x.x

You can find the IP from your router or from the Umbrel dashboard.

umbrel@umbrel:~$ cd ~/umbrel/app-data/nextcloud/data/nextcloud/config ls -l total 98 -rw-r–r-- 1 www-data www-data 60 Apr 17 14:49 apache-pretty-urls.config.php -rw-r–r-- 1 www-data www-data 70 Apr 17 14:49 apcu.config.php -rw-r–r-- 1 www-data www-data 377 Apr 17 14:49 apps.config.php -rw-r–r-- 1 www-data www-data 2110 Apr 17 14:49 autoconfig.php -rw-r–r-- 1 umbrel umbrel 1479 May 10 11:06 config.php -rw-r–r-- 1 www-data www-data 95671 Apr 17 14:49 config.sample.php -rw-r–r-- 1 www-data www-data 700 Apr 17 14:49 redis.config.php -rw-r–r-- 1 www-data www-data 991 Apr 17 14:49 reverse-proxy.config.php -rw-r–r-- 1 www-data www-data 2235 Apr 17 14:49 s3.config.php -rw-r–r-- 1 www-data www-data 933 Apr 17 14:49 smtp.config.php -rw-r–r-- 1 www-data www-data 1103 Apr 17 14:49 swift.config.php -rw-r–r-- 1 www-data www-data 60 Apr 17 14:49 upgrade-disable-web.config.php umbrel@umbrel:~/umbrel/app-data/nextcloud/data/nextcloud/config$

is this the result for step 2?

Yes — and this already shows the problem.

Every other file is owned by:


www-data www-data

but your config.php is owned by:


umbrel umbrel

That happened when you copied the file back from Windows, and it’s why Nextcloud is failing.

Now run these commands exactly:


sudo chown www-data:www-data ~/umbrel/app-data/nextcloud/data/nextcloud/config/config.php
sudo chmod 640 ~/umbrel/app-data/nextcloud/data/nextcloud/config/config.php
sudo ~/umbrel/scripts/app restart nextcloud

Then wait about 1–2 minutes and try opening Nextcloud again.

There’s a very good chance this alone fixes it.

Followed to the letter and a minute later it worked.