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 me dizzy...
Since I have already installed 1panel, I just borrowed it to deploy.
For the installation of 1panel, please refer to EP1.
First, create a new site in 1panel, choose the runtime environment, and then choose reverse proxy or static website, as shown below:
Fill in the other information according to your own needs.
Download Files#
Find a suitable directory that you think is easy to remember or short enough, whatever you think is appropriate.
Take me as an example, after SSH connecting to the server, create /opt/pterodactyl
and enter it.
mkdir -p /opt/pterodactyl
cd /opt/pterodactyl
After creating the directory, it's time to pull docker-compose.yml
, as follows:
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, edit docker-compose.yml
, and configure the relevant information.
The following is a direct copy from the documentation, 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 about 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 the certificate.
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 the letsencrypt certificate | 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 protect 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 because 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 setting up, we can start the panel.
docker-compose up -d
If everything goes well, 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