Snap Install to Separate Database

Hello all,

I am trying to figure out how I can install a snap image to have it use a remote database. I tried editing /var/snap/nextcloud/current/nextcloud/config/config.php, but it got overwritten by the nextcloud.manual-install command and reverted my configs to ones that used the mysql instance that was running on the localhost.

Is there some way to tell the snap to initiate and use a remote database?

I would like to do the same thing, especially since I would like to have more than one database-based application running on my server, and NC Snap won’t coexist peacefully in its default form.

Hello,

Snap, by design is extremely rigid and locked down for it’s stability & security objective.

Here is what snap nextcloud team has to say about this,

However, the snap is very opinionated. Don’t want to use Apache? Sorry, the snap uses it. Don’t want to use MySQL? Sorry, that’s what the snap uses. Something other than PHP whatever-we’re-using? We picked the version we feel gives the best results. In other words, it’s not very tinker-friendly. We don’t do this to be mean, we do this so that we can reliably update it without your needing to worry about it.

Refer here → Snap or VM? · nextcloud-snap/nextcloud-snap Wiki · GitHub

Customization options are really limited but things which are supported are mentioned and listed here → Configure Nextcloud snap · nextcloud-snap/nextcloud-snap Wiki (github.com)

Thanks.

So, should I read that answer as “If you install Nextcloud via Snap, you will not be able to install other applications that require MariaDB on your machine”?

Because that would have been nice to know before installation.

To clarify: I am not attempting to get Snap to use a different database. I am attempting to be able to run literally anything else on the host that Nextcloud Snap is installed on, without Nextcloud being auto-configured by the Snap team to make that impossible, instead of using an alternate socket/port setup in the Snap install so that it doesn’t conflict with other software.

If the point of Snap is to be easy and self-contained, making it not actually self-contained is a failure of mission.

Hello,

I guess you are referring to your post regarding this Nextcloud Snap: snap mariadb prevents normal install/use of host mariadb

I too have WordPress and Snap Nextcloud within same box but for WP, I choose the docker route for deployment as it’s own full stack so personally I don’t have this exact situation, but I think you should open a support issue at GitHub → Issues · nextcloud-snap/nextcloud-snap · GitHub to communicate directly with the dev team there.

Thanks.

I’ve noticed something interesting in the UNIX world. Whenever something doesn’t work as it is supposed to, someone suggests that you’re using the wrong thing.

The Nextcloud snap should not be using the same sockets as would be used on the host server. It should be using something custom that does not conflict with other default installations.

I’m fine with Nextcloud having its own copy of MariaDB. My issue is that I cannot run my own separate copy of MariaDB if I have installed Nextcloud via Snap, because the NC snap hogs all the standard methods of connection.

Hi,

Where did I suggest you to do it in a different way?

Infact, I agreed with your understanding about snap interfering with something which is out of it’s confinement. Further, I shared a link of the Snap Github & suggested you to talk to the dev directly there for the issue that you are facing.

Thanks.