ハマクラ Advent Calendar 2025 3日目の記事です
はじめに
Proxmox環境でHelper-Scriptsを使ってPterodactylを建てる手順です
Cloudflare Tunnelと組み合わせることで外部から鯖の管理が簡単にできます
構築手順
PanelとWingsのインストール
Proxmoxのシェルで以下を実行
どちらもDefault Settingsで続行
コンテナIDやIPアドレスを変えたい場合はAdvancedで続行
Panel
途中でログイン情報を聞かれるから入力する
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/pterodactyl-panel.sh)"
Wings
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/pterodactyl-wings.sh)"
containerd.ioのダウングレード
ProxmoxのLXCの問題でcontainerd.ioの最新バージョンが動かないので一旦ダウングレード
wingsのコンテナで以下を実行
apt install -y --allow-downgrades containerd.io=1.7.28-1~debian.13~trixie
Cloudflareのドメインを設定する
※LANでしかパネルを使わない場合、この工程はスキップして良い
Panel用urlはhttps://ローカルIP
Wings用urlはhttps://ローカルIP
その他のアプリケーション設定 から TLS検証なし をオンにする
パネルの設定
SSL対応にする
ApacheのSSL有効化と証明書の作成
以下をPanelのコンテナで実行
a2enmod ssl
systemctl restart apache2.service
mkdir -p /etc/certs/
cd /etc/certs/
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=NA/ST=NA/L=NA/O=NA/CN=Generic SSL Certificate" -keyout privkey.pem -out fullchain.pem
configを編集する
/etc/apache2/sites-available/pterodactyl.conf
ポートを変更
- <VirtualHost *:80>
+ <VirtualHost *:443>
SSL有効化
※VirtualHost内に記載
SSLCertificateFile /etc/certs/fullchain.pem
SSLCertificateKeyFile /etc/certs/privkey.pem
SSLEngine on
以下Config例
※環境によって変わる場合もある
<VirtualHost *:443>
ServerName pterodactyl
DocumentRoot /opt/pterodactyl-panel/public
AllowEncodedSlashes On
php_value upload_max_filesize 100M
php_value post_max_size 100M
<Directory /opt/pterodactyl-panel/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/pterodactyl_error.log
CustomLog /var/log/apache2/pterodactyl_access.log combined
SSLCertificateFile /etc/certs/fullchain.pem
SSLCertificateKeyFile /etc/certs/privkey.pem
SSLEngine on
</VirtualHost>
ログイン情報を取得する
以下のコマンドを実行するとログイン情報が表示される
cat ~/pterodactyl-panel.creds
LocationとNodeを作成し、Generate Tokenする
Wingsのコンテナに貼り付けて実行
エラーが出る場合は表示されているConfiguration Fileを/etc/pterodactyl/config.ymlにコピペする
Configの編集
config.ymlが生成されるので以下のように編集する
cert: /etc/certs/fullchain.pem
key: /etc/certs/privkey.pem
remoteのアドレスは以下のようにパネルの公開アドレスに変更する
remote: https://yourhostname.com
証明書の発行
Wingsのコンテナで以下を実行
mkdir -p /etc/certs/
cd /etc/certs/
openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -subj "/C=NA/ST=NA/L=NA/O=NA/CN=Generic SSL Certificate" -keyout privkey.pem -out fullchain.pem
Wingsを再起動
systemctl restart wings.service
参考記事など