Multiple yunohost instances on one server

(english below)


FRANÇAIS

Sur un serveur dédié, j’aimerais installer plusieurs instances de yunohost.

Si je comprends bien, yunohost lui-même n’est pas fait pour cela : Qu'est-ce que YunoHost ? | Yunohost Documentation

il est dit : « un VPS entier par utilisateur sera la meilleure solution »

Je me demandais donc quelle serait la meilleure façon d’atteindre cet objectif, d’avoir plusieurs instances séparées de Yunohost :

  • Devrais-je, par exemple, installer les multiples instances de Yunohost en tant que conteneurs Docker ?
  • J’ai également entendu parler de l’utilisation de proxmox pour créer des VMs, est-ce que c’est mieux ?
  • ou autre chose ?
  • En termes de sécurité, Yunohost s’en occupe mieux que je ne pourrais le faire moi-même, donc si je n’installe pas Yunohost sur mon serveur mais à l’intérieur d’un conteneur ou d’une VM, alors je devrais m’occuper moi-même de la sécurité de mon serveur, et je ne suis pas sûr de pouvoir le faire. Est-il possible, à la place, d’installer yunohost sur le serveur, puis à l’intérieur de celui-ci de créer des conteneurs ou des VMs pour de multiples instances de yunohosts ? Ou est-ce une mauvaise idée ?

Merci d’avance pour votre aide :slight_smile:


ENGLISH

On a dedicated server, I would like to install multiple yunohost instances.

If I understand correctly, yunohost itself is not designed for this : What is YunoHost? | Yunohost Documentation

it says : “a full VPS per user will be just fine, and we believe a better way to go”

So I was wondering what would be the best way to achieve this goal, of having multiple separated instances of yunohost :

  • should i, for example, install the multiple instances of yunohost as docker containers ?
  • another way that i heard is to use proxmox to create VMs, is it better ?
  • or something else ?
  • in terms of security, yunohost handles it better that i could do it myself, so if i don’t install yunohost on my server but inside a container or a vm, then I should take care of the security of my server myself, and I’m not sure I can do that. Is it possible, instead, to install yunohost on the server, then inside of it creates containers or VMs for multiple instances of yunohosts ? Or is it a bad idea ?

thanks in advance for your help :slight_smile:

Docker : no
Proxmox VMs behind nginx proxy manager

Mais pourquoi tu as besoin de plusieurs instances ?

salut @jarod5001 merci pour ta reponse :slight_smile:

tu peux elaborer ?

