Nextcloud Snap users, please list the issues you're facing

Great investigation! That sounds broken indeed. However, Iā€™m afraid Iā€™m not familiar enough with Nextcloud to know the purpose of that table, nor the ramifications of modifying it by hand. Note that you can get into the database via the included client: sudo nextcloud.mysql-client.

This seems to be a Nextcloud issue thatā€™s not specific to the snap. I suggest opening a new topic with this same information to get more eyes from core Nextcloud folks.

Thanks Kyle, I did so: https://github.com/nextcloud/server/issues/7312

The only issue Iā€™ve faced is the inability to put nextcloud data on a separate drive. But that could be classified alternatively as a feature request.

Just wanted to say big thanks for making nextcloud snap, setting up literally was four steps:

  1. Installed Ubuntu on an inexpensive new server (dell poweredge t30).
  2. Installed Nextcloud: sudo snap install nextcloud
  3. Configured Nextcloud at http://serveripaddress
  4. Set up free cert via Letā€™s Encrypt: sudo nextcloud.enable-https lets-encrypt
1 Like

@sunrisen thank you for the kind words! As for storing your data on an external drive, thatā€™s already supported: Please see the README for more details.

1 Like

I only have had one issue so far, and it probably lies at my feet (lack of experience or completely missing existing documentation), but:

  • (A) There isnā€™t a way to edit the apache config file for virtual hosts (so that I could have, say, blog.mydomain.com et.al alongside NC) - at least insofar as the snap package goes. Most support pages I found talk about the manual installation folders (/var/www/html/nextcloud, etc) instead of /snap/nextcloud/.

  • (B) and could not for the life of me find any documentation or previous support issues that address virtual hosts/subdomains with the snap package. Iā€™m assuming from your blog post here that opening up the guts to be edited is something you arenā€™t keen to doā€¦so Iā€™m at a loss if this is even possible.

Aside from that, I love how absolutely easy it was to setup Nextcloud with this snap; even with limited knowledge of linux, it was a breeze to set up at mydomain.com and get the certs from lets-encrypt. Not much has been this easy!

Hey there @thegreyfawkes, thanks for the questions. Theyā€™re really the same question, heh. Youā€™re right, the Apache contained within the snap is not meant to be used by anything other than Nextcloud. Basically: this is the Nextcloud snap, not the Apache snap. If we had to support all the numerous uses of Nextcloud as well as the numerous uses of Apache weā€™d die in a support fire! Not to mention, if we opened the Apache config, weā€™d immediately be married to Apache for all time, precluding the ability to ever move to anything else (e.g. nginx).

Think of the snap as a standalone thing. You shouldnā€™t need to care that it uses Apache. If you want to run your own Apache instance, with other vhosts, then change the port on which Nextcloud is listening and proxy to it from your Apache.

Thanks @kyrofa, Iā€™ll give that a shot. I appreciate the guidance!

New Domain => New certificate => How to get it active at Nextcloud snap

With registering to a new domain I retriggered the nextcloud.enable-https script for obtaining a new certificate. The script did run successfully.

When using the new domain to access my nextcloud I receive the message that the certificate does not fit to the new domain. A quick check revealed that still the old certificate for the previous domain was returned.

Question is now how can I de-activate the old certificate and take the new one into use?

I did already:

  • Use the disable-https script and enable-https script consecutively.
  • Stopped and restarted the nextcloud snap
  • Checked at var/snap/nextcloud/current/certs folder. The new certificate seems to be present even though not actively used.

I just added a second domain to my cert a little while ago, and did exactly that-- ran nextcloud.enable-https lets-encrypt again, this time with both domains. That script restarts Apache, which picked up the new cert. Have you tried restarting Apache yourself?

$ sudo systemctl restart snap.nextcloud.apache.service

If that doesnā€™t work, and youā€™ve verified that the new certs are correct and the old certs arenā€™t around, Iā€™m not sure whatā€™s going on there, but we can take the nuclear option.

First of all, disable HTTPS (this just removes a symlink, it doesnā€™t remove any certs):

$ sudo nextcloud.disable-https

Then blow away any certs that are there (this includes self-signed certs, Letā€™s Encrypt certs, everything). Make sure you get this command right, you donā€™t want to delete anything else in the current/ dir:

$ sudo rm -rf /var/snap/nextcloud/current/certs

Then pretend youā€™re enabling HTTPS for the first time:

$ sudo nextcloud.enable-https lets-encrypt

Actually, re-reading your post, it sounds like youā€™re not adding a new domain (thus having multiple), but replacing one. Correct? In that case, do you have multiple directories in /var/snap/nextcloud/current/certs/certbot/live? If so, thatā€™s the issue. The fix is really the same, but please let me know if this is the case, because thatā€™s an experience we could improve.

Right, I am replacing the domain.

There are two directories at /var/snap/nextcloud/current/certs/certbot/config/live/ . Each named according to my domains, the old one and the new one.

Have you tried restarting Apache yourself?

The ā€œenable-httpsā€ script was outputting that it restarts apache. In addition I did stop and restart the whole snap. Anyway I restarted the apache server again with the command provided by you. Situation did not change.

