EP2: Pterodactyl Frontend#
Many of the services on my Hong Kong machine are running inside Docker. At first, I didn't think it would work, but after reading the documentation carefully, it turns out it can. However, it made my head spin...
Since I already have 1panel installed, I decided to use it for deployment.
For the installation of 1panel, please refer to EP1.
First, create a new site in 1panel, choose the runtime environment, and then select reverse proxy or static website, as shown below:
Fill in the other details according to your own needs.
Download Files#
Choose a suitable directory that you find easy to remember or short enough, whatever you think is appropriate.
In my case, after connecting to the server via SSH, create /opt/pterodactyl
and enter it:
mkdir -p /opt/pterodactyl
cd /opt/pterodactyl
Once the directory is created, it's time to pull the docker-compose.yml
, as shown below:
curl -Lo docker-compose.yml https://raw.githubusercontent.com/pterodactyl-china/panel/1.0-develop/docker-compose.example.yml
# Apply executable permissions to the yml file
chmod +x docker-compose.yml
Next, go to the website directory in 1panel and edit docker-compose.yml
to configure the relevant information.
The following is directly copied from the documentation, so you can skip it if you don't need it:
::: info {docker-compose.yml Configuration Instructions}
Environment Variables#
When you don't provide your own .env
file, there are multiple environment variables that can be configured for the panel. For detailed information on each available option, please refer to the table below.
Note: If your APP_URL
starts with https://
, you also need to provide LE_EMAIL
to generate certificates.
Variable | Description | Required |
---|---|---|
APP_URL | The URL (including protocol) to access the panel | Yes |
APP_TIMEZONE | The timezone used by the panel | Yes |
LE_EMAIL | The email used to generate letsencrypt certificates | Yes |
DB_HOST | The MySQL host | Yes |
DB_PORT | The MySQL port | Yes |
DB_DATABASE | The MySQL database name | Yes |
DB_USERNAME | The MySQL username | Yes |
DB_PASSWORD | The MySQL password for the specified user | Yes |
CACHE_DRIVER | The cache driver (see Cache Drivers for details) | Yes |
SESSION_DRIVER | Yes | |
QUEUE_DRIVER | Yes | |
REDIS_HOST | The hostname or IP address of the Redis database | Yes |
REDIS_PASSWORD | The password used to secure the Redis database | Optional |
REDIS_PORT | The Redis database port | Optional |
MAIL_DRIVER | The mail driver (see Mail Drivers for details) | Yes |
MAIL_FROM | The sender's email address | Yes |
MAIL_HOST | The mail driver host | Optional |
MAIL_PORT | The mail driver port | Optional |
MAIL_USERNAME | The mail driver username | Optional |
MAIL_PASSWORD | The mail driver password | Optional |
Cache Drivers#
You can choose different cache drivers according to your preferences. We recommend using redis when using docker, as it can be easily started in a container.
Driver | Description | Required Variables |
---|---|---|
redis | The host where redis is running | REDIS_HOST |
redis | The port where redis is running | REDIS_PORT |
redis | The password for the redis database | REDIS_PASSWORD |
Mail Drivers#
You can choose different mail drivers according to your needs. Each driver requires setting MAIL_FROM
.
Driver | Description | Required Variables |
---|---|---|
Use the installed PHP mail | ||
mandrill | Mandrill | MAIL_USERNAME |
postmark | Postmark | MAIL_USERNAME |
mailgun | Mailgun | MAIL_USERNAME , MAIL_HOST |
smtp | Any SMTP server can be configured | MAIL_USERNAME , MAIL_HOST , MAIL_PASSWORD , MAIL_PORT |
::: |
After configuring, it's time to start the panel:
docker-compose up -d
If everything is normal, you should see a container named `` in the 1panel container interface.
Next, we will add the first user, which is the administrator user:
docker-compose exec panel php artisan p:user:make
The password for the account should meet the following criteria: 8 characters, a mix of uppercase and lowercase letters, and at least one number.
Next, we will reverse proxy the frontend and connect to the backend.
This article is synchronized and updated to xLog by Mix Space
The original link is https://www.akio.top/posts/course/pterodactyl-ep2