merci pour cette idee, je vois rapidement sur le forum que c’est utilisé par d’autres, mais pas toujours avec succès, je vais regarder (exemple : YunoHost derrière Nginx Proxy Manager - #4 by valterbarreira, ou encore : Deux yunohost derrière une seule box? - #20 by Kimous)

Et niveau securité, ‘nginx proxy manager’ tu preconise de le mettre directement sur mon serveur ? Il faut donc que je gere moi-meme la securité de ce serveur ?

eh bien, j’aimerai deployer un yunohost pour une asso, et un autre pour moi, et un autre pour ma famille, etc. Et par exemple dans l’association je ne serais pas le seul a avoir les acces roots, je ne veux pas que ce soit la meme instance que pour mes trucs personnels.

Et j’ai bcp de place sur mon serveur, donc je voudrais essayer de tout mettre dessus.

Pourquoi, est-ce que ca te semble inutile ? Tu penses que je peux avoir un seul yunohost pour differents groupes de gens et que ca ne pose pas de problemes ?

Désolé pour la réponse précipité, j’étais un peu occupé. L’image docker n’est pas à jour donc inutilisable.

Je me rappelle qu’il y a quelqu’un sur le forum qui a créé une VM pour nginx proxy manager et une VM pour chaque instance yunohost.

Oui, la machine hôte doit avoir un pare-feu ainsi que les dernières mises à jour, tout comme proxmox et les instances yunohost.
Ça va être du boulot mais au fur et à mesure ce sera plus clair.
L’avantage dans cette architecture c’est que chaque instance est indépendante des autres, si un jour tu dois passer la main à d’autres personnes pour gérer celle de l’association ou que le besoin est devenu trop important et qu’il faut migrer ailleurs, c’est plus facile à déplacer. Si c’était une seule instance pour gérer tout ces besoins, même avec la création de groupe et d’applications dédiées, c’est pas aussi simple.
C’est à toi de voir ce qui te convient le mieux. Il faut penser aussi à l’avenir.

ha ok pour docker :slight_smile:

oui je suis d’accord, chaque instances independentes les unes des autres ça me plait mieux aussi !

Et pour ce qui est de la securité, notamment le pare-feu et toutes les configurations, est-ce que yunohost ne fait pas justement lui-meme le taf de gerer tout ca ?

Du coup je me dis que je peux installer yunohost sur mon server, et dessus installer ‘nginx proxy manager’ en container docker, et des VMs avec Proxmox ? Ou bien ca n’apporte pas grand chose d’avoir le serveur hote en os yunhost ?

Tu peux utiliser plusieurs VM, et dans chacune 1 Yunohost.

Mais, il te faudra quelque part un Proxy SNI, et, légèrement adapter chaque config Yunohsot.

Alternative :
Dans Yunohost, il y a une App : Incus fork de LXD. Mais à priori ça ne fonctionnera pas si ton yunohost est déjà dans une VM.
Bref, ça te permettrait d’avoir facilement beaucoup de VM.

Bref, un peu de choix.

Je n’utilise plusieurs Yunohost que lorsque je dois installer plusieurs applications qui ne peuvent pas être installées plusieurs fois dans un même Yunohost, comme Peertube.

FRANÇAIS
Proxmox est aussi une bonne solution potentielle.
Chaque instance Yunohost peut etre dans une VM ou un conteneur LXC (plus leger en ressources, a mon avis une tres bonne solution). Dans proxmox on peut creer plusieurs “bridges” virtuels ce qui fait que les instances peuvent meme etre sur des sous-reseaux completement separes. Comme deja mentionne par d’autres, il faut un reverse proxy en amont qui va diriger les requetes vers la bonne instance correspondant a chaque nom de domaine (le reverse proxy peut aussi etre un conteneur/VM dans proxmox!)…
Evidemment cela demande un peu de travail / preparation mais c’est tres propre et aussi extensible.

ENGLISH
Proxmox can be a way to address this use case. Each Yunohost instance can be in its VM or LXC container (more resource-efficient, and a very good approach in my opinion). The networking capabilities of Proxmox can also go as far as creating separate subnets.
As mentioned by others already, in order to direct the traffic to the instance corresponding to each domain name, you will need a reverse proxy upstream of your server (this reverse proxy can perfectly by a VM/CT within Proxmox!).
This will require some planning and preparation but this can be a neat and expandable approach.

1 Like

Hi hugogogo,

For me it is easier to write English, so I continue that side of your post :wink:

First of all, could you elaborate on the need for separate instances?

I run ‘something in between’: Linux containers on Proxmox.

Each Linux container runs a Debian distribution with Yunohost added afterwards; the only drawback compared to VMs is that each of them runs the same kernel. The benefits are that the resource needs for a container are much lower than for a full VM.

In my case, having separate instances per user/family is grown historically. We used to give the classmates of our children single board computers installed with Yunohost to run at their place, but over time a number came to run out our place again (not every primary school kid turned out to be as interested in being sysadmin as I had anticipated :stuck_out_tongue: ).

After a while it was easier to have all of it virtualized instead of all those SBC’s hanging over the edge of my desk by their ethernet cable. If I knew it would end like that, I would have run a single large instance and managed users and groups, instead of separate Yunohost instances each with their own installed apps.

The benefit now is, if they like to manage their server by themselves after high school, I can just turn it over to them.

Most of the servers are only reachable over IPv6, without a need for SNI or reverse proxying.

Nice. Very similar to what I was suggesting. Also clever use of IPv6!

FRANCAIS

merci pour toutes vos reponses !

donc si je resume, la technique commune consiste a avoir des instances virtuelles, soit sur des VMs (virtual machines), soit avec des containers :

  • VMs avec proxmox
  • containers, soit avec proxmox, soit incus (fork of lxd, present dans yunohost)
    • plus leger
    • mais meme kernel → quels problemes ca peut poser ? securité ? ressources ? limitations dans ce qui peut être fait dans les containers ?

et pour pouvoir acceder a chaque instance séparement il y a 3 options :

  • des reverses proxy par exemple avec nginx proxy manager
  • SNI → je ne comprends pas trop ce que c’est, mais pour les usagers il me semble que ca revient au même ?
  • ipv6 → (edité) acceder aux instances sans utiliser de nom de domaine, c’est ca ? directement avec les adresse ip, donc ipv4 aussi pourrait marcher ?

avec toutes ces infos, j’ai l’impression que je vais partir sur la methode (edité, meilleur comprehension de l’implication d’utiliser ipv6) :

**un proxy + containers avec Incus**

(avant edition : ipv6 + containers avec Incus)

dès que j’aurais reussi a changer mon OS pour debian11 (je decouvre le monde des ipmi et idrac, et ca ne marche pas bien pour l’instant :p), j’essaierai d’implementer ca, et je vous tiendrai au courant !


ENGLISH

thank you all for your answers !

so to sum up, the common technique is to have virtual instances, either on VMs (virtual machines) or with containers:

  • VMs with proxmox
  • containers, either with proxmox or incus (fork of lxd, present in yunohost)
    • lighter
    • but the same kernel → what problems might that pose? security? resources? limitations on what can be done in the containers?

and to be able to access each instance separately there are 3 options:

  • proxy reverses, for example with nginx proxy manager.
  • SNI → I don’t really understand what that is, but for users it seems to me that it’s the same thing?
  • ipv6 → (edited) access instances without using a domain name, right? directly with ip addresses, so ipv4 could also work?

With all this information, I have the impression that I’m going to use the method (edited, better understanding of the implications of using ipv6) :

**a proxy + containers with Incus**

(before edit : ipv6 + containers with Incus)

as soon as I’ve managed to change my OS to debian11 (I’m discovering the world of ipmi and idrac, and it’s not working well at the moment :p), I’ll try to implement it, and I’ll keep you posted!


notes : @wbk you asked :

First of all, could you elaborate on the need for separate instances?

well, I have a dedicated server with a lots of place, and I plan to have an instance for me, another one for an association, and certainly other instances for friends, family, and maybe other associations. I want to give full sudo access to the isntance for the association for example, without worrying of what happens to the other instances

1 Like

Hi hugogogo,

Thanks for sharing your usecase, having separate instances makes sense indeed :slight_smile:

possible drawbacks of containers / identical kernel?

The most important drawback is a non-issue: the operating system in the container has to be compatible with the kernel. That means: no BSD or Windows containers on a Linux host.

Do have a look at Proxmox! Proxmox is, just like Yunohost, Debian"+". Searching the Net for ‘Incus’ does give a result for the container project itself somewhere around place 15, but not any forum or external site. Having Incus available on Yunohost does not help unless you run Yunohost on bare metal as well. Searching the Net for Proxmox does not give the projects own forum as the top result (forum.proxmox.com shows up just in the top 10 for me), but there are many sources of information available.

Positive points of Proxmox, for me, include:

  • aggressively open source, eg: before the HTML version was fully usable on mobile, there was an Android app (also distributed outside of commercial app stores), but no IOS app , citing GPL ploblems with Apple;
  • mature ecosystem, with flawless uprades (I started with Proxmox 6 a couple of years ago, never had a problem upgrading. Benefit of Debian actually, anyaway :wink: )
  • Very good integrated back-up options, as well as a separate backup server solution (PBS) that you could run at home to receive backups.
  • Management not only via CLI or API, but via a friendly web frontend as well

Whichever route you take: good luck!

1 Like

Yes, and also:

  • VM/CT images can be themselves backed up, so if the server fails, the configuration can be reconstructed relatively easily
  • the infrastructure can also be extended using the proxmox “cluster” functionalities
2 Likes

ok, that’s good points to use proxmox, but I’m worrying about the same thing I said earlier : security

If I install proxmox on my server instead of yunohost, how will I handle security ?

I’m not sure what security is handled by yunohost, mainly setting up fail2ban and then we can customize the ssh config to prevent password connection I think, maybe other things, but I don’t know anything about it, so I prefer that it is handled by yunohost, am i wrong ?

Or can i have both : yunohost, and proxmox ?

Each VM will be independent.
So, on each VM, if there is Yunohost, you must check update about applications and system.
Il you have many VM, you can use command line by ssh. Of course, it’s best for the physical server to update one by one each server and not all together at same time.

And, the physical server, with Proxmox or other tool for VM must be updated too.

Something I not yet tried is :

  • On the physical server, you install Yunohost, with only 2 applications:
  • first can be monitoring like Zabbix or Netdata
  • second can be Incus, to manage containers

On each containers, you can install Yunohost.

In this case, the physical server can be updated by Yunohost interface or command line.

Or course, you will need a Proxy SNI somewhere. On your physical server or in a VM/Container.

(I not yet worked on SNI proxy package on Yunohost, sorry)