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

# Debian install

| OS     | Version | Supported | Notes                                                                                                                  |
| ------ | :-----: | :-------: | ---------------------------------------------------------------------------------------------------------------------- |
| Debian |    11   |     ✅     |                                                                                                                        |
|        |    12   |     ✅     |                                                                                                                        |
|        |    13   |     ✅     | MariaDB can be installed without the repository setup script. Redis can be installed without the Redis APT repository. |

## Dependency Install

```# Dependency Installation theme={null}
apt install -y curl ca-certificates gnupg2 sudo lsb-release

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
curl -fsSL https://packages.sury.org/php/apt.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.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

curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash

apt update

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

## Installing Composer

```# Install composer theme={null}
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
```

## Download panel files

```# Download latest panel files theme={null}
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/
```

## Database

```# Database configuration with mysql theme={null}
mysql -u root -p
```

<Info>
  ## You can use mariadb in place of mysql

  ```# Database configuration with mariadb theme={null}
  mariadb -u root -p
  ```
</Info>

```# Add pterodactyl user theme={null}
CREATE USER 'pterodactyl'@'127.0.0.1' IDENTIFIED BY 'yourPassword';
```

```# Create the database theme={null}
CREATE DATABASE panel;
```

```# Grant permissions to database user theme={null}
GRANT ALL PRIVILEGES ON panel.* TO 'pterodactyl'@'127.0.0.1' WITH GRANT OPTION;
```

```# Exit theme={null}
exit
```

## Environment

```# Copy .env theme={null}
cp .env.example .env
```

```# Install core dependencies theme={null}
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --optimize-autoloader
```

<Danger>
  ## Do not run when you already have an encryption key

  ```# Generate encryption key theme={null}
  php artisan key:generate --force
  ```
</Danger>

```# Backup encryption key theme={null}
grep APP_KEY /var/www/pterodactyl/.env
```

## Setup .env

```# Environment setup theme={null}
php artisan p:environment:setup
```

```# Database setup theme={null}
php artisan p:environment:database
```

```# Mail setup (optional) theme={null}
php artisan p:environment:mail
```

## Database Setup

```# Migrate DATABASE theme={null}
php artisan migrate --seed --force
```

## Adding users

```# Make user theme={null}
php artisan migrate --seed --force
```

## Set permissions

```# Pterodactyl directory theme={null}
chown -R www-data:www-data /var/www/pterodactyl/*
```

```# Nginx web permissions (if applicable) theme={null}
chown -R nginx:nginx /var/www/pterodactyl/*
```

```# Apache web permissions (if applicable) theme={null}
chown -R apache:apache /var/www/pterodactyl/*
```

## Queue Listeners

```# Crontab with crontab -e theme={null}
* * * * * php /var/www/pterodactyl/artisan schedule:run >> /dev/null 2>&1
```

```# Queue Worker in /etc/systemd/system/pteroq.service 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
```

```# Enable redis theme={null}
sudo systemctl enable --now redis-server
```

```# Enable the worker theme={null}
sudo systemctl enable --now pteroq.service
```