Was going now with the ā€œnuclear optionā€, laying waste to the certificates and creating a new one.
Worked fine :smiley:.

Thanks a lot for your feedback.

P.S.: FYI, binding a new domain to my nextcloud is due to a DDNS Service provided for free by a manufacturer of internet-routers (AVM). This particular DDNS Service is actually bound to the internet-router devices. With replacing my device and registering it for the DDNS Service, a new domain was assigned.

I have installed the snap in Raspbian 2017-11-29-raspbian-stretch-liteRaspbian 2017-11-29-raspbian-stretch-lite.
I needed to change the port. This I did and I can access it on the local network. However I am unable to access via my domain name. I need to be able to add it to trusted domains but the command line utility: nextcloud.occ is not recognised. So I navigated to the nextcloud snap bin directory and ran as: sudo ./occ config:system:get trusted_domains
This returned: ./occ: 3: .: Canā€™t open /utilities/mysql-utilities
I also want to enable https.

Further to this I am running raspbian now because the Ubuntu 16.04 LTS wouldnā€™t even install the snap - I put that down to the kernel. After spending a lot of time on this I abandoned it and tried Raspbian where I have had much more success.

You canā€™t run stuff from within the snap manually. You need to run things from /snap/bin, which should be on the PATH. You may need to logout/login in order to get it on there, though. I havenā€™t tried running snaps from Raspbian, but they should definitely work on Ubuntu 16.04. Not sure what issues you ran into there, unless the kernel you were using was non-standard (in which case itā€™s not really Ubuntu).

As you can see I have already tried to run the command from the bin directory, as you stated, but it threw up an error. Also the button, which appears on the page, that is presented when there is no connection on the remote url is badly formed - i.e. I think there is a bug there. Part of the url is this:
index.php/settings/admin?trustDomain=

I canā€™t see that being correct. The query string should follow ā€˜index.phpā€™ if anything. I tried modifying it to no avail. So now I am in a situation where Nextcloud runs but it is useless in practice because I canā€™t run it remotely.
The snap commands appear to work - for example i was able to change the port, but those that are supposed to run directly via sudo donā€™t woprk - even from within the bin directory as ./ or with the path included in the command.

The Ubuntu 16.04 was one I installed from a Pi image a while ago and is fully updated, it is my server. The snap, as I say, didnā€™t even finish installation on Ubuntu. So, all in all a failure for snaps as far as I am concerned. I tried a standard install on Ubuntu too, I got problems there too :frowning_face:

Iā€™m afraid thatā€™s not what I stated. In fact, youā€™re doing exactly what I told you not to do. Please read my comment again.

Those commands are in /snap/bin, as I said. Not ā€œthe bin of the snap,ā€ but literally the path /snap/bin.

Classic Ubuntu doesnā€™t have a Pi image, so it sounds like youā€™re running something non-standard. Canā€™t really help you there. Snaps need some specific kernel features.

I am guessing the issues I am facing is mostly about the lack of documentation. Installation was pretty easy. However figuring out the rest has been a big waste of time.

The out-of-snap product functions greatly but it is not sufficient for practical purposes even for a skill-less admin like me. In addition to the snap-version, I would like to use a secure connection, figure out where my data is (in order to set up a back-up system in case of failures) and configure apache (in order to set up a subdomain instead of an ip). The nextcloud documentation regarding these configurations assumes manual installation.

After hours of search I found how to convert those instructions to snap-installation instructions here: https://github.com/nextcloud/nextcloud-snap

It is not convenient for technically less skillful fellows like myself.

If you need help with a snap, itā€™s always best to see what snap info says about it:

$ snap info nextcloud
<snip>
contact:   https://github.com/nextcloud/nextcloud-snap
<snip>

Thatā€™s the only documentation over which we have control. If the Nextcloud folks are interested, we can certainly add some information about how to use the snap to the docs.

1 Like

Iā€™m new to Linux, new to VPS, and new to NC. If there is a more appropriate thread for me to post in please let me know.

I followed this:

to install NC on my DO droplet and itā€™s working just fine. Amazingly simple!

Iā€™ve read the thread from the top and it seems that if I want to host a website on the same VPS, my best bet might be to uninstall the snap package and proceed with a LAMP stack followed by a manual install of NC. Is this correct?

P.S. Iā€™ll take the opportunity of my first post to praise the great efforts the staff has put into ensuring decorum here.

Oh no, you can set it up however you like! The only limitation you have is that you canā€™t modify the Apache bundled with the snap. Thatā€™s okay, you can install your own Apache and change the default ports of the snap, and setup a vhost that proxies to the snap (and another vhost for your other website, etc.). The setup I use personally is to have every website (including the snap) in its own lxd container, and have another lxd container running haproxy to get traffic into the cluster of containers.

Thanks! I get the basic idea of what you are recommending. Iā€™m a bit foggy on the particulars but Iā€™ll read up an learn some new skills. Just one consideration, will running an additional Apache and the lxds use more system resources than a manual install of LAMP + NC?