Multisite - questions, documentation, custom setup

So, I read all the docs according to multisite, and half of the forum posts on-topic. I still feel a bit confused, so I’d like to ask some clarifying questions, and I thought that afterwards I’ll be happy to help improve documentation of this feature, as I don’t seem to be only person what has some problems with it’s current state :slight_smile: This way I will have the info I need, and community will have better docs. PROFIT!

  1. Support in Admin plugin
    Well… Is there any? As far as I understood the docs and answers here, each and every site has it’s own /plugins folder, and can have it’s own Admin Plugin. Is this correct? It seems to me, that if we’d have even the most basic functions to manage multisite (adding sites in separate tab, similar to how we add pages now?) in the GUI, it would save everyone, especially Team lots of headache.Lots of people use Admin panel, and instructions to set up multisite are somewhat… Obscure.
  2. The setup.php snipet
Okay, so let's take the subdomains example:

use Grav\Common\Utils;

// Get subsite name from sub-domain
$environment = isset($_SERVER['HTTP_HOST'])
    : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
// Remove port from HTTP_HOST generated $environment
$environment = strtolower(Utils::substrToString($environment, ':'));
$folder = "sites/{$environment}";

if ($environment === 'localhost' || !is_dir(ROOT_DIR . "user/{$folder}")) {
    return [];

return [
    'environment' => $environment,
    'streams' => [
        'schemes' => [
            'user' => [
               'type' => 'ReadOnlyStream',
               'prefixes' => [
                   '' => ["user/{$folder}"],

Uhm, I get it, so first it gets subdomain from $_SERVER superglobal, if it’s not there it assumes I’m on localhost, then it removes the port, then it looks for the site files in folder… No, wait. What files? What folder? Do I have to create this folder, or Grav will do it? And what’s about the streams?
If we can provide proper documentation of how this file works, we should have somewhat less users asking same questions again and again on forum, slack, Github, and virtually everywhere. Would it be possible?

  1. Inheritance! Folders inside folders. Inside folders.
    So, we have regular Grav dirs, and additional one - sites/, inside it there are actual sites directories, and inside them there are regular Grav user/ folders, one per each site. Well, at least that’s what I believe happens after all the reading. So, ignoring for now the facts that it makes up really many directories and the fact that we apparently want user to create all of them by hand for each site… What is the point of setting up „multiple sites sharing single code base”, if they don’t share plugins? Or themes? Or perhaps there is some esoteric way to make multisites use shared plugins/themes pool? If that’s the case, well… How to do it? I’m guessing that it is done just by omitting proper folder inside the sites/<site> directory, but it’s just a wild guess built on a fact that Grav is awesome enough to fall back to something every time a file is missing. But it’s not documented anywhere. And if it works in a way I imagine, then what happens if I have the plugins folder inside my site folder? Will this instance use only plugins inside this inner dir, or those and global plugins as well?
    Also, is there any way to use, let’s say, same user accounts in every site on this „farm”? If so, how to do it? By some symlinks?

That would be all for now, I guess :slight_smile: I’m ready and eager to learn and put all this knowledge into docs!

Help with the docs is always appreciated!