ControlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their pterodactyl servers. This dashboard comes with a credit-based billing solution that credits users hourly for each server they have and suspends them if they run out of credits.
This dashboard is built with Laravel as it offers a very robust and secure development environment.
I copied a part of pterodactyl’s documentation for the installation because it uses the same dependencies and covers this area pretty good.
## Dependencies
* PHP `7.4` or `8.0` (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` or higher (MySQL `8` recommended) **or** MariaDB `10.2` or higher.
* Redis (`redis-server`)
* A webserver (Apache, NGINX, Caddy, etc.)
*`curl`
*`tar`
*`unzip`
*`git`
*`composer` v2
### Example Dependency Installation
if you already have pterodactyl installed you can skip this step!
The commands below are simply an example of how you might install these dependencies. Please consult with your
operating system's package manager to determine the correct packages to install.
Now that all of the files have been downloaded we need to configure some core aspects of the Panel.
You will need a database setup and a user with the correct permissions created for that database before
continuing any further.
First we will copy over our default environment settings file, install core dependencies, and then generate a
new application encryption key.
``` bash
cp .env.example .env
composer install
# Only run the command below if you are installing this Panel
php artisan key:generate --force
# you should create a symbolic link from public/storage to storage/app/public
php artisan storage:link
```
Back up your encryption key (APP_KEY in the `.env` file). It is used as an encryption key for all data that needs to be stored securely (e.g. api keys).
Store it somewhere safe - not just on your server. If you lose it all encrypted data is irrecoverable -- even if you have database backups.
The last step in the installation process is to set the correct permissions on the Panel files so that the webserver can
use them correctly.
``` bash
# If using NGINX or Apache (not on CentOS):
chown -R www-data:www-data /var/www/dashboard/*
# If using NGINX on CentOS:
chown -R nginx:nginx /var/www/dashboard/*
# If using Apache on CentOS
chown -R apache:apache /var/www/dashboard/*
```
### Crontab Configuration
The first thing we need to do is create a new cronjob that runs every minute to process specific Dashboard tasks. like billing users hourly and suspending unpaid servers
You should paste the contents of the file below, replacing <domain> with your domain name being used in a file called dashboard.conf and place it in /etc/nginx/sites-available/, or — if on CentOS, /etc/nginx/conf.d/.
```bash
server {
listen 80;
root /var/www/dashboard/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name YOUR.DOMAIN.COM;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
```
### Enable configuration
The final step is to enable your NGINX configuration and restart it.
```bash
# You do not need to symlink this file if you are using CentOS.