Cannot login to a fresh install of NextCloud using snap on Ubuntu Server


I have an Ubuntu server running on a raspberry pi that I want to use as a NextCloud server. I’ve did a straight forward

sudo snap install nextcloud 

and the package is installed without any warning and such. Then, from a browser on another computer I went to the IP address of the raspberry pi address. I was greeted with NextCloud’s interface to create a username and password for the admin. I added those and then I’m stuck on a login screen. I type in the username and password that I set, and I’m being transferred to the same page without any error message or any further information.

How do I fix this?


Your installation process isn’t finished yet.

After that command, you needed to execute couple of more commands to complete the installation.

sudo nextcloud.manual-install username password

Set you own user name and password above.


sudo nextcloud.occ config:system:set trusted_domains 1 --value=your.server.static.ip

Once that successfully executes, then you can use that user name password to log into your installation.

Refer here for details → GitHub - nextcloud-snap/nextcloud-snap: ☁️📦 Nextcloud packaged as a snap


Hi, thank you for the help.

I’ve launched the two commands, plus (since I use external drive for the files):

sudo snap connect nextcloud:removable-media

I still see the same behavior.

The folder where nextcloud is supposed to store the data is /media/BIG/nextcloud:

ubuntu@ubuntu:/media/BIG$ ls -l
total 24
drwxr-x--- 5 root     root      4096 May  5 14:51 librephotos
drwx------ 2 root     root     16384 Apr 30 18:23 lost+found
drwxr-xr-x 3 www-data www-data  4096 May  4 18:00 nextcloud

What else am I missing?

I think the default snap storage location is /var/snap/nextcloud/common/nextcloud/data

I think its better to remove the installation and start fresh, then try


I think the default snap storage location is /var/snap/nextcloud/common/nextcloud/data

How do I change it then? I’ve placed this here just so it is clear what I did.

I think its better to remove the installation and start fresh, then try

This was a fresh new install, I formatted my SD card with a new image. I didn’t format the external drive, though.


You may need to stop nextcloud service,

sudo snap stop nextcloud

edit the config file,

sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php

Change the DataDirectory value to your desired external location, then move the conatins,

sudo mv /var/snap/nextcloud/common/nextcloud/data /new/location/

Restart the NextCloud Service.

Just remove the snap installation and reinstall… Start fresh to avoid any previous error / mistake getting carried over.


Things are getting weird.

I ran sudo snap remove --purge nextcloud and then I installed nextcloud again.
Once installed, I changed /var/snap/nextcloud/30263/nextcloud/config/config.php to include the line datadirectory => /media/big/nextcloud
I also changed the /media/big/nextcloud configuration as per this

sudo chown -R root:root /media/BIG/nextcloud
sudo chmod -R 770 /media/BIG/nextcloud

Finally, I typed the commands for enabling external media followed by this:

$ sudo nextcloud.occ config:system:set trusted_domains 1 --value=  

And I got this:

Nextcloud is not installed - only a limited number of commands are available
There are no commands defined in the "config:system" namespace. 

Have I ruined everything now?


I am no expert but I guess the simple command to remove NextCloud snap is,

sudo snap remove nextcloud

I guess it’s better to start with a fresh clean install of Ubuntu. Then just few commands,

  1. sudo snap install nextcloud
  2. sudo nextcloud.manual-install username password
  3. sudo snap connect nextcloud:removable-media
  4. Add your trusted domain / IP sudo nextcloud.occ config:system:set trusted_domains 1 --value=your.server.ip.address
  5. Edit Config → sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php (find the line DataDirectory, change the location)
  6. Move your existing files, sudo mv /var/snap/nextcloud/common/nextcloud/data /new/location/
  7. Fix the permission of the new directory
  8. Reboot


during install of ubuntu there is an option to install additional apps by selecting them from a list. Nextcloud snap is one of these options, select the checkbox for it and continue - Nextcloud snap is ready once Ubuntu Server install is complete.

I have this system and what I did was all that you did for the config file but I linked the external (NFS - as it was on a network drive) folder to the data folder and all is good.

hope this helps