# Creating a Panel

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Time Required</td><td>15 Minutes</td></tr><tr><td>Difficulty</td><td>Easy</td></tr></tbody></table>

## Installing the Panel

### Setting up the Portainer stack

Create your Portainer stack using the below compose and .env file

{% @github-files/github-code-block url="<https://github.com/trentnbauer/agg/blob/main/docker-compose/pterodactyl-panel.yml>" %}

{% code title=".ENV File" %}

```editorconfig
# --- Domain Settings ---
DOMAIN=example.com
SUBDOMAIN=panel.
TZ=UTC

# --- Networking ---
PORT_HTTP=80
# This should be your internal DNS / IP address
HOSTNAME=localhost

# --- Database ---
# These must match what is set in the 'database' service
MYSQL_PASS=
MYSQL_PASS_ROOT=

# --- Mail (SMTP) ---
MAIL_FROM=noreply@example.com
MAIL_SERVER=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASS=your-app-password

# --- Security ---
#Must be a random 32 character string - use your password generator
HASHIDS_SALT=

# --- Cloudflare Tunnel ---
CFPOLICY=bypass
CFACCESSNAME=Pterodactyl Panel
CFDURATION=8h
```

{% endcode %}

### Confirm the Panel is running

Check the Portainer logs for the panel container, you should see something similar to below

```
external vars exist.
Checking if https is required.
Checking if letsencrypt email is set.
No letsencrypt email is set using http config.
Removing the default nginx config
Checking database status.
Waiting for database connection...
database (172.28.0.3:3306) open
Migrating and Seeding D.B
   INFO  Nothing to migrate.  
   INFO  Seeding database.  
  Database\Seeders\NestSeeder ........................................ RUNNING  
  Database\Seeders\NestSeeder ................................... 2.34 ms DONE  
  Database\Seeders\EggSeeder ......................................... RUNNING  
*********************************************
*     Updating Eggs for Nest: Minecraft     *
*********************************************
Updated Paper
Updated Bungeecord
Updated Vanilla Minecraft
Updated Sponge (SpongeVanilla)
Updated Forge Minecraft
*************************************************
*     Updating Eggs for Nest: Source Engine     *
*************************************************
Updated Counter-Strike: Global Offensive
Updated Garrys Mod
Updated Team Fortress 2
Updated Ark: Survival Evolved
Updated Insurgency
Updated Custom Source Engine Game
*************************************************
*     Updating Eggs for Nest: Voice Servers     *
*************************************************
Updated Teamspeak3 Server
Updated Mumble Server
****************************************
*     Updating Eggs for Nest: Rust     *
****************************************
Updated Rust
  Database\Seeders\EggSeeder .................................. 175.67 ms DONE  
Starting cron jobs.
Starting supervisord.
2023-06-13 13:41:50,854 CRIT Server 'unix_http_server' running without any HTTP authentication checking
```

#### Confirm the Login page loads

Browse to [http://yourserver:port](https://www.trentbauer.com/guides/installation-guides/pterodactyl/http:/yourserver:port) and confirm you see the below

<figure><img src="/files/o9zxp8nzI5YBXokRd4jw" alt=""><figcaption></figcaption></figure>

## Create your Admin user

1. Open up Portainer and navigate to the Panel container
2. Click on Console and change the command to '/bin/sh'
3. Hit Connect
4. Input the below command and next through the prompts (set account as administrator)

```sh
php artisan p:user:make
```

5. Log into Pterodactyl with your newly created administrator account

## Configure the Panel

### Enforce 2FA

1. Click on the Settings cog in the top right hand corner
2. Click on Settings
3. Set 'Require 2FA authentication' to 'All Users' and hit Save
4. Click on 'Enable 2FA' and follow the steps
5. Save your backup codes somewhere

### Create Node Locations

1. Click on Locations, then 'create new'
2. Create 2 locations,
   1. a location for 'On Prem' nodes
   2. a location for 'Off Prem' nodes

## Confirm the Proxy address loads

{% hint style="info" %}
As you have configured the Panel using Dockflare, you do not need to take any additional steps for this.
{% endhint %}

Browse to the ${SUBDOMAIN}${DOMAIN} you set in your [.env file](/guides/installation-guides/pterodactyl/creating-a-new-panel.md#setting-up-the-portainer-stack) and ensure the page loads. If it was freshly created, you may need to wait some time for DNS to sync.

Refer to the [DockFlare (Tunnel management)](/guides/other-guides/cloudflare/dockflare-tunnel-management.md) webui to confirm it is applying


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.trentbauer.com/guides/installation-guides/pterodactyl/creating-a-new-panel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
