What is this about?
So far I have installed all services on my server, such as mail, database and web server, in one operating system. This is of course inconvenient, since a problem or a security incident can affect all services at once. However, classic virtualization requires many resources because all hardware must be virtualized. I therefore decided to use LXD containers, which require hardly any more resources than the processes running in it themselves. The containers behave like independent operating systems. Therefore LXD containers are not comparable with e.g. Docker containers as these normally just host one process.
This article covers the installation of Nextcloud and Collabora in two separate LXD containers on a server with only one public IP address. We don’t use Docker for Collabora as many other guides do. A previous installation of LXD is not required – we start at the very beginning. For convenient reasons I’ll use the root user – you can of course use ‘sudo’ if you want. I also tried using just different subdomains instead of two different domains but this resulted in several collabora errors I wasn’t able to figure out. Thats why we us two different domains for this how-to. Enough said, let’s start:
Step 1: Install LXD
The server (LXD host) runs with Ubuntu 16.04.4. LXD is already included in the repository, but we will install the latest version from the backports:
apt update && apt install zfsutils-linux -y apt install -t xenial-backports lxd lxd-client -y