### Install Dependencies and Start Server Source: https://github.com/pelican-dev/docs/blob/main/README.md Install project dependencies and start the local development server. Ensure Node.js and pnpm are installed. ```shell pnpm i pnpm run start ``` -------------------------------- ### Basic Example Setup Diagram Source: https://github.com/pelican-dev/docs/blob/main/docs/glossary.mdx Illustrates the architecture and flow between the Pelican Panel, Wings, Nodes, and various server instances. ```mermaid flowchart TD A(Pelican Panel) A --> B1(Basement Server) A --> B2(Rented Server) B1 --> W1(Wings) B2 --> W2(Wings) W2 ---> C5(Palworld) W2 ---> C6(Discord Bot) W1 ---> C7(FTB Minecraft) W1 ---> C8(Factorio) W1 ---> C9(GTA FiveM) W1 ---> C4(Project Zomboid) ``` -------------------------------- ### Install MariaDB Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/mysql.mdx Installs MariaDB server, a preferred MySQL fork, using provided repository setup script and apt. ```sh curl -sSL https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash sudo apt install -y mariadb-server ``` -------------------------------- ### Example Minecraft Server Install Script Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx A basic bash script to download a Minecraft server jar. Ensure the script is executable and placed in the correct location. ```bash #!/bin/bash # Minecraft Server Installation Script cd /mnt/server # Download the server jar echo "Downloading server jar..." curl -o server.jar https://example.com/minecraft-server.jar echo "Installation complete!" ``` -------------------------------- ### Setup Pelican Database Configuration Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/mysql.mdx Navigates to the Pelican directory and runs a command to set up the database environment. This is for existing installations switching to MySQL. ```sh cd /var/www/pelican php artisan p:environment:database ``` -------------------------------- ### Example Startup Command Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx This is an example of a startup command for a Java-based server. Ensure the SERVER_JARFILE variable is correctly set. ```bash java -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true -jar {{SERVER_JARFILE}} ``` -------------------------------- ### Example Environment Variables for Placeholders Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx Examples of environment variables that correspond to placeholders in the STARTUP variable. ```bash SERVER_MEMORY=1024 SERVER_JARFILE=server.jar ``` -------------------------------- ### Install Plugin Manually Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/plugins.mdx To install a plugin manually, move its folder to the 'plugins' directory and then run the installation command. Select the new plugin when prompted. ```bash php artisan p:plugin:install ``` -------------------------------- ### Enable and Start Redis Service Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/redis.mdx Enables the Redis service to start on boot and starts it immediately. ```sh sudo systemctl enable --now redis-server ``` -------------------------------- ### Example Startup Environment Variable Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx An example of the STARTUP environment variable format, which includes placeholders for server memory and the JAR file. ```bash STARTUP="java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}" ``` -------------------------------- ### Install Composer Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/getting-started.mdx Download and install Composer globally on your system. ```bash curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer ``` -------------------------------- ### Enable and Start Wings Service Source: https://github.com/pelican-dev/docs/blob/main/docs/wings/install.mdx After creating the service file, enable and start the Wings service using systemctl. This command ensures Wings starts on boot. ```sh sudo systemctl enable --now wings ``` -------------------------------- ### Install Docker CE Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/docker.mdx Use this command for a quick installation of Docker CE. Refer to official documentation if issues arise. ```sh curl -sSL https://get.docker.com/ | CHANNEL=stable sudo sh ``` -------------------------------- ### Enable Docker to Start on Boot Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/docker.mdx Enables Docker to automatically start when the system boots on systems using systemd. ```sh sudo systemctl enable --now docker ``` -------------------------------- ### Building from Source with npm Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx Install Node.js dependencies and build a project from source using `npm install` and `npm run build`. Ensure Node.js is available in the script container. ```bash npm install npm run build ``` -------------------------------- ### Run Panel Environment Setup CLI Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/panel-setup.mdx Execute the command to automatically create the .env file and generate the APP_KEY if they don't exist. ```sh sudo php artisan p:environment:setup ``` -------------------------------- ### Install Redis Server Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/redis.mdx Updates package lists and installs the Redis server package. ```sh sudo apt update -y sudo apt install -y redis-server ``` -------------------------------- ### Install Dependencies with apt-get Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx Installs essential packages required for the container environment using Ubuntu's apt package manager. All installations are consolidated into a single RUN command to optimize image layers. ```bash RUN apt update -y \ && apt install -y \ curl \ lsof \ ca-certificates \ openssl \ git \ tar \ sqlite3 \ fontconfig \ tzdata \ iproute2 \ libfreetype6 \ redis-tools \ tini \ zip \ unzip \ jq ``` -------------------------------- ### Configure GRUB for Swap Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/docker.mdx Example of a GRUB configuration line to enable swap space. Ensure to include OS-specific parameters and reboot after changes. ```text GRUB_CMDLINE_LINUX_DEFAULT="swapaccount=1" ``` -------------------------------- ### Example Mount Configuration in Wings Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/mounts.mdx An example of how to configure a specific directory, `/var/lib/pelican/mounts`, as an allowed mount point in the Wings configuration file. ```yaml allowed_mounts: - /var/lib/pelican/mounts ``` -------------------------------- ### Install PHP 8.5 on Ubuntu Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/php-upgrade.mdx Installs PHP 8.5 and common extensions by adding a PPA, updating package lists, and installing the necessary packages. Optionally removes old PHP versions. ```bash sudo add-apt-repository -y ppa:ondrej/php sudo apt -y update # Optional: Remove old PHP versions sudo apt -y purge php* # Install PHP 8.5 sudo apt -y install php8.5 php8.5-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,sqlite3,fpm} ``` -------------------------------- ### Install Script Exit Code Handling Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx This script checks for the successful creation of 'server.jar' after a download. It exits with `1` on failure and `0` on success, which is crucial for the egg's installation status. ```bash # Check if download was successful if [ ! -f "server.jar" ]; then echo "Failed to download server.jar" exit 1 fi echo "Installation successful" exit 0 ``` -------------------------------- ### Edit Environment Setup Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx Use this command to edit the environment setup. It provides options for controlling output and interaction. ```sh php artisan p:environment:setup [options] ``` ```sh Options: -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Setup Redis for Cache, Queue, and Session Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx This command sets the cache, queue, and session drivers to Redis simultaneously. Configure Redis connection details using the provided options. ```sh php artisan p:redis:setup [options] ``` ```sh Options: --redis-host[=REDIS-HOST] Redis host to use for connections. --redis-user[=REDIS-USER] User used to connect to redis. --redis-pass[=REDIS-PASS] Password used to connect to redis. --redis-port[=REDIS-PORT] Port to connect to redis over. -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Setup Pelican for Redis Driver Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/redis.mdx Configures Pelican to use Redis as its driver. This command should be run after installing Pelican if switching from a different driver. ```sh cd /var/www/pelican php artisan p:redis:setup ``` -------------------------------- ### Install Wings Executable Source: https://github.com/pelican-dev/docs/blob/main/docs/wings/install.mdx Sets up the necessary directory structure and downloads the Wings executable. This command automatically detects your system's architecture (amd64 or arm64) for the correct download. ```shell sudo mkdir -p /etc/pelican /var/run/wings sudo curl -L -o /usr/local/bin/wings "https://github.com/pelican-dev/wings/releases/latest/download/wings_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")" sudo chmod u+x /usr/local/bin/wings ``` -------------------------------- ### Example Quota Report Output Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx This is an example output from the `repquota` command, showing block and file limits for different projects. It illustrates used, soft, hard, and grace periods for both blocks and files. ```shell Block limits File limits Project used soft hard grace used soft hard grace ---------------------------------------------------------------------- 235844d3-9258-4846-bb04-bcff209ccf9 -- 3G 0G 5G 1g 0g 0g cdb26bbb-963d-44b1-8353-360243032b1 -- 2G 0G 2G 1g 0g 0g ``` -------------------------------- ### Configure Installer Limits Source: https://github.com/pelican-dev/docs/blob/main/docs/wings/optional-config.mdx Set memory and CPU limits for installer containers. These limits are overridden if the server's defined limits are higher. ```yaml installer_limits: memory: 1024 cpu: 100 ``` -------------------------------- ### Create Panel Directory Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/getting-started.mdx Create the directory where the Pelican Panel will be installed and navigate into it. ```sh sudo mkdir -p /var/www/pelican cd /var/www/pelican ``` -------------------------------- ### Enable Apache Modules and Site Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/webserver-config.mdx Enable necessary Apache modules (rewrite, PHP) and the custom site configuration. Ensure the PHP module version matches your installation. ```sh sudo a2ensite pelican.conf ``` ```sh sudo a2enmod rewrite ``` ```sh sudo a2enmod php8.5 ``` -------------------------------- ### Install acme.sh Client Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Installs the acme.sh client, a script for obtaining and renewing certificates. This is for advanced users not having access to port 80. ```sh curl https://get.acme.sh | sh ``` -------------------------------- ### Install Certbot (Caddy/Other) (Ubuntu) Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Installs the base Certbot package for Ubuntu. Use this for Caddy or other web servers not covered by specific plugins. ```sh sudo apt install -y certbot ``` -------------------------------- ### Reference Variables in Install Scripts Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx For shell environments and install scripts, use the standard shell variable syntax `${VAR_NAME}`. This is common for passing values like Minecraft versions or configuration URLs. ```bash #!/bin/bash cd /mnt/server echo "Downloading Minecraft version ${MINECRAFT_VERSION}..." curl -o server.jar https://example.com/minecraft-${MINECRAFT_VERSION}.jar echo "Setting default config from ${CONFIG_URL}" ``` -------------------------------- ### Custom Caddyfile for Reverse Proxy Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/docker.mdx An example Caddyfile configuration for hosting the Pelican Panel behind a reverse proxy. This setup bypasses TLS certificate acquisition and trusts a specific upstream IP. ```caddyfile { admin off servers { trusted_proxies static [UPSTREAM IP] } } :80 { root * /var/www/html/public encode gzip php_fastcgi 127.0.0.1:9000 file_server } ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/getting-started.mdx Install the required Composer dependencies for the Pelican Panel. Ensure you do not run 'composer update'. ```bash sudo COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader ``` -------------------------------- ### Install Certbot Apache Plugin (Ubuntu) Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Installs the Certbot Apache plugin for Ubuntu. Use this when your web server is Apache. ```sh sudo apt install -y python3-certbot-apache ``` -------------------------------- ### Start Pelican Panel with Docker Compose Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/docker.mdx Run this command in the directory containing your `compose.yml` file to start the Pelican panel in detached mode. ```sh docker compose up -d ``` -------------------------------- ### Using Egg Variables in Install Script Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx This script demonstrates how to use predefined egg variables like MINECRAFT_VERSION and SERVER_MEMORY within your bash install script to dynamically configure downloads and settings. ```bash #!/bin/bash cd /mnt/server # Download specific version using egg variable echo "Downloading Minecraft version ${MINECRAFT_VERSION}..." curl -o server.jar https://example.com/minecraft-${MINECRAFT_VERSION}.jar # Use server memory variable echo "Server will run with ${SERVER_MEMORY}MB of RAM" ``` -------------------------------- ### Install Certbot Nginx Plugin (Ubuntu) Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Installs the Certbot Nginx plugin for Ubuntu. Use this when your web server is Nginx. ```sh sudo apt install -y python3-certbot-nginx ``` -------------------------------- ### Add Redis Repository Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/redis.mdx Installs necessary packages and adds the Redis repository to your system's sources. ```sh sudo apt install -y lsb-release curl gpg curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list ``` -------------------------------- ### Start Wings in Debug Mode Source: https://github.com/pelican-dev/docs/blob/main/docs/wings/install.mdx Run Wings with the --debug flag to start it in debug mode for troubleshooting. This is a temporary step before daemonizing. ```sh sudo wings --debug ``` -------------------------------- ### Define Server Start Completion Indicator Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx Specifies a string that indicates when a server has finished starting. Wings will mark the server as 'RUNNING' once this string is detected in the server output. ```json { "done": ")! For help, type " } ``` -------------------------------- ### Register Plugin Routes Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/plugins.mdx Example of how to register routes for your plugin within a RouteServiceProvider. It demonstrates registering a single endpoint, loading routes from a file, and adding routes to an existing client API. ```php use Illuminate\Foundation\Support\Providers\RouteServiceProvider; class MyPluginRoutesProvider extends RouteServiceProvider { public function boot(): void { $this->routes(function () { // Single new endpoint with Controller Route::get('test', [TestController::class, 'test'])->name('my-plugin.test'); // Load routes from file Route::prefix('/my-plugin')->group(plugin_path('my-plugin', 'routes/web.php')); // Add routes from file to existing client api Route::middleware(['api', 'client-api', 'throttle:api.client']) ->prefix('/api/client') ->scopeBindings() ->group(plugin_path('my-plugin', 'routes/api-client.php')); }); } } ``` -------------------------------- ### Check Cronjob Setup for Schedules Source: https://github.com/pelican-dev/docs/blob/main/docs/troubleshooting.mdx List the cronjobs for the webserver user to verify that the schedule:run artisan command is correctly set up. This ensures that scheduled tasks are executed automatically. ```bash crontab -l -u www-data ``` -------------------------------- ### Retrieve Generated Encryption Key Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/docker.mdx After the container starts for the first time, use this command to view the generated application key from the panel's logs. It's crucial to back up this key. ```sh docker compose logs panel | grep 'Generated app key:' ``` -------------------------------- ### Start Nginx Service Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Use this command to restart the Nginx service after a certificate has been renewed. ```sh systemctl start nginx ``` -------------------------------- ### Dockerfile for Java 8 Yolk Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx This Dockerfile sets up a Java 8 environment for a Pelican Hosting Panel yolk. It specifies the base image, installs necessary dependencies, and configures the container user and environment. ```dockerfile # ---------------------------------- # Pelican Panel Dockerfile # Environment: Java # Minimum Panel Version: 1.0.0 # ---------------------------------- FROM --platform=$TARGETOS/$TARGETARCH eclipse-temurin:8-jdk-noble LABEL org.opencontainers.image.authors=“support@pelican.dev” \ org.opencontainers.image.source=“https://github.com/pelican-eggs/yolks” \ org.opencontainers.image.licenses=MIT \ org.opencontainers.image.description=“Custom Yolk for Pelican Hosting Panel” RUN apt update -y \ && apt install -y \ curl \ lsof \ ca-certificates \ openssl \ git \ tar \ sqlite3 \ fontconfig \ tzdata \ iproute2 \ libfreetype6 \ redis-tools \ tini \ zip \ unzip \ jq ## Setup user and working directory RUN useradd -m -d /home/container -s /bin/bash container USER container ENV USER=container HOME=/home/container WORKDIR /home/container STOPSIGNAL SIGINT COPY --chown=container:container ./entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] CMD ["/entrypoint.sh"] ``` -------------------------------- ### Download and Install Wings Manually Source: https://github.com/pelican-dev/docs/blob/main/docs/wings/update.mdx This command downloads the latest Wings binary for Linux, stops the current Wings process, replaces the binary, and makes it executable. It automatically detects the system architecture (amd64 or arm64). ```sh sudo systemctl stop wings sudo curl -L -o /usr/local/bin/wings "https://github.com/pelican-dev/wings/releases/latest/download/wings_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")" sudo chmod u+x /usr/local/bin/wings ``` -------------------------------- ### Get Project Quota Statistics Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Generate a quota report broken down by project using the `repquota` command. The `-P` flag displays the report per project, using the server UUID as the project name. Use `--human-readable=g,g` to display limits in Gigabytes. ```bash repquota -P --human-readable=g,g /var/lib/pelican/volumes/ # could also be /dev/sdb ``` -------------------------------- ### Get Device Path and UUID for Existing EXT4 Partition Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Finds the device path and UUID for an existing mount point using the 'findmnt' command. This is useful for identifying partitions that need quota configuration updates. ```bash findmnt /var/lib/pelican/volumes -no SOURCE,UUID ``` -------------------------------- ### Entrypoint Script for Server Startup Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx A bash script that sets the working directory, outputs the Java version, modifies the startup command by replacing placeholders, and executes the modified command. ```bash #!/bin/bash cd /home/container # Output Current Java Version java -version ## only really needed to show what version is being used. Should be changed for different applications # Replace Startup Variables MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` echo ":/home/container$ ${MODIFIED_STARTUP}" # Run the Server ${MODIFIED_STARTUP} ``` -------------------------------- ### Copy and Execute Entrypoint Script in Dockerfile Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx Copies the entrypoint script, makes it executable, and sets Tini as the init process. The CMD points to the entrypoint script. ```dockerfile COPY --chown=container:container ./entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] CMD ["/entrypoint.sh"] ``` -------------------------------- ### Create Let's Encrypt Directory Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Manually create the directory structure for Let's Encrypt certificates, similar to Certbot's configuration. ```sh sudo mkdir -p /etc/letsencrypt/live/example.com ``` -------------------------------- ### Run All Migrations Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx A simple command to execute all pending database migrations. ```sh php artisan migrate ``` -------------------------------- ### Reference Variables in Startup Commands Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx Use `{{VAR_NAME}}` syntax to reference environment variables within startup commands. This is useful for dynamic configuration like memory allocation or jar file names. ```bash java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}} ``` -------------------------------- ### Configure YAML File with Wildcards Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx Demonstrates parsing a YAML configuration file using wildcard notation for advanced searching and replacement. Supports nested structures and multiple replacements. ```json { "config.yml": { "parser": "yaml", "find": { "listeners[0].query_enabled": true, "listeners[0].query_port": "{{server.allocations.default.port}}", "listeners[0].host": "0.0.0.0:{{server.allocations.default.port}}", "servers.*.address": { "127.0.0.1": "{{config.docker.interface}}", "localhost": "{{config.docker.interface}}" } } } } ``` -------------------------------- ### Downloading from a URL Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx Use `curl` with `-sSL` for silent, location-following downloads and `-o` to specify the output file. This is a common pattern for fetching server files. ```bash curl -sSL -o server.jar https://example.com/server.jar ``` -------------------------------- ### Format New EXT4 Device for Project Quotas Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Formats a device with the EXT4 filesystem, enabling project quotas during the process. Use the 'O' flag for feature options and 'E' for extended options like quotatype. ```bash mkfs.ext4 -O quota -E quotatype=prjquota /dev/sdb ``` -------------------------------- ### Run Wings Auto-Updater Source: https://github.com/pelican-dev/docs/blob/main/docs/wings/update.mdx Use this command to automatically update Wings. This feature is available starting from beta9. ```sh sudo wings update ``` -------------------------------- ### Add New Project IDs and Paths Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Edit the `/etc/projid` and `/etc/projects` files to define new projects. The `projid` file maps server UUIDs to project IDs, while the `projects` file maps project IDs to directory paths. ```shell # /etc/projid 235844d3-9258-4846-bb04-bcff209ccf9a:1 b91d5528-d53f-4586-8d5c-682027f74a36:2 ``` ```shell # /etc/projects 1:/var/lib/pelican/volumes/235844d3-9258-4846-bb04-bcff209ccf9a 2:/var/lib/pelican/volumes/b91d5528-d53f-4586-8d5c-682027f74a36 ``` -------------------------------- ### Create New Plugin Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/plugins.mdx Use the Artisan command to generate the basic file structure and configuration for a new plugin. This command initializes essential files like plugin.json, the main plugin file, a config file, and a service provider. ```bash php artisan p:plugin:make ``` -------------------------------- ### Build Panel Assets Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/update.mdx Rebuild the Panel's frontend assets using Yarn. This step is necessary if you have custom themes installed or after updating dependencies. ```sh yarn install yarn build ``` -------------------------------- ### Run Automatic Panel Update Script Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/update.mdx Use this command to automatically download and run the update script for Pelican Panel. The script will guide you through the process. ```sh sudo bash -c "$(curl -fsSL https://pelican.dev/updatePanel.sh)" ``` -------------------------------- ### Configure Queue Environment via CLI Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx Configure the queue driver and connection details. Supports Redis as a backend, allowing specification of host, user, password, and port. ```sh php artisan p:environment:queue [options] ``` ```sh Options: --driver[=DRIVER] The queue driver backend to use. --redis-host[=REDIS-HOST] --redis-user[=REDIS-USER] --redis-pass[=REDIS-PASS] --redis-port[=REDIS-PORT] -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Get Device UUID for fstab Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Retrieves the unique identifier (UUID) of a block device, which is recommended for mounting via fstab to ensure the correct device is always used. ```bash lsblk /dev/sdb -no UUID ``` -------------------------------- ### Configure Database Environment via CLI Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx Use this command to configure database connection settings. You can specify the driver, database name, host, port, username, and password. ```sh php artisan p:environment:database [options] ``` ```sh Options: --driver[=DRIVER] The database driver backend to use. --database[=DATABASE] --host[=HOST] --port[=PORT] --username[=USERNAME] --password[=PASSWORD] -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Remove Default Nginx Configuration Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/webserver-config.mdx Before applying a new Nginx configuration, it's necessary to remove the default configuration file. This command ensures a clean slate for your Pelican setup. ```sh sudo rm /etc/nginx/sites-enabled/default ``` -------------------------------- ### Generate Certificate with DNS Challenge Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Generates an SSL certificate using Certbot's manual DNS challenge. Requires creating a TXT DNS record for verification. Replace 'example.com' with your domain. ```sh certbot -d example.com --manual --preferred-challenges dns certonly ``` -------------------------------- ### Run Database Migrations Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx Executes all pending database migrations. Options allow specifying the database connection, forcing the operation, and controlling output. ```sh php artisan migrate [options] ``` ```sh Options: --database[=DATABASE] The database connection to use --force Force the operation to run when in production --path[=PATH] The path(s) to the migrations files to be executed (multiple values allowed) --realpath Indicate any provided migration file paths are pre-resolved absolute paths --schema-path[=SCHEMA-PATH] The path to a schema dump file --pretend Dump the SQL queries that would be run --seed Indicates if the seed task should be re-run --seeder[=SEEDER] The class name of the root seeder --step Force the migrations to be run so they can be rolled back individually --graceful Return a successful exit code even if an error occurs --isolated[=ISOLATED] Do not run the command if another instance of the command is already running [default: false] -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Configure Queue Service via CLI Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx This command sets up the queue worker service. You can specify the service name, the user and group PHP runs under, and force overwriting existing service files. ```sh php artisan p:environment:queue-service [options] ``` ```sh Options: --service-name[=SERVICE-NAME] Name of the queue worker service. --user[=USER] --group[=GROUP] --overwrite Force overwrite if the service file already exists. -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Create a User via CLI Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx Use this command to create a new user directly from the command line. You can specify email, username, password, and admin status. ```sh php artisan p:user:make [options] ``` ```sh Options: --email[=EMAIL] --username[=USERNAME] --password[=PASSWORD] --admin[=ADMIN] --no-password -q, --quiet Do not output any message -V, --version Display this application version --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Set Webserver File Ownership (Rocky Linux Apache) Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/panel-setup.mdx Set the correct ownership for the panel files for Rocky Linux with Apache. ```sh sudo chown -R apache:apache /var/www/pelican ``` -------------------------------- ### Plugin Settings Form and Saving Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/plugins.mdx Implement HasPluginSettings and EnvironmentWriterTrait to define a settings form with text inputs and toggles, and to save these settings to the .env file. ```php use EnvironmentWriterTrait; public function getSettingsForm(): array { return [ TextInput::make('test_input') ->required() ->default(fn () => config('myplugin.test_input')), Toggle::make('test_toggle') ->inline(false) ->default(fn () => config('myplugin.test_toggle')), ]; } public function saveSettings(array $data): void { $this->writeToEnvironment([ 'MYPLUGIN_TEST_INPUT' => $data['test_input'], 'MYPLUGIN_TEST_TOGGLE' => $data['test_toggle'], ]); Notification::make() ->title('Settings saved') ->success() ->send(); } ``` -------------------------------- ### Set Webserver File Ownership (NGINX/Apache/Caddy) Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/panel-setup.mdx Set the correct ownership for the panel files for NGINX, Apache, or Caddy webservers. ```sh sudo chown -R www-data:www-data /var/www/pelican ``` -------------------------------- ### Enable Nginx Configuration Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/webserver-config.mdx Symlink the Nginx configuration file to the sites-enabled directory and restart the Nginx service to apply changes. ```sh sudo ln -s /etc/nginx/sites-available/pelican.conf /etc/nginx/sites-enabled/pelican.conf ``` ```sh sudo systemctl restart nginx ``` -------------------------------- ### Modify Startup Command with Placeholders Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx Bash command to evaluate the STARTUP environment variable and replace curly-braced placeholders with corresponding environment variable values. ```bash MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` ``` -------------------------------- ### Create Storage Symlinks Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/update.mdx Link the storage directory to make uploaded files accessible. This command should be run after updating the Panel files. ```sh sudo php artisan storage:link ``` -------------------------------- ### Basic Docker Compose Configuration Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/docker.mdx This `compose.yml` file sets up the Pelican panel service, including image, restart policy, network, ports, volume mounts for data and logs, and essential environment variables. It also defines the necessary volumes and network configuration. ```yaml services: panel: image: ghcr.io/pelican-dev/panel:latest restart: always networks: - default ports: - "80:80" - "443:443" extra_hosts: - "host.docker.internal:host-gateway" volumes: - pelican-data:/pelican-data - pelican-logs:/var/www/html/storage/logs environment: XDG_DATA_HOME: /pelican-data APP_URL: "http://localhost" ADMIN_EMAIL: "USEYOUROWNEMAILHERE@example.com" volumes: pelican-data: pelican-logs: networks: default: ipam: config: - subnet: 172.20.0.0/16 ``` -------------------------------- ### Set Storage and Cache Permissions Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/panel-setup.mdx Set the correct read/write permissions for the storage and bootstrap/cache directories, allowing the webserver to use them. ```sh sudo chmod -R 755 storage/* bootstrap/cache/ ``` -------------------------------- ### Set Webserver File Ownership (Rocky Linux NGINX) Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/panel-setup.mdx Set the correct ownership for the panel files for Rocky Linux with NGINX. ```sh sudo chown -R nginx:nginx /var/www/pelican ``` -------------------------------- ### Enable Project Quotas on Existing EXT4 Filesystem Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Enables project quotas on an unmounted EXT4 filesystem using the 'tune2fs' command. This modification requires the device path and should only be performed on unmounted disks. ```bash tune2fs -Q prjquota /dev/sdb ``` -------------------------------- ### Cloning from Git Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx Clone a Git repository directly into the server directory using `git clone`. The `.` ensures files are placed in the current directory. ```bash git clone https://github.com/example/repo.git . ``` -------------------------------- ### Add EXT4 Mount with Project Quotas to fstab Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Appends a new entry to the /etc/fstab file to automatically mount a device with project quota options enabled on boot. Ensure the UUID and mount point are correct. ```shell UUID=6c3b1734-3db4-4368-9bee-58651731b206 /var/lib/pelican/volumes/ ext4 defaults,prjquota 0 1 ``` -------------------------------- ### Create MySQL User for Database Host Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/database-hosts.mdx Creates a new MySQL user with all privileges for the database host. Ensure you replace 'yourPassword' with a strong, unique password and '127.0.0.1' with the correct IP if your panel and Wings are on different machines. ```sql mysql -u root -p # Remember to change 'yourPassword' below to be a unique password # Replace 127.0.0.1 with your panel ip if your panel and wings are on different machines CREATE USER 'pelicanuser'@'127.0.0.1' IDENTIFIED BY 'yourPassword'; GRANT ALL PRIVILEGES ON *.* TO 'pelicanuser'@'127.0.0.1' WITH GRANT OPTION; exit ``` -------------------------------- ### Set Project Quota Limits Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/disk-quotas/ext4-xfs.mdx Configure disk quota limits for a project using the `setquota` command. The `-P` flag targets a project by its server UUID. Set soft limits to 0 as they are not used by Pelican. Hard limits define the resource constraints. ```bash setquota -P ${server_uuid} ${soft_limit} ${hard_limit} ${block_grace} ${inode_grace} ${path} ``` ```bash setquota -P 235844d3-9258-4846-bb04-bcff209ccf9a 0 10G 0 0 /var/lib/pelican/volumes/ ``` -------------------------------- ### Generate Certificate with Standalone Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Generates an SSL certificate using Certbot's standalone mode via HTTP challenge. Requires port 80 to be open. Use for Wings-only machines without a web server. Replace 'example.com' with your domain. ```sh certbot certonly --standalone -d example.com ``` -------------------------------- ### Access API Docs URL Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/api-docs.mdx To access the Pelican API documentation, navigate to this URL on your panel. Ensure you are signed in first. ```bash https://yourpaneladdress.com/docs/api ``` -------------------------------- ### Create Container User Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-yolk.mdx Creates a dedicated user named 'container' with a home directory at '/home/container' and a bash shell. This user is essential for running processes within the container with appropriate permissions. ```bash RUN useradd -m -d /home/container -s /bin/bash container ``` -------------------------------- ### Configure Caddy Systemd Service to Load Environment Variables Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Modify the Caddy systemd unit file to load environment variables from a specified file during startup. ```unit [Unit] Description=Caddy Documentation=https://caddyserver.com/docs/ After=network.target network-online.target Requires=network-online.target [Service] Type=notify User=caddy Group=caddy ExecStart=/usr/bin/caddy run --environ --envfile /etc/caddy/.secrets.env --config /etc/caddy/Caddyfile ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile TimeoutStopSec=5s LimitNOFILE=1048576 LimitNPROC=512 PrivateTmp=true ProtectSystem=full AmbientCapabilities=CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target ``` -------------------------------- ### Configure S3 Backup Storage Class Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/optional-config.mdx Specify the S3 storage class for backups. Defaults to STANDARD. ```sh AWS_BACKUPS_STORAGE_CLASS= ``` -------------------------------- ### Generate Certificate with Apache Plugin Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/ssl.mdx Generates an SSL certificate using Certbot's Apache plugin via HTTP challenge. Requires port 80 to be open. Replace 'example.com' with your domain. ```sh certbot certonly --apache -d example.com ``` -------------------------------- ### Enter Maintenance Mode Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/update.mdx Before performing a manual update, place the Panel into maintenance mode to prevent user errors. This command should be run from the Panel's directory. ```sh cd /var/www/pelican sudo php artisan down ``` -------------------------------- ### Create MySQL Database Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/mysql.mdx Creates a new MySQL database named 'panel'. This database will be used by the Pelican Panel. ```sql CREATE DATABASE panel; ``` -------------------------------- ### Restart Apache Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/change-panel-domain.mdx Restart the Apache service to apply webserver configuration changes. ```sh sudo systemctl restart apache2 ``` -------------------------------- ### Update URL with Wildcard Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/plugins.mdx This JSON structure shows how to use a wildcard '*' for plugin update checking, providing a default version and download URL when a specific panel version is not found. ```json { "*": { "version": "1.1.0", "download_url": "..." } } ``` -------------------------------- ### Reference Variables in Configuration File Parsers Source: https://github.com/pelican-dev/docs/blob/main/docs/eggs/creating-a-custom-egg.mdx When using configuration file parsers, reference variables using a dot notation like `{{server.environment.VAR_NAME}}` or `{{server.allocations.default.port}}`. This allows dynamic injection of values into configuration files. ```json { "server.properties": { "parser": "properties", "find": { "server-port": "{{server.allocations.default.port}}", "max-players": "{{server.environment.MAX_PLAYERS}}", "server-name": "{{server.environment.SERVER_NAME}}" } } } ``` -------------------------------- ### Download and Extract Panel Update Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/update.mdx Download the latest release archive of Pelican Panel from GitHub and extract it to the current directory. Ensure correct permissions are set on storage and bootstrap/cache directories afterward. ```sh curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | sudo tar -xzv sudo chmod -R 755 storage/* bootstrap/cache ``` -------------------------------- ### Configure Mail Environment via CLI Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/artisan.mdx This command configures the mail settings for the Panel. Specify the driver, sender email, display name, encryption, host, port, and authentication credentials. ```sh php artisan p:environment:mail [options] ``` ```sh Options: --driver[=DRIVER] The mail driver to use. --email[=EMAIL] Email address that messages from the Panel will originate from. --from[=FROM] --encryption[=ENCRYPTION] --host[=HOST] --port[=PORT] --endpoint[=ENDPOINT] --username[=USERNAME] --password[=PASSWORD] -q, --quiet Do not output any message --ansi|--no-ansi Force (or disable --no-ansi) ANSI output -n, --no-interaction Do not ask any interactive question ``` -------------------------------- ### Download Panel Files Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/getting-started.mdx Download the latest release of the Pelican Panel using curl and extract the archive. ```sh curl -L https://github.com/pelican-dev/panel/releases/latest/download/panel.tar.gz | sudo tar -xzv ``` -------------------------------- ### Restart Caddy Source: https://github.com/pelican-dev/docs/blob/main/docs/guides/change-panel-domain.mdx Restart the Caddy service to apply webserver configuration changes. ```sh sudo systemctl restart caddy ``` -------------------------------- ### Configure /etc/hosts for NAT Loopback Source: https://github.com/pelican-dev/docs/blob/main/docs/troubleshooting.mdx Add an entry to the /etc/hosts file to resolve domain names to IP addresses for panel and Wings machines on the same network. This helps prevent NAT loopback issues when using domains. ```text 123.123.123.123 panel.example.com node.example.com ``` -------------------------------- ### Fix Panel File Permissions Source: https://github.com/pelican-dev/docs/blob/main/docs/troubleshooting.mdx Sets the correct read, write, and execute permissions for the storage and bootstrap/cache directories of the panel. ```sh sudo chmod -R 755 /var/www/pelican/storage/* /var/www/pelican/bootstrap/cache/ ``` -------------------------------- ### Registering Custom Admin Role Permissions Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/plugins.mdx Define default and custom permissions for models, and assign icons to custom models using Role::registerCustomDefaultPermissions and Role::registerCustomPermissions within a service provider. ```php public function register(): void { // Register default permissions: viewList, view, create, update, delete Role::registerCustomDefaultPermissions('myModel'); // Register custom permissions Role::registerCustomPermissions([ 'myModel' => [ 'customPerm1', 'customPerm2' ] ]); // Optionally, register an icon for a custom model Role::registerCustomModelIcon('myModel', 'tabler-star'); // You can also add new permissions to existing models Role::registerCustomPermissions([ 'server' => [ 'custom', ] ]); } ``` -------------------------------- ### Create MySQL User Source: https://github.com/pelican-dev/docs/blob/main/docs/panel/advanced/mysql.mdx Creates a new MySQL user 'pelican' with password 'somePassword', restricted to localhost connections. ```sql CREATE USER 'pelican'@'127.0.0.1' IDENTIFIED BY 'somePassword'; ```