Nextcloud docs - nextcloud and database

The absolute minimum of a nextcloud installation is nextcloud itself and a database.

Create a new model and deploy nextcloud and a database:

juju add-model my-nextcloud
juju model-config default-series=focal
juju deploy postgresql
juju deploy nextcloud
juju relate nextcloud:db postgresql:db

... wait for deployment to settle.
Then, visit http://<yourip>

To get the admin password:

juju run-action nextcloud/0 get-admin-password --wait

Make sure to note it and change it after first login, since this action will only work once.

Next steps:

You can expand the deployment with haproxy (to provide ssl), redis (for cache) and possibly a persistent or shared storage.

Hi @erik-lonroth!

I was trying to deploy the nextcloud charm using those instructions, but couldn’t manage to make it work.

I changed the deploy commands a little bit (due to the changes in the PG charm channels and that the nextcloud charm is available only on the edge channel):

juju add-model my-nextcloud
juju model-config default-series=focal
juju deploy postgresql --channel latest/stable
juju deploy nextcloud --channel latest/edge
juju relate nextcloud:db postgresql:db

The error that I received was the following:

unit-nextcloud-0: 13:05:24 ERROR unit.nextcloud/0.juju-log Uncaught exception while in charm         code:
Traceback (most recent call last):
  File "./src/charm.py", line 596, in <module>
    main(NextcloudCharm)
  File "/var/lib/juju/agents/unit-nextcloud-0/charm/venv/ops/main.py", line 434, in main
    framework.reemit()
  File "/var/lib/juju/agents/unit-nextcloud-0/charm/venv/ops/framework.py", line 840, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-nextcloud-0/charm/venv/ops/framework.py", line 919, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 291, in _on_start
    self._on_update_status(event)
  File "./src/charm.py", line 455, in _on_update_status
    self._checkLogConfigDiff()
  File "./src/charm.py", line 589, in _checkLogConfigDiff
    if cluster_rel.data[self.app]['nextcloud_config'] == str(nextcloud_config):
  File "/var/lib/juju/agents/unit-nextcloud-0/charm/venv/ops/model.py", line 1493, in __getitem__
    return super().__getitem__(key)
  File "/var/lib/juju/agents/unit-nextcloud-0/charm/venv/ops/model.py", line 695, in __getitem__
    return self._data[key]
KeyError: 'nextcloud_config'
unit-nextcloud-0: 13:05:24 ERROR juju.worker.uniter.operation hook "update-status" (via hook     dispatching script: dispatch) failed: exit status 1

Do you have any idea about how to solve that?

Oh, I think this is a bug. Would you mind placing an issue? I’ve seen it before and I think its an easy fix…

What you can do to patch this is to add the key “manually” in charm.py and then remove it once its been deployed.

Sure. I created https://github.com/erik78se/nextcloud-charms/issues/61.

Thanks for the hint. I’m gonna try to patch it. Thanks @erik-lonroth!

1 Like

@neppel - I’m working on refactoring the Nextcloud charm to use the new charm lib and make the charm alot easier.

Here is the PR I’m working on: https://github.com/nextcloud-charmers/nextcloud-charms/pull/78

If you like to help, just let me know and I’ll also add you to the github repo.

There is some work needed to get the charm more stable and remove some unused code etc. Any help on the charm is welcome.

I’ll help you resolve the issue you have if you run into more problems and I can also show you how to integrate with needed charms - redis and haproxy which can be somewhat tricky.

Just let me know.

@joakimnyman is also adding to the work here.