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/ 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 --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:



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?


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

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.

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:
(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?



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

    |                 `-{gmain}
    |         `-{gmain}
    |-rsyslogd-+-{in:imuxsock) S 1
    |          `-{rs:main Q:Reg}

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/

Eh, just tried and got this:


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

Edit: OK, works.

Yeah, you tried accessing LXD directly, it’s not a web interface :slight_smile:
The 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:
USER: demo
PASS: orestadlinux#