Just installed Nextcloud 18 server, self hosted, , need help in setting https

My settings is as follows:

Ubuntu server on a 386 intel machine with local address http:192.168.1.6
A duckdns name https://xxx-nextcloud.duckdns.org that points to my home LAN
At home router forwards port 80 and 443 to a machine hosting Caddy proxy server
Caddy forwards https ://xxx-nextcloud.duckdns.org to http://192.168.1.6

I have the above settings for other services/machines and works fine.

So far I installed nextcloud 18 server and I can access it http://192.168.1.6

I need some help in making work https with nextcloud, so my server is accessible from outside.

But I receive error that I have to change my trusted domains in config.php

But where is this file???

depends on your installation.

where did you install nextcloud? /var/www/nextcloud?
then it’s in /var/www/nextcloud/config/config.php

if you use snap check the doc on github. search “nextcloud snap” on github

or find / -name config.php

I finally managed to find the file (that was diffivult)

/var/snap/nextcloud/current/nextcloud/config$

But how do I modify the file???

<?php

$snap_name = getenv('SNAP_NAME');

$CONFIG = array(
/**
 * Use the ``apps_paths`` parameter to set the location of the Apps directory,
 * which should be scanned for available apps, and where user-specific apps
 * should be installed from the Apps store. The ``path`` defines the absolute
 * file system path to the app folder. The key ``url`` defines the HTTP web path
 * to that folder, starting from the Nextcloud web root. The key ``writable``
 * indicates if a web server can write files to that folder.
 */
'apps_paths' => array(
        /**
         * These are the default apps shipped with Nextcloud. They are read-only.
         */
        array(
                'path'=> '/snap/'.$snap_name.'/current/htdocs/apps',
                'url' => '/apps',
                'writable' => false,
        ),

        /**
         * This directory is writable, meant for apps installed by the user.
         */
        array(
                'path'=> '/var/snap/'.$snap_name.'/current/nextcloud/extra-apps',
                'url' => '/extra-apps',
                'writable' => true,
        ),
),

/**
 * Database types that are supported for installation.
 *
 * Available:
 *      - sqlite (SQLite3 - Not in Enterprise Edition)
 *      - mysql (MySQL)
 *      - pgsql (PostgreSQL)
 *      - oci (Oracle - Enterprise Edition Only)
 */
'supportedDatabases' => array(
        'mysql',
),


'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
'host' => getenv('REDIS_SOCKET'),
'port' => 0,
),
);

you should use the occ commands

read https://github.com/nextcloud/nextcloud-snap and https://github.com/nextcloud/nextcloud-snap

I add it like this??? Not sure about ,().:,; the right order … why is it made so complicated :smiley:

'supportedDatabases' => array(
        'mysql',
),

'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
    'host' => getenv('REDIS_SOCKET'),
    'port' => 0,
),


'trusted_domains' =>
  array (
    'xxx.duckdns.org',
  ),

);

I saw that but which is the command on how to add a trusted domain is not there

Tried this but gives error …

@ubuntu-bbb:/var/snap/nextcloud/current/nextcloud/config$ sudo snap run nextcloud.occ config:system:set trusted_domains 1 --value=xxx.duckdns.org
Nextcloud is not installed - only a limited number of commands are available

There are no commands defined in the “config:system” namespace.

did you complete the nextcloud installation?
your config.php looks rather empty.

in fact i don’t the snap installation way of live. normally you have to setup some parameters (data path, database credentials) before you can use nextcloud.

can you access the web page now?

yes I can access it fine. I think I did all the installation correctly

for other reason I have to reset my VM, I will do a new one. WHich installation procedure do you recommend?

Docker? Snap? Other? (Tried Docker was super fast, but could not forward the right port for https)

my own:

or

if you are looking for a good howto:

https://english.c-rieger.de/nextcloud-installation-guide-ubuntu

my non-docker playbook is based (more or less) on carstens setup. but we are not in sync.

or maybe you have a look here although i didn’t find a ubuntu version

https://ownyourbits.com/nextcloudpi/

another install scritp is here:

snap should be also fine for small personal use.

if you ask here for help always mention which method you choose.

Well I manage to install it. It seems all is working, but is a bit slow inside the LAN.

From the android client I can connect, but can’t connect with Nextcloud Talk (which is the first reason I wanted Nextcloud)

Any hint?