> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brolve.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pterodactyl Kurulum

> Brolve.com üzerinden satın alınan sunucu hizmetine nasıl Pterodactyl Sunucu Yönetim Paneli kurulabilir?

[](https://pterodactyl.io/panel/1.0/getting_started.html#picking-a-server-os)

<Tip>
  [**Resmi Pterodactyl kurulum dokümantasyonu**](https://pterodactyl.io/panel/1.0/getting_started.html#picking-a-server-os)
</Tip>

### Manuel Kurulum:

<Steps>
  <Step title="İşletim Sistemi Seçimi">
    | İşletim Sistemi | Versiyon | Destek Var Mı? |
    | --------------- | -------- | -------------- |
    | Ubuntu          | 20.04    | ✅              |
    |                 | 22.04    | ✅              |
    | AlmaLinux       | 8        | ✅              |
    | Debian          | 11       | ✅              |
  </Step>

  <Step title="Gereksinimler">
    * PHP `8.2` or `8.3` (recommended) with the following extensions: `cli`, `openssl`, `gd`, `mysql`, `PDO`, `mbstring`, `tokenizer`, `bcmath`, `xml` or `dom`, `curl`, `zip`, and `fpm` if you are planning to use NGINX.

    * MySQL `5.7.22` and higher (MySQL `8` recommended) **or** MariaDB `10.2` and higher.

    * Redis (`redis-server`)

    * A webserver (Apache, NGINX, Caddy, etc.)

    * `curl`

    * `tar`

    * `unzip`

    * `git`

    * `composer` v2
  </Step>

  <Step title="Kurulum Komutları">
    Aşağıdaki komutları not satırlarını dikkate alarak tek tek konsolunuza giriniz. Alınabilecek hatalara karşı konsolu izleyiniz.

    ```bash theme={null}
    # Repo ekleme komutları
    apt -y install software-properties-common curl apt-transport-https ca-certificates gnupg

    # PHP eklenti repo komutu (Ubuntu 20.04 and Ubuntu 22.04 Uyumlu)
    LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php

    # Redis reposunu ekleme komutu
    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

    # MariaDB Veritabanı repo betiği (Ubuntu 20.04 Uyumlu)
    curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

    # Repoları güncelleme komutu
    apt update

    # Gereksinimleri indirme komutu
    apt -y install php8.3 php8.3-{common,cli,gd,mysql,mbstring,bcmath,xml,fpm,curl,zip} mariadb-server nginx tar unzip git redis-server

    # Composer kurma betiği
    curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
    ```
  </Step>

  <Step title="Pterodactyl Dosyalarını İndirme">
    ```bash theme={null}
    # Klasör oluşturma komutu
    mkdir -p /var/www/pterodactyl
    cd /var/www/pterodactyl
    # Dosyaları indirme komutu
    curl -Lo panel.tar.gz https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz
    tar -xzvf panel.tar.gz
    chmod -R 755 storage/* bootstrap/cache/
    ```
  </Step>

  <Step title="Veritabanı Kurulumu">
    ```bash theme={null}
    # Veritabanına giriş
    # MariaDB kullanıyorsanız (Varsayılan)
    mariadb -u root -p
    # MySQL kullanıyorsanız
    mysql -u root -p
    ```
  </Step>

  <Step title="Composer ve Environment Kurulumu">
    ```bash theme={null}
    cp .env.example .env
    COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader

    # Eğer ilk defa kuruyorsanız ve veritabanında başka bir anahtar yoksa giriniz.
    php artisan key:generate --force
    ```

    <Warning>
      Şifreleme anahtarınızı yedekleyin (.env dosyasındaki APP\_KEY). Güvenli bir şekilde saklanması gereken tüm veriler için şifreleme anahtarı olarak kullanılır (örn. api anahtarları). Güvenli bir yerde saklayın. Kaybederseniz tüm şifrelenmiş veriler kurtarılamaz (veritabanı yedekleriniz olsa bile).
    </Warning>
  </Step>

  <Step title="Environment Konfigürasyonu">
    ```bash theme={null}
    php artisan p:environment:setup
    php artisan p:environment:database

    # PHP'nin dahili e-posta gönderimini kullanmak için, "mail" seçeneğini seçin. (önerilmez)
    # Özel bir SMTP sunucusu kullanmak için "smtp" seçeneğini seçin.
    php artisan p:environment:mail
    ```
  </Step>

  <Step title="Veritabanı Kurulumu">
    ```bash theme={null}
    php artisan migrate --seed --force

    # Sisteme ilk kullanıcı ekleme
    php artisan p:user:make

    # İzinleri düzenleme
    # NGINX, Apache or Caddy Uyumlu (Ubuntu/Debian Uyumlu)
    chown -R www-data:www-data /var/www/pterodactyl/*
    # NGINX Uyumlu (AlmaLinux Uyumlu)
    chown -R nginx:nginx /var/www/pterodactyl/*
    # Apache Uyumlu (AlmaLinux Uyumlu)
    chown -R apache:apache /var/www/pterodactyl/*
    ```
  </Step>

  <Step title="Crontab Kurulumu">
    `sudo crontab -e` komutu girin ve aşağıdaki betiği yapıştırıp kaydedin.

    ```bash theme={null}
    * * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1
    ```
  </Step>

  <Step title="Pteroq Servisi Kurulumu">
    nano metin düzenleyicisini `sudo nano` komutuyla açın. Ardından aşağıdaki kodu yapıştırın ve dosyayı `/etc/systemd/system/pteroq.service` konumuna kaydedin. <u>Eğer redis kullanmıyorsanız **Unit** başlığındaki **After** yazan satırı siliniz. Eğer AlmaLinux kullanıyorsanız </u>**redis-server.service**<u> kısmını </u>**redis.service**<u> ile değiştirin.</u>

    ```bash theme={null}
    # Pterodactyl Queue Worker File
    # ----------------------------------

    [Unit]
    Description=Pterodactyl Queue Worker
    After=redis-server.service

    [Service]
    # On some systems the user and group might be different.
    # Some systems use `apache` or `nginx` as the user and group.
    User=www-data
    Group=www-data
    Restart=always
    ExecStart=/usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
    StartLimitInterval=180
    StartLimitBurst=30
    RestartSec=5s

    [Install]
    WantedBy=multi-user.target
    ```
  </Step>

  <Step title="Pterodactyl Servisini Aktifleştirme">
    ```bash theme={null}
    # pteroq Servisini Aktifleştirme
    sudo systemctl enable --now pteroq.service
    # Eğer Redis kullanıyorsanız
    sudo systemctl enable --now redis-server
    ```
  </Step>

  <Step title="Web Sunucu Konfigürasyonu">
    İlk olarak, varsayılan NGINX klasörünü kaldırın.

    ```bash theme={null}
    rm /etc/nginx/sites-enabled/default
    ```

    Aşağıdaki koddaki `<domain>` kısımlarını pterodactyl panelinizin alan adıyla değiştirin. Sonrasında dosyayı eğer Ubuntu ve Debian'da ise `/etc/nginx/sites-available/pterodactyl.conf` konumuna eğer AlmaLinux ise` /etc/nginx/conf.d/pterodactyl.conf` konumuna kaydedin. Bu konfigürasyon dosyasıyla NGINX tabanında SSL desteği eklersiniz.

    ```bash theme={null}
    server {
        # Replace the example <domain> with your domain name or IP address
        listen 80;
        server_name <domain>;
        return 301 https://$server_name$request_uri;
    }

    server {
        # Replace the example <domain> with your domain name or IP address
        listen 443 ssl http2;
        server_name <domain>;

        root /var/www/pterodactyl/public;
        index index.php;

        access_log /var/log/nginx/pterodactyl.app-access.log;
        error_log  /var/log/nginx/pterodactyl.app-error.log error;

        # allow larger file uploads and longer script runtimes
        client_max_body_size 100m;
        client_body_timeout 120s;

        sendfile off;

        # SSL Configuration - Replace the example <domain> with your domain
        ssl_certificate /etc/letsencrypt/live/<domain>/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/<domain>/privkey.pem;
        ssl_session_cache shared:SSL:10m;
        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
        ssl_prefer_server_ciphers on;

        # See https://hstspreload.org/ before uncommenting the line below.
        # add_header Strict-Transport-Security "max-age=15768000; preload;";
        add_header X-Content-Type-Options nosniff;
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Robots-Tag none;
        add_header Content-Security-Policy "frame-ancestors 'self'";
        add_header X-Frame-Options DENY;
        add_header Referrer-Policy same-origin;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/run/php/php8.3-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param HTTP_PROXY "";
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
            fastcgi_connect_timeout 300;
            fastcgi_send_timeout 300;
            fastcgi_read_timeout 300;
            include /etc/nginx/fastcgi_params;
        }

        location ~ /\.ht {
            deny all;
        }
    }
    ```
  </Step>

  <Step title="Konfigürasyonu Aktifleştirme">
    ```bash theme={null}
    # Eğer AlmaLinux kullanıyorsanız symlinke ihtiyacınız yoktur.
    sudo ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/pterodactyl.conf

    # NGINX'ı yeniden başlatmanız için.
    sudo systemctl restart nginx
    ```
  </Step>

  <Step title="Wings Kurulumu">
    **İşletim Sistemi Seçimi**

    | İşletim Sistemi | Versiyon | Destek Var Mı?                                    |
    | --------------- | -------- | ------------------------------------------------- |
    | Ubuntu          | 20.04    | ✅                                                 |
    |                 | 22.04    | ✅                                                 |
    | AlmaLinux       | 8        | ✅                                                 |
    | Debian          | 11       | ✅                                                 |
    | Windows         | Hepsi    | ❌, Pterodactyl hiçbir Windows ortamında çalışmaz. |

    **Gereksinimlerin Kurulumu**

    ```bash theme={null}
    # Docker kurulumu
    curl -sSL https://get.docker.com/ | CHANNEL=stable bash
    # Dockeri başlangıçta başlat
    sudo systemctl enable --now docker
    ```

    **Wings Yazılımını İndirme ve Kurulum**

    ```bash theme={null}
    sudo mkdir -p /etc/pterodactyl
    curl -L -o /usr/local/bin/wings "https://github.com/pterodactyl/wings/releases/latest/download/wings_linux_$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")"
    sudo chmod u+x /usr/local/bin/wings
    sudo wings
    ```

    **Wings Konfigürasyon**
    Aşağıdaki kodu `/etc/systemd/system/wings.service` konumuna kaydedin.

    ```bash theme={null}
    [Unit]
    Description=Pterodactyl Wings Daemon
    After=docker.service
    Requires=docker.service
    PartOf=docker.service

    [Service]
    User=root
    WorkingDirectory=/etc/pterodactyl
    LimitNOFILE=4096
    PIDFile=/var/run/wings/daemon.pid
    ExecStart=/usr/local/bin/wings
    Restart=on-failure
    StartLimitInterval=180
    StartLimitBurst=30
    RestartSec=5s

    [Install]
    WantedBy=multi-user.target
    ```

    Sonrasında aşağıdaki komutla wings'i aktifleştirin.

    ```bash theme={null}
    sudo systemctl enable --now wings
    ```
  </Step>

  <Step title="Son Adımlar">
    Kurulum tamamlanması adına wings üzerine node kurulumu gibi adımlar vardır. Bu adımları Pterodactyl'in sitesi üzerinden tamamlayabilirsiniz.
  </Step>
</Steps>

### **Otomatik Kurulum**

Eğer manuel kurulum yapmak istemezseniz Vilhelm Prytz, Linux123123 tarafından geliştirilmiş resmi olmayan bir kurulum betiği vardır. Bu betik sayesinde saniyeler içerisinde kurulum gerçekleştirebilirsiniz.

[**Vilhelm Prytz'in GitHub Reposu**](https://github.com/pterodactyl-installer/pterodactyl-installer)

**Desteklenen İşletim Sistemleri**

| İşletim Sistemi | Versiyon | Destek Var Mı?                                    | PHP Versiyonu |
| --------------- | -------- | :------------------------------------------------ | :------------ |
| Ubuntu          | 20.04    | ✅                                                 | 8.3           |
|                 | 22.04    | ✅                                                 | 8.3           |
| AlmaLinux       | 8        | ✅                                                 | 8.3           |
| Debian          | 11       | ✅                                                 | 8.3           |
| Windows         | Hepsi    | ❌, Pterodactyl hiçbir Windows ortamında çalışmaz. |               |

<Steps>
  <Step title="Kurulum Komudu">
    Kurulumu başlatmak için aşağıdaki komutu konsola girin.

    ```
    bash <(curl -s https://pterodactyl-installer.se)
    ```

    Sonrasında adımları takip edin ve kurulumu tamamlayın.
  </Step>
</Steps>

<Note>
  Sunucu hizmetinize Pterodactyl Sunucu Yönetim Paneli hizmetimiz vardır. İlgileniyorsanız bizimle iletişime geçin!
</Note>

<Info>
  Eğer yardıma ihtiyaç duyarsanız [Discord](https://discord.gg/brolve) topluluğumuz üzerinden bir destek talebi oluşturarak bizimle iletişime geçin.
</Info>
