In order for your players to be able to install plugins via plugin management GUI, we need to mount the plugins repository folder to each of your virtualised containers (servers).
Unfortunately, Pterodactyl doesn't provide an API for that at the moment (until v2 is out), so we will need to perform a quick modification on your Pterodactyl's code.
You will need to perform these modifications every time you update Pterodactyl.
Instructions
Navigate to your Pterodactyl folder, preferably via some kind of SFTP file manager, like WinSCP or CyberDuck. The directory is usually /var/www/pterodactyl.
Open up app/Http/Controllers/Api/Application/Servers/ServerManagementController.php preferably using some sort of text editor, like VSCode or Notepad++.
If you're a more advanced user, just making sure to merge this differences will be enough. For everyone else, please carefully follow the instructions below.
Below all imports, paste use Pterodactyl\Models\MountServer; Your imports should look like the following:
ServerManagementController.php
<?phpnamespacePterodactyl\Http\Controllers\Api\Application\Servers;useIlluminate\Http\Response;usePterodactyl\Models\Server;usePterodactyl\Services\Servers\SuspensionService;usePterodactyl\Services\Servers\ReinstallServerService;usePterodactyl\Http\Requests\Api\Application\Servers\ServerWriteRequest;usePterodactyl\Http\Controllers\Api\Application\ApplicationApiController;usePterodactyl\Models\MountServer; # This is the line we added
Below reinstall function, paste the following code block:
The end result will be the following file (which you may as well just copy and replace your whole file contents with, but a more manual approach like in steps 1 and 2 is recommended):
ServerManagementController.php
<?phpnamespacePterodactyl\Http\Controllers\Api\Application\Servers;useIlluminate\Http\Response;usePterodactyl\Models\Server;usePterodactyl\Services\Servers\SuspensionService;usePterodactyl\Services\Servers\ReinstallServerService;usePterodactyl\Http\Requests\Api\Application\Servers\ServerWriteRequest;usePterodactyl\Http\Controllers\Api\Application\ApplicationApiController;usePterodactyl\Models\MountServer; # This is the line we addedclassServerManagementControllerextendsApplicationApiController{/** * ServerManagementController constructor. */publicfunction__construct(privateReinstallServerService $reinstallServerService,privateSuspensionService $suspensionService ) {parent::__construct(); }/** * Suspend a server on the Panel. * * @throws\Throwable */publicfunctionsuspend(ServerWriteRequest $request,Server $server):Response {$this->suspensionService->toggle($server);return$this->returnNoContent(); }/** * Unsuspend a server on the Panel. * * @throws\Throwable */publicfunctionunsuspend(ServerWriteRequest $request,Server $server):Response {$this->suspensionService->toggle($server,SuspensionService::ACTION_UNSUSPEND);return$this->returnNoContent(); }/** * Mark a server as needing to be reinstalled. * * @throws\Pterodactyl\Exceptions\DisplayException * @throws\Pterodactyl\Exceptions\Model\DataValidationException * @throws\Pterodactyl\Exceptions\Repository\RecordNotFoundException */publicfunctionreinstall(ServerWriteRequest $request,Server $server):Response {$this->reinstallServerService->handle($server);return$this->returnNoContent(); }# Our mount functionpublicfunctionmount(ServerWriteRequest $request,Server $server):Response { $mountServer = (newMountServer())->forceFill(['mount_id'=> $request->input('mount_id'),'server_id'=> $server->id, ]); $mountServer->saveOrFail();return$this->returnNoContent(); }}
Now navigate to app/routes/api-application.php and open it.
The end result should look like the following. You can also just use it to completely copy-paste the content to your api-application.php, but a more manual approach like in step 1 is preferred as Pterodactyl may do additional modifications to this file in the future.
After that's done, we can now create our mount. Go to the mounts tab on your Pterodactyl admin panel and click the Create New and fill the fields as in the following example. Make sure to name Target folder as /plugins-repo. Source folder should be set to the path of your plugins folder.