Hello! Always glad to see people wanting to tinker with Nextcloud, but you’ll probably need to switch from the snap to a more traditional install if you want to dig into it. If you’re looking at running non-Nextcloud things along-side an unmodified Nextcloud, then adding a “reverse proxy” to your setup might be your thing.
Why?
Snaps are designed to have a limited interface for configuration (here is Nextcloud’s). Powerful (and easily misconfigured) conf files are set up in a way that works best for the most users , and are a read-only part of the snap image.
Edit: See the responses from @kyrofa and @PritishSehzpaul below. The snap is designed so that the Nextcloud config file can be edited, after all. You can also modify the snap itself (to change Apache options, for example), but running a VM or a manually configured container is probably better for this purpose.
What can I do without complicating things?
For most uses, you’ll be able to do what you need using the above snap interface (for example, configuring trusted names and SSL). If you’re looking at adding custom HTML pages (not Nextcloud apps?), you might need a bit more configurable of a solution. Two options below.
I might want to play around with Nextcloud’s more advanced options. How?
If you’re on the fence about switching to classic install, have a look at the article “Snap or VM?” in the that same wiki. If you’re sure you want to switch, you can check out the install script in the VM repo, or manually install on the server of your choice (docs).
I really just want to be able to run another webapp or serve static files on the same server. What do I need?
You’ll need to set up another web server process (Apache, nginx, etc) outside the snap. It can be on the host server, inside a VM, or anywhere else that can reach your Nextcloud snap and be reached by your end users. You can modify php parameters and everything else you need for your other app(s) separately, then have that web server act as a reverse proxy to forward Nextcloud requests through to your Nextcloud snap.
There are lots of tutorials about reverse proxy setup, but here’s a quick one from DigitalOcean: Use Apache as Reverse Proxy using mod_proxy. Note: You can substitute apt
where they use aptitude
- it does the same thing for those commands, and is installed by default on recent Ubuntu.
If your reverse proxy is running on the same host/IP address as your Nextcloud snap, you’ll probably have to change Nextcloud’s port numbers to avoid a conflict. Here’s the documentation on how to do that in the snap.
You can find example configuration files for your reverse proxy web server in this post by @KarlF12, or in my post below.
Answers to those specific questions
They’re all read-only, but here’s where things live:
-
/snap/nextcoud/current/conf/httpd.conf
.
You can restart the Apache server usingsnapd
's tooling:
sudo snap restart nextcloud.apache
-
/snap/nextcloud/current/config/php/php.ini
There isn’t a php daemon as such in this configuration - looks like it is run per-request, so you wouldn’t even need to restart Apache to apply any changes. Just reload/refresh the page. -
/snap/nextcloud/current/htdocs/config/config.php
Nextcloud doesn’t have a daemon at all, it’s all just php. See above. /snap/nextcloud/current/htdocs/