Beta - LXD image for Nextcloud 11

Hi folks,

Iā€™ve just published a beta of my first Nextcloud 11-preinstalled LXD container.

Hereā€™s how itā€™s configured:

  • HTTP (Letā€™s Encrypt certbot is present, but hasnā€™t been run)
  • Redis, APCu caching enabled
  • Pretty links enabled
  • Data directory one level up from Nextcloud (and therefore webroot)
  • Getting started file is situated in /media/nc/start.md containing default passwords to be changed and some instructions.

The reason itā€™s a beta is two-fold:

  1. Iā€™ve tested deployment to 3 LXD hosts, each with their own IP ranges configured and it deploys fine, but it needs more testing.
  2. I canā€™t script in bash at the moment, so passwords have to be manually changed until I find a solution (or someone helps :))

To deploy the container on your host, add my public image server to your environment:

lxc remote add nextcloud demo.nextcloud.bayton.org --public

(Where nextcloud is the name you give the remote server)

Then launch:

lxc launch nextcloud:nextcloud11 myNCcontainer

(Where myNCcontainer is the name you give the local container)

Give it a try, let me know what you think. If you can work with me to provide scripts to add more user interaction and not have to ship a pre-installed NC version thatā€™d be great :slight_smile:

3 Likes

Jason

When you say ā€œI canā€™t script in bash at the moment, so passwords have to be manually changedā€ ā€¦ what passwords are you referring to?

brian

Database and Nextcloud, passwords for these are located on the getting started doc in the image.

Jason
Iā€™d posted a note about your Nextcloud LXD image on the LXD sub-reddit
yesterday and someone replied already that theyā€™d just done something
similar the day beforeā€¦

link I saw on redditā€¦

1 Like

Nice one :slight_smile: I havenā€™t publicised it beyond the forum as yet as I donā€™t think itā€™s autonomous enough with the fixed credentials.

Hopefully someone will help me script it all before long.

Another option is to treat it like other cloud systems and not have any passwords.

lxd can pass user-data on instance start, just like AWS. If your image is using cloud-init (most cloud linux does), then you pass your public key.

e.g.
cloud-config.yaml
#cloud-config
ssh-import-id: [gh:jrwren]

$ lxc launch nextcloud:nextcloud11 myNCcontainer -c user.user-data="$(cat cloud-config.yaml)"

There are no system/user passwords to consider here, though a cloud-init type script for the whole setup (lamp, databases, NC) would be excellent.

Maybe @enoch85 can help also, since he has scripts with the VM I bet we could adapt.

There are alot of stuff you can ā€œborrowā€ from the VM. Just check how we did. The cat option that @jrwren meantioned is an alternative. In the VM we generate new strong passwords with /dev/urandom and lock it into root.

For user passwords itā€™s easy, just do passwd $user and use the occ command for Nextcloud. You could generate passwords here as well and put them in a file only readable by root.

1 Like

Ah! Sorry! I misunderstood which passwords were being discussed.

Temporary update on this, the server hosting the image died yesterday and given itā€™s new-ness I hadnā€™t yet added it to a backup rota. Silly me.

Iā€™ll rebuild it over the coming days.

Hello Jason, great idea! But I get Unable to connect to: demo.nextcloud.bayton.org:8443
(or ā€˜ERR_CONNECTION_REFUSEDā€™) - is it my fault? Thank you for any hintā€¦

@ingobaab it was my fault, as I mentioned in the comment above yours the server died and I had to rebuild everything from scratch.

Everything should now work again. Give it a go :thumbsup:

1 Like

Hi Jason! Great I will try it.
I did also some exploration and created a wordpress-hosting-container (fast caching, nginx, ready to runā€¦) Maybe we should partner :slight_smile: - I will install a your-nextcloudā€¦ What I also did, was setting ab a ā€˜kolab-mailserverā€™ inside a container. What this containers should have, is a configuration-gui / webpanel. For my wordpress-thinky I developed suchā€¦

Did you consider a webpanel to configure your nextcloud-linuximage?

Container-Management:

WordPress-Configuration:

Oh wow thatā€™s nice.
Do you make use of the APIs in LXD to get that up and running? Itā€™s way ahead of my skillset; I run ~20 containers at home and a further 10 on hosts around the net with different services I can move between hosts as I see fit, but itā€™s all CLI, no fancy GUIs for me :slight_smile:

That said, I took a crack at one a while back but itā€™s not progressed much since:

Hi Jason,
I intsalled your image! great. Butā€¦ there is only apache2 running, no phpā€¦ :frowning:
Do I have to run some script or how to proceed?
Thank you for any help :slight_smile:
-Ingo - I will look at the Webpanel you mentioned, thanx

systemd-+-accounts-daemon-+-{gdbus}
    |                 `-{gmain}
    |-agetty
    |-apache2---5*[apache2]
    |-atd
    |-cron
    |-dbus-daemon
    |-dhclient
    |-mysqld---27*[{mysqld}]
    |-polkitd-+-{gdbus}
    |         `-{gmain}
    |-redis-server---2*[{redis-server}]
    |-rsyslogd-+-{in:imuxsock) S 1
    |          `-{rs:main Q:Reg}
    |-snapd---7*[{snapd}]
    |-sshd
    |-systemd-journal
    |-systemd-logind
    `-systemd-udevd

What! I launched that image on 3 hosts and it came up perfectly each time.
The install is based on my guide, so PHP7 is installed with the lamp^ meta package.

Edit, just launched one again, itā€™s straight up with no issue aside from the domain error mentioned in /media/nc/start.md:

Eh, just tried https://demo.nextcloud.bayton.org:8443 and got this:

{"type":"sync","status":"Success","status_code":200,"operation":"","error_code":0,"error":"","metadata":["/1.0"]}

Thatā€™s not even the status.php, which file is that? :smiley:

Edit: OK, https://demo.nextcloud.bayton.org works.

Yeah, you tried accessing LXD directly, itā€™s not a web interface :slight_smile:
The demo.nc URL there is temporary, Iā€™ll likely have a landing page for the actual demo servers in future. In the meantime you can access the demos 9, 10, 11 and 12.

How do you do with the sessions? Are they valid for XX minutes and then everything is reset, or is each session itā€™s own container (like the Nextcloud demo)?

Hereā€™s another demo server btw: https://demo.orestad-linux.se
USER: demo
PASS: orestadlinux